summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-06-18 11:57:46 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-06-18 11:57:56 (GMT)
commit1b5a7adf5e5b9343f6f6dc608b1dee0b17316af8 (patch)
tree186c41e0939317f215b480c274ff67f2eb8add32
parentcc7f1be54e923a8459279638594238650c9a0529 (diff)
parent2746c61e6d36f3d49744b11259395a8684007e9f (diff)
downloadCMake-1b5a7adf5e5b9343f6f6dc608b1dee0b17316af8.zip
CMake-1b5a7adf5e5b9343f6f6dc608b1dee0b17316af8.tar.gz
CMake-1b5a7adf5e5b9343f6f6dc608b1dee0b17316af8.tar.bz2
Merge topic 'library-search-paths'
2746c61e6d Swift: Add library search paths for dependencies Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3436
-rw-r--r--Source/cmLinkLineComputer.cxx34
1 files changed, 27 insertions, 7 deletions
diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx
index 2a8bee6..469faca 100644
--- a/Source/cmLinkLineComputer.cxx
+++ b/Source/cmLinkLineComputer.cxx
@@ -99,14 +99,34 @@ std::string cmLinkLineComputer::ComputeLinkPath(
std::string const& libPathTerminator)
{
std::string linkPath;
- std::vector<std::string> const& libDirs = cli.GetDirectories();
- for (std::string const& libDir : libDirs) {
- std::string libpath = this->ConvertToOutputForExisting(libDir);
- linkPath += " " + libPathFlag;
- linkPath += libpath;
- linkPath += libPathTerminator;
- linkPath += " ";
+
+ if (cli.GetLinkLanguage() == "Swift") {
+ for (const cmComputeLinkInformation::Item& item : cli.GetItems()) {
+ const cmGeneratorTarget* target = item.Target;
+ if (!target) {
+ continue;
+ }
+
+ if (target->GetType() == cmStateEnums::STATIC_LIBRARY ||
+ target->GetType() == cmStateEnums::SHARED_LIBRARY) {
+ cmStateEnums::ArtifactType type = cmStateEnums::RuntimeBinaryArtifact;
+ if (target->GetType() == cmStateEnums::SHARED_LIBRARY &&
+ target->IsDLLPlatform()) {
+ type = cmStateEnums::ImportLibraryArtifact;
+ }
+
+ linkPath += " " + libPathFlag +
+ item.Target->GetDirectory(cli.GetConfig(), type) +
+ libPathTerminator + " ";
+ }
+ }
}
+
+ for (std::string const& libDir : cli.GetDirectories()) {
+ linkPath += " " + libPathFlag + this->ConvertToOutputForExisting(libDir) +
+ libPathTerminator + " ";
+ }
+
return linkPath;
}