summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/cl6x.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-01-24 22:45:58 +0800
committerruki <[email protected]>2025-01-24 22:45:58 +0800
commit1f59ab2428339916eafc2bdc1350641cc1c4f6d3 (patch)
tree27c03e7f47ba77018516d91e0d63421b1fdf4f7d /xmake/modules/core/tools/cl6x.lua
parentdbaf52568f4bb1152ad7123917a98b52f60adaa6 (diff)
support static libs
Diffstat (limited to 'xmake/modules/core/tools/cl6x.lua')
-rw-r--r--xmake/modules/core/tools/cl6x.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/cl6x.lua b/xmake/modules/core/tools/cl6x.lua
index 0485d2b9c..c2d272bb7 100644
--- a/xmake/modules/core/tools/cl6x.lua
+++ b/xmake/modules/core/tools/cl6x.lua
@@ -80,6 +80,35 @@ function nf_sysincludedir(self, dir)
return nf_includedir(self, dir)
end
+-- make the link flag
+function nf_link(self, lib)
+ if not lib:endswith(".a") and not lib:endswith(".so") then
+ lib = "lib" .. lib .. ".a"
+ end
+ return "-l" .. lib
+end
+
+-- make the syslink flag
+function nf_syslink(self, lib)
+ return nf_link(self, lib)
+end
+
+-- make the linkdir flag
+function nf_linkdir(self, dir)
+ return {"-i" .. path.translate(dir)}
+end
+
+-- make the rpathdir flag
+function nf_rpathdir(self, dir, opt)
+ opt = opt or {}
+ local extra = opt.extra
+ if extra and extra.installonly then
+ return
+ end
+ dir = path.translate(dir)
+ return {"-rpath=" .. dir}
+end
+
-- make the link arguments list
function linkargv(self, objectfiles, targetkind, targetfile, flags, opt)
local argv = table.join("-z", "--output_file=" .. targetfile, objectfiles, flags)