summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/rustc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/core/tools/rustc.lua')
-rw-r--r--xmake/modules/core/tools/rustc.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/rustc.lua b/xmake/modules/core/tools/rustc.lua
index fa358e897..ab41620cd 100644
--- a/xmake/modules/core/tools/rustc.lua
+++ b/xmake/modules/core/tools/rustc.lua
@@ -65,6 +65,20 @@ function nf_syslink(self, lib)
return nf_link(self, lib)
end
+-- make the frameworkdir flag, crate module dependency directories
+function nf_frameworkdir(self, frameworkdir)
+ return {"-L", "dependency=" .. frameworkdir}
+end
+
+-- make the framework flag, crate module
+function nf_framework(self, framework)
+ local basename = path.basename(framework)
+ local cratename = basename:match("lib(.-)%-.-") or basename:match("lib(.-)")
+ if cratename then
+ return {"--extern", cratename .. "=" .. framework}
+ end
+end
+
-- make the rpathdir flag
function nf_rpathdir(self, dir)
dir = path.translate(dir)