mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
Features: Allow setting standard dialect below the default.
If the requested standard dialect is older than the default dialect then we must use a flag because we cannot decay to a newer standard.
This commit is contained in:
@@ -2287,7 +2287,21 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target,
|
||||
return;
|
||||
}
|
||||
|
||||
for ( ; stdIt <= defaultStdIt; ++stdIt)
|
||||
// Greater or equal because the standards are stored in
|
||||
// backward chronological order.
|
||||
if (stdIt >= defaultStdIt)
|
||||
{
|
||||
std::string option_flag =
|
||||
"CMAKE_" + lang + *stdIt
|
||||
+ "_" + type + "_COMPILE_OPTION";
|
||||
|
||||
const char *opt =
|
||||
target->GetMakefile()->GetRequiredDefinition(option_flag);
|
||||
this->AppendFlagEscape(flags, opt);
|
||||
return;
|
||||
}
|
||||
|
||||
for ( ; stdIt < defaultStdIt; ++stdIt)
|
||||
{
|
||||
std::string option_flag =
|
||||
"CMAKE_" + lang + *stdIt
|
||||
|
||||
Reference in New Issue
Block a user