diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 11 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 57dabd1..2e40543 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1564,6 +1564,17 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, this->AddConfigVariableFlags(flags, cmStrCat("CMAKE_", lang, "_FLAGS"), config); + if (lang == "Swift") { + if (const char* v = target->GetProperty("Swift_LANGUAGE_VERSION")) { + if (cmSystemTools::VersionCompare( + cmSystemTools::OP_GREATER_EQUAL, + this->Makefile->GetDefinition("CMAKE_Swift_COMPILER_VERSION"), + "4.2")) { + this->AppendFlags(flags, "-swift-version " + std::string(v)); + } + } + } + // Add MSVC runtime library flags. This is activated by the presence // of a default selection whether or not it is overridden by a property. const char* msvcRuntimeLibraryDefault = diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index df37d32..5311d38 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -346,6 +346,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, initProp("LINK_SEARCH_START_STATIC"); initProp("LINK_SEARCH_END_STATIC"); initProp("FOLDER"); + initProp("Swift_LANGUAGE_VERSION"); initProp("Swift_MODULE_DIRECTORY"); initProp("VS_JUST_MY_CODE_DEBUGGING"); #ifdef __APPLE__ |