diff options
author | Brad King <brad.king@kitware.com> | 2016-02-18 15:08:01 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-02-18 15:08:01 (GMT) |
commit | 2321e63734d1b31eebc344e18a5b45fc76343185 (patch) | |
tree | d49103d9a400888505f94231b7dd8c3a5aaf8753 /Source | |
parent | 1b369aa285c82f83ecbaf219800ae72d973cb0ab (diff) | |
parent | 87f44b7525ebc9761b32b98f0c9e1276431e6ec1 (diff) | |
download | CMake-2321e63734d1b31eebc344e18a5b45fc76343185.zip CMake-2321e63734d1b31eebc344e18a5b45fc76343185.tar.gz CMake-2321e63734d1b31eebc344e18a5b45fc76343185.tar.bz2 |
Merge topic 'fix-static-private-non-target-depends'
87f44b75 Fix export of STATIC library PRIVATE non-target dependencies
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 21 | ||||
-rw-r--r-- | Source/cmTargetLinkLibrariesCommand.cxx | 7 |
2 files changed, 23 insertions, 5 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index e8a2e6a..c005995 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -772,6 +772,27 @@ cmExportFileGenerator::ResolveTargetsInGeneratorExpression( lastPos = endPos; } + pos = 0; + lastPos = pos; + while (errorString.empty() && + (pos = input.find("$<LINK_ONLY:", lastPos)) != input.npos) + { + std::string::size_type nameStartPos = pos + sizeof("$<LINK_ONLY:") - 1; + std::string::size_type endPos = input.find(">", nameStartPos); + if (endPos == input.npos) + { + errorString = "$<LINK_ONLY:...> expression incomplete"; + break; + } + std::string libName = input.substr(nameStartPos, endPos - nameStartPos); + if (cmGeneratorExpression::IsValidTargetName(libName) && + this->AddTargetNamespace(libName, target, missingTargets)) + { + input.replace(nameStartPos, endPos - nameStartPos, libName); + } + lastPos = nameStartPos + libName.size() + 1; + } + this->ReplaceInstallPrefix(input); if (!errorString.empty()) diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 5f3246a..435346a 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -432,11 +432,8 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, { std::string configLib = this->Target ->GetDebugGeneratorExpressions(lib, llt); - if (cmGeneratorExpression::IsValidTargetName(configLib)) - { - configLib = "$<LINK_ONLY:$<TARGET_NAME:" + configLib + ">>"; - } - else if (cmGeneratorExpression::Find(configLib) != std::string::npos) + if (cmGeneratorExpression::IsValidTargetName(lib) + || cmGeneratorExpression::Find(lib) != std::string::npos) { configLib = "$<LINK_ONLY:" + configLib + ">"; } |