Skip to content

Commit

Permalink
Merge pull request #3901 from xmake-io/link
Browse files Browse the repository at this point in the history
support lib path for add_links #3889
  • Loading branch information
waruqi committed Jun 29, 2023
2 parents 8a411ae + 0898fd2 commit efe0cbf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 5 additions & 1 deletion xmake/modules/core/tools/gcc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion xmake/modules/core/tools/link.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion xmake/modules/core/tools/nvcc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit efe0cbf

Please sign in to comment.