From de13c55d74e0e95aa3799ba132db668212721776 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 16 Jan 2019 11:42:10 -0800 Subject: Ninja: support `SWIFT_MODULE_NAME` property Add a new `SWIFT_MODULE_NAME` property that defaults to the target name. This can be adjusted via `set_target_properties`. This is needed as otherwise, the first source file determines the module name. Issue: #18800 --- Source/cmNinjaTargetGenerator.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index c959a04..edb0ef3 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -919,7 +919,12 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( } vars["SWIFT_AUXILIARY_SOURCES"] = aux_sources; - vars["SWIFT_MODULE_NAME"] = this->GeneratorTarget->GetName(); + if (const char* name = + this->GeneratorTarget->GetProperty("SWIFT_MODULE_NAME")) { + vars["SWIFT_MODULE_NAME"] = name; + } else { + vars["SWIFT_MODULE_NAME"] = this->GeneratorTarget->GetName(); + } } if (!this->NeedDepTypeMSVC(language)) { -- cgit v0.12