summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-02-15 14:59:44 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-02-15 15:00:21 (GMT)
commitf2dc10d55c24d1714d65ce990a8e7658d92d2e14 (patch)
tree4fa1ca2ac013e5b284d978c4fa48b604a616819d /Source
parent3c9c91a360104b97aa6ad27934ff7603c862a2f7 (diff)
parent157570b5a2d3135e2d83f9bd2865ad666a709499 (diff)
downloadCMake-f2dc10d55c24d1714d65ce990a8e7658d92d2e14.zip
CMake-f2dc10d55c24d1714d65ce990a8e7658d92d2e14.tar.gz
CMake-f2dc10d55c24d1714d65ce990a8e7658d92d2e14.tar.bz2
Merge topic 'ninja-swift-library-name'
157570b5a2 Add placeholder for Swift's library name Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2902
Diffstat (limited to 'Source')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx5
-rw-r--r--Source/cmRulePlaceholderExpander.cxx5
-rw-r--r--Source/cmRulePlaceholderExpander.h1
3 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 998729f..8d2586d 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -454,6 +454,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
if (lang == "Swift") {
vars.SwiftAuxiliarySources = "$SWIFT_AUXILIARY_SOURCES";
vars.SwiftModuleName = "$SWIFT_MODULE_NAME";
+ vars.SwiftLibraryName = "$SWIFT_LIBRARY_NAME";
}
// For some cases we do an explicit preprocessor invocation.
@@ -940,6 +941,10 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
} else {
vars["SWIFT_MODULE_NAME"] = this->GeneratorTarget->GetName();
}
+
+ cmGeneratorTarget::Names targetNames =
+ this->GeneratorTarget->GetLibraryNames(this->GetConfigName());
+ vars["SWIFT_LIBRARY_NAME"] = targetNames.Base;
}
if (!this->NeedDepTypeMSVC(language)) {
diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx
index e347a2c..5ebdd1b 100644
--- a/Source/cmRulePlaceholderExpander.cxx
+++ b/Source/cmRulePlaceholderExpander.cxx
@@ -172,6 +172,11 @@ std::string cmRulePlaceholderExpander::ExpandRuleVariable(
return replaceValues.SwiftModuleName;
}
}
+ if (replaceValues.SwiftLibraryName) {
+ if (variable == "SWIFT_LIBRARY_NAME") {
+ return replaceValues.SwiftLibraryName;
+ }
+ }
if (variable == "TARGET_SONAME" || variable == "SONAME_FLAG" ||
variable == "TARGET_INSTALLNAME_DIR") {
// All these variables depend on TargetSOName
diff --git a/Source/cmRulePlaceholderExpander.h b/Source/cmRulePlaceholderExpander.h
index 5c03637..930eafd 100644
--- a/Source/cmRulePlaceholderExpander.h
+++ b/Source/cmRulePlaceholderExpander.h
@@ -60,6 +60,7 @@ public:
const char* FilterPrefix;
const char* SwiftAuxiliarySources;
const char* SwiftModuleName;
+ const char* SwiftLibraryName;
};
// Expand rule variables in CMake of the type found in language rules