mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-11 03:50:43 -05:00
Merge topic 'ninja-swift-library-name'
157570b5a2 Add placeholder for Swift's library name
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2902
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user