|
@@ -79,6 +79,7 @@
|
|
|
F(cxx_sizeof_member) \
|
|
F(cxx_sizeof_member) \
|
|
|
F(cxx_static_assert) \
|
|
F(cxx_static_assert) \
|
|
|
F(cxx_strong_enums) \
|
|
F(cxx_strong_enums) \
|
|
|
|
|
+ F(cxx_template_template_parameters) \
|
|
|
F(cxx_thread_local) \
|
|
F(cxx_thread_local) \
|
|
|
F(cxx_trailing_return_types) \
|
|
F(cxx_trailing_return_types) \
|
|
|
F(cxx_unicode_literals) \
|
|
F(cxx_unicode_literals) \
|
|
@@ -4646,8 +4647,16 @@ AddRequiredTargetFeature(cmTarget *target, const std::string& feature,
|
|
|
|
|
|
|
|
target->AppendProperty("COMPILE_FEATURES", feature.c_str());
|
|
target->AppendProperty("COMPILE_FEATURES", feature.c_str());
|
|
|
|
|
|
|
|
|
|
+ bool needCxx98 = false;
|
|
|
bool needCxx11 = false;
|
|
bool needCxx11 = false;
|
|
|
|
|
|
|
|
|
|
+ if (const char *propCxx98 =
|
|
|
|
|
+ this->GetDefinition("CMAKE_CXX98_COMPILE_FEATURES"))
|
|
|
|
|
+ {
|
|
|
|
|
+ std::vector<std::string> props;
|
|
|
|
|
+ cmSystemTools::ExpandListArgument(propCxx98, props);
|
|
|
|
|
+ needCxx98 = std::find(props.begin(), props.end(), feature) != props.end();
|
|
|
|
|
+ }
|
|
|
if (const char *propCxx11 =
|
|
if (const char *propCxx11 =
|
|
|
this->GetDefinition("CMAKE_CXX11_COMPILE_FEATURES"))
|
|
this->GetDefinition("CMAKE_CXX11_COMPILE_FEATURES"))
|
|
|
{
|
|
{
|
|
@@ -4675,6 +4684,7 @@ AddRequiredTargetFeature(cmTarget *target, const std::string& feature,
|
|
|
cmStrCmp(existingCxxStandard))
|
|
cmStrCmp(existingCxxStandard))
|
|
|
: cmArrayEnd(CXX_STANDARDS);
|
|
: cmArrayEnd(CXX_STANDARDS);
|
|
|
|
|
|
|
|
|
|
+ bool setCxx98 = needCxx98 && !existingCxxStandard;
|
|
|
bool setCxx11 = needCxx11 && !existingCxxStandard;
|
|
bool setCxx11 = needCxx11 && !existingCxxStandard;
|
|
|
|
|
|
|
|
if (needCxx11 && existingCxxStandard && existingCxxIt <
|
|
if (needCxx11 && existingCxxStandard && existingCxxIt <
|
|
@@ -4684,10 +4694,21 @@ AddRequiredTargetFeature(cmTarget *target, const std::string& feature,
|
|
|
{
|
|
{
|
|
|
setCxx11 = true;
|
|
setCxx11 = true;
|
|
|
}
|
|
}
|
|
|
|
|
+ else if(needCxx98 && existingCxxStandard && existingCxxIt <
|
|
|
|
|
+ std::find_if(cmArrayBegin(CXX_STANDARDS),
|
|
|
|
|
+ cmArrayEnd(CXX_STANDARDS),
|
|
|
|
|
+ cmStrCmp("98")))
|
|
|
|
|
+ {
|
|
|
|
|
+ setCxx98 = true;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (setCxx11)
|
|
if (setCxx11)
|
|
|
{
|
|
{
|
|
|
target->SetProperty("CXX_STANDARD", "11");
|
|
target->SetProperty("CXX_STANDARD", "11");
|
|
|
}
|
|
}
|
|
|
|
|
+ else if (setCxx98)
|
|
|
|
|
+ {
|
|
|
|
|
+ target->SetProperty("CXX_STANDARD", "98");
|
|
|
|
|
+ }
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|