mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-27 09:00:16 -06:00
cmLocalGenerator: Explain standard flag selection logic in comments
This commit is contained in:
@@ -1637,8 +1637,10 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Greater or equal because the standards are stored in
|
// If the standard requested is older than the compiler's default
|
||||||
// backward chronological order.
|
// then we need to use a flag to change it. The comparison is
|
||||||
|
// greater-or-equal because the standards are stored in backward
|
||||||
|
// chronological order.
|
||||||
if (stdIt >= defaultStdIt) {
|
if (stdIt >= defaultStdIt) {
|
||||||
std::string option_flag =
|
std::string option_flag =
|
||||||
"CMAKE_" + lang + *stdIt + "_" + type + "_COMPILE_OPTION";
|
"CMAKE_" + lang + *stdIt + "_" + type + "_COMPILE_OPTION";
|
||||||
@@ -1649,6 +1651,9 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The standard requested is at least as new as the compiler's default,
|
||||||
|
// and the standard request is not required. Decay to the newest standard
|
||||||
|
// for which a flag is defined.
|
||||||
for (; stdIt < defaultStdIt; ++stdIt) {
|
for (; stdIt < defaultStdIt; ++stdIt) {
|
||||||
std::string option_flag =
|
std::string option_flag =
|
||||||
"CMAKE_" + lang + *stdIt + "_" + type + "_COMPILE_OPTION";
|
"CMAKE_" + lang + *stdIt + "_" + type + "_COMPILE_OPTION";
|
||||||
|
|||||||
Reference in New Issue
Block a user