summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw568w <[email protected]>2023-08-09 11:26:49 +0800
committerw568w <[email protected]>2023-08-09 11:32:04 +0800
commitb618dfe97c7bef82a3a317117fc364d0366b2137 (patch)
treed8283bd4d4ee6d52b40807b929d8e8095d8296ec
parentda732687d5747e2140668ab0016a74315d1b40ae (diff)
minor style updates
-rw-r--r--xmake/modules/package/manager/cargo/find_package.lua3
-rw-r--r--xmake/modules/private/tools/rust/check_target.lua5
2 files changed, 4 insertions, 4 deletions
diff --git a/xmake/modules/package/manager/cargo/find_package.lua b/xmake/modules/package/manager/cargo/find_package.lua
index bc42b7148..98237adda 100644
--- a/xmake/modules/package/manager/cargo/find_package.lua
+++ b/xmake/modules/package/manager/cargo/find_package.lua
@@ -89,7 +89,8 @@ function _get_names_of_libraries(name, target, configs)
if configs.cargo_toml then
local cargo = assert(find_tool("cargo"), "cargo not found!")
local cargo_args = {"metadata", "--format-version", "1", "--manifest-path", configs.cargo_toml, "--color", "never"}
- if check_target(target, true) then
+ local target = check_target(target, true) and target or nil
+ if target then
table.insert(cargo_args, "--filter-platform")
table.insert(cargo_args, target)
end
diff --git a/xmake/modules/private/tools/rust/check_target.lua b/xmake/modules/private/tools/rust/check_target.lua
index e08e830da..fdc06458b 100644
--- a/xmake/modules/private/tools/rust/check_target.lua
+++ b/xmake/modules/private/tools/rust/check_target.lua
@@ -40,7 +40,6 @@ end
--
-- @return true if arch != nil and the target is supported by rustc, otherwise false
function main(arch, precise)
- print("arch: " .. arch)
if not arch then
return false
@@ -52,7 +51,7 @@ function main(arch, precise)
if #archs >= 2 then
result = true
else
- utils.warning("the arch \"%s\" is NOT a valid target triple, will be IGNORED and may cause compilation errors, please check it again", arch)
+ wprint("the arch \"%s\" is NOT a valid target triple, will be IGNORED and may cause compilation errors, please check it again", arch)
end
-- 2: check by rustc
@@ -69,7 +68,7 @@ function main(arch, precise)
end
end
if not result then
- utils.warning("the arch \"%s\" is NOT supported by rustc, will be IGNORED and may cause compilation errors, please check it again", arch)
+ wprint("the arch \"%s\" is NOT supported by rustc, will be IGNORED and may cause compilation errors, please check it again", arch)
end
end