From d39cb36aef2e34e0175682e32a87d540f8d16128 Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Mon, 28 Jul 2014 19:18:45 -0400 Subject: [PATCH] Allow external projects to be explicitly linked; use target...() APIs to control target name --- src/base/config.lua | 13 ++++--------- tests/config/test_links.lua | 18 ------------------ tests/tools/test_gcc.lua | 17 ----------------- 3 files changed, 4 insertions(+), 44 deletions(-) diff --git a/src/base/config.lua b/src/base/config.lua index 672f4828..9583a1ed 100755 --- a/src/base/config.lua +++ b/src/base/config.lua @@ -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 diff --git a/tests/config/test_links.lua b/tests/config/test_links.lua index 8ce15f12..659b0fd4 100755 --- a/tests/config/test_links.lua +++ b/tests/config/test_links.lua @@ -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. diff --git a/tests/tools/test_gcc.lua b/tests/tools/test_gcc.lua index f77bfb51..fb4e7f16 100644 --- a/tests/tools/test_gcc.lua +++ b/tests/tools/test_gcc.lua @@ -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. --