From 77ac26ceefd28ce8091a65e3f6ff19d51bed8bab Mon Sep 17 00:00:00 2001 From: IMXEren <96839938+IMXEren@users.noreply.github.com> Date: Sun, 6 Jul 2025 22:08:52 +0530 Subject: refactor: use rustc.nf_framework instead of directly creating extern flags --- xmake/rules/utils/inherit_links/inherit_links.lua | 6 +++--- 1 file 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 -- cgit v1.3.1