Fixed SNC linking to static library projects
This commit is contained in:
parent
5761e86cb6
commit
adb36bf3e1
@ -81,17 +81,10 @@
|
||||
|
||||
|
||||
--
|
||||
-- Return the list of libraries to link, formatted for the linker command line.
|
||||
-- The linking behavior is the same as GCC.
|
||||
--
|
||||
|
||||
function snc.getlinks(cfg)
|
||||
local result = {}
|
||||
local links = config.getlinks(cfg, "all", "basename")
|
||||
for _, link in ipairs(links) do
|
||||
table.insert(result, "-l" .. link)
|
||||
end
|
||||
return result
|
||||
end
|
||||
snc.getlinks = premake.tools.gcc.getlinks
|
||||
|
||||
|
||||
|
||||
|
@ -76,4 +76,21 @@
|
||||
prepare()
|
||||
test.isequal({ "-lfs_stub", "-lnet_stub" }, snc.getlinks(cfg))
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- When linking to a static sibling library, the relative path to the library
|
||||
-- should be used instead of the "-l" flag. This prevents linking against a
|
||||
-- shared library of the same name, should one be present.
|
||||
--
|
||||
|
||||
function suite.links_onStaticSiblingLibrary()
|
||||
links { "MyProject2" }
|
||||
test.createproject(sln)
|
||||
kind "StaticLib"
|
||||
location "MyProject2"
|
||||
targetdir "lib"
|
||||
prepare()
|
||||
test.isequal({ "lib/libMyProject2.a" }, snc.getlinks(cfg))
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user