Commit 613ac3e7 authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'swift-version'

369c48ee Swift: honour `-swift-version` in Ninja generator
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !3685
parents d16402dd 369c48ee
......@@ -316,6 +316,7 @@ Properties on Targets
/prop_tgt/STATIC_LIBRARY_OPTIONS
/prop_tgt/SUFFIX
/prop_tgt/Swift_DEPENDENCIES_FILE
/prop_tgt/Swift_LANGUAGE_VERSION
/prop_tgt/Swift_MODULE_DIRECTORY
/prop_tgt/Swift_MODULE_NAME
/prop_tgt/TYPE
......
Swift_LANGUAGE_VERSION
----------------------
This property sets the language version for the Swift sources in the target. If
one is not specified, it will default to ``<CMAKE_Swift_LANGUAGE_VERSION>`` if
specified, otherwise it is the latest version supported by the compiler.
......@@ -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 =
......
......@@ -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__
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment