summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-06-29 11:51:11 +0800
committerGitHub <[email protected]>2023-06-29 11:51:11 +0800
commitefe0cbf20e9c5415b159807c96d98af7b6164e1d (patch)
treea14f6c17f6bbfeb1f6218e62ae8f1366a91c6df4
parent8a411ae004b06f6c1be10f82d0070faa1f92bb36 (diff)
parent0898fd246104e549351ecf58007314524825479f (diff)
Merge pull request #3901 from xmake-io/link
support lib path for add_links #3889
-rw-r--r--xmake/modules/core/tools/gcc.lua6
-rw-r--r--xmake/modules/core/tools/link.lua5
-rw-r--r--xmake/modules/core/tools/nvcc.lua6
3 files changed, 14 insertions, 3 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 31b0deea5..b33bf0677 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -276,7 +276,11 @@ end
-- make the link flag
function nf_link(self, lib)
- return "-l" .. lib
+ if lib:endswith(".a") or lib:endswith(".so") or lib:endswith(".dylib") or lib:endswith(".lib") then
+ return lib
+ else
+ return "-l" .. lib
+ end
end
-- make the syslink flag
diff --git a/xmake/modules/core/tools/link.lua b/xmake/modules/core/tools/link.lua
index 87ba80b88..ee68cf01f 100644
--- a/xmake/modules/core/tools/link.lua
+++ b/xmake/modules/core/tools/link.lua
@@ -100,7 +100,10 @@ end
-- make the link flag
function nf_link(self, lib)
- return lib .. ".lib"
+ if not lib:endswith(".lib") then
+ lib = lib .. ".lib"
+ end
+ return lib
end
-- make the syslink flag
diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua
index 17ee920c7..5d5001712 100644
--- a/xmake/modules/core/tools/nvcc.lua
+++ b/xmake/modules/core/tools/nvcc.lua
@@ -229,7 +229,11 @@ end
-- make the link flag
function nf_link(self, lib)
- return "-l" .. lib
+ if lib:endswith(".a") or lib:endswith(".so") or lib:endswith(".dylib") or lib:endswith(".lib") then
+ return lib
+ else
+ return "-l" .. lib
+ end
end
-- make the syslink flag