summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2019-01-31 23:39:44 (GMT)
committerSaleem Abdulrasool <compnerd@compnerd.org>2019-02-13 17:25:29 (GMT)
commit157570b5a2d3135e2d83f9bd2865ad666a709499 (patch)
tree879769f432d9dd8f0a9786db6612ac334b1018b3 /Source/cmNinjaTargetGenerator.cxx
parent63efce507bfcf7eec1dbcb10acadeb3304d6f20d (diff)
downloadCMake-157570b5a2d3135e2d83f9bd2865ad666a709499.zip
CMake-157570b5a2d3135e2d83f9bd2865ad666a709499.tar.gz
CMake-157570b5a2d3135e2d83f9bd2865ad666a709499.tar.bz2
Add placeholder for Swift's library name
This allows us to set the proper link name for the Swift library (soname). Because this needs to be passed to the object being compiled, we need to create a new placeholder so that it can be sent along to the frontend. Default to the target name unless it is explicitly provided.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index b525dac..df6428f 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)) {