Fix Makefile linking to object files
This commit is contained in:
parent
8bf4499335
commit
faba7a72dc
@ -236,14 +236,14 @@
|
||||
end
|
||||
|
||||
-- The "-l" flag is fine for system libraries
|
||||
links = config.getlinks(cfg, "system", "name")
|
||||
links = config.getlinks(cfg, "system", "fullpath")
|
||||
for _, link in ipairs(links) do
|
||||
if path.isframework(link) then
|
||||
table.insert(result, "-framework " .. path.getbasename(link))
|
||||
elseif path.isobjectfile(link) then
|
||||
table.insert(result, link)
|
||||
else
|
||||
table.insert(result, "-l" .. link)
|
||||
table.insert(result, "-l" .. path.getbasename(link))
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -262,6 +262,31 @@
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- If the object file is referenced with a path, it should be
|
||||
-- made relative to the project.
|
||||
--
|
||||
|
||||
function suite.links_onObjectFileOutsideProject()
|
||||
location "MyProject"
|
||||
links { "obj/Debug/generated.o" }
|
||||
prepare()
|
||||
test.isequal({ "../obj/Debug/generated.o" }, gcc.getlinks(cfg))
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Make sure shell variables are kept intact for object file paths.
|
||||
--
|
||||
|
||||
function suite.links_onObjectFileWithShellVar()
|
||||
location "MyProject"
|
||||
links { "$(IntDir)/generated.o" }
|
||||
prepare()
|
||||
test.isequal({ "$(IntDir)/generated.o" }, gcc.getlinks(cfg))
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Include directories should be made project relative.
|
||||
--
|
||||
|
Reference in New Issue
Block a user