summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-10-23 22:40:07 +0800
committerruki <[email protected]>2023-10-23 22:40:07 +0800
commitecae2ad7455094fc72ae9abfe8e8a226130fe570 (patch)
treef0a20c66f216bb17a9c83492e30cf977a6f60f94
parent788d4e5929e89c3d0faaee311d3aa8b60bbb419a (diff)
improve links
-rw-r--r--xmake/modules/core/tools/gcc.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index c0b2acf46..6589b6f13 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -292,7 +292,9 @@ end
-- make the link flag
function nf_link(self, lib)
- if lib:endswith(".a") or lib:endswith(".so") or lib:endswith(".dylib") or lib:endswith(".lib") then
+ if self:is_plat("linux") and (lib:endswith(".a") or lib:endswith(".so")) and not lib:find(path.sep(), 1, true) then
+ return "-l:" .. lib
+ elseif lib:endswith(".a") or lib:endswith(".so") or lib:endswith(".dylib") or lib:endswith(".lib") then
return lib
else
return "-l" .. lib