From ecae2ad7455094fc72ae9abfe8e8a226130fe570 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 23 Oct 2023 22:40:07 +0800 Subject: improve links --- xmake/modules/core/tools/gcc.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.3.1