Allow external projects to be explicitly linked; use target...() APIs to control target name

This commit is contained in:
Jason Perkins 2014-07-28 19:18:45 -04:00
parent 02eb13e99d
commit d39cb36aef
3 changed files with 4 additions and 44 deletions

View File

@ -284,7 +284,8 @@
-- Iterate all of the links listed in the configuration and boil
-- them down to the requested data set
table.foreachi(cfg.links, function(link)
for i = 1, #cfg.links do
local link = cfg.links[i]
local item
-- Sort the links into "sibling" (is another project in this same
@ -300,15 +301,9 @@
if prjcfg and (kind == "dependencies" or config.canLink(cfg, prjcfg)) then
-- Yes; does the caller want the whole project config or only part?
if part == "object" then
item = prjcfg
-- Just some part of the path. Grab the whole thing now, split it up
-- below. Skip external projects, because I have no way to know their
-- target file (without parsing the project, which I'm not doing)
elseif not prj.external then
else
item = project.getrelative(cfg.project, prjcfg.linktarget.fullpath)
end
@ -348,7 +343,7 @@
table.insert(result, item)
end
end)
end
return result
end

View File

@ -104,24 +104,6 @@
end
--
-- References to external projects should not appear in any results that
-- use file paths, since there is no way to know what the actual library
-- path might be. It is okay to return project objects though (right?)
--
function suite.skipsExternalProjectRefs()
links { "MyProject2" }
external "MyProject2"
kind "StaticLib"
language "C++"
local r = prepare("all", "fullpath")
test.isequal({}, r)
end
--
-- Managed C++ projects should ignore links to managed assemblies, which
-- are designated with an explicit ".dll" extension.

View File

@ -374,23 +374,6 @@
end
--
-- Skip external projects when building the list of linked
-- libraries, since I don't know the actual output target.
--
function suite.skipsExternalProjectRefs()
links { "MyProject2" }
external "MyProject2"
kind "StaticLib"
language "C++"
prepare()
test.isequal({}, gcc.getlinks(cfg, false))
end
--
-- Check handling of forced includes.
--