summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIMXEren <[email protected]>2025-07-06 22:08:52 +0530
committerIMXEren <[email protected]>2025-07-06 22:08:52 +0530
commit77ac26ceefd28ce8091a65e3f6ff19d51bed8bab (patch)
treef3b913b500b72fd93c4248619f35bfde44105611
parent207f0a10dc931ffc744a8e50eab00004c5d5da5e (diff)
refactor: use rustc.nf_framework instead of directly creating extern flags
-rw-r--r--xmake/rules/utils/inherit_links/inherit_links.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/rules/utils/inherit_links/inherit_links.lua b/xmake/rules/utils/inherit_links/inherit_links.lua
index cdac9ace6..e729ddf7d 100644
--- a/xmake/rules/utils/inherit_links/inherit_links.lua
+++ b/xmake/rules/utils/inherit_links/inherit_links.lua
@@ -96,9 +96,9 @@ function main(target)
local cratetype = target:values("rust.cratetype")
-- only bin, lib, rlib, dylib can make use of --extern CRATE[=PATH]
if cratetype ~= "staticlib" and cratetype ~= "cdylib" then
- local cratename = target:values("rust.cratename") or target:name()
- local extern_crate_opt = string.format('--extern %s=%s', cratename, target:targetfile())
- _add_export_value(target, "rcldflags", extern_crate_opt)
+ local extern_crate_opt = rustc:nf_framework(target:targetfile())
+ local extern_crate = table.concat(extern_crate_opt, " ")
+ _add_export_value(target, "rcflags", extern_crate)
end
end
end