diff options
author | Brad King <brad.king@kitware.com> | 2017-07-14 14:09:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-07-14 14:19:56 (GMT) |
commit | fca0546175edf6cae51bbf673fa379899e8c0ea6 (patch) | |
tree | 8fa61ec4422eb9215d506db69c6814c22254905f /Source/cmLocalGenerator.cxx | |
parent | 0f096b8d733bb43f1fa95c052e5c2d9e8b381508 (diff) | |
download | CMake-fca0546175edf6cae51bbf673fa379899e8c0ea6.zip CMake-fca0546175edf6cae51bbf673fa379899e8c0ea6.tar.gz CMake-fca0546175edf6cae51bbf673fa379899e8c0ea6.tar.bz2 |
cmLocalGenerator: Explain standard flag selection logic in comments
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 921be3b..2bd7e4e 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1637,8 +1637,10 @@ void cmLocalGenerator::AddCompilerRequirementFlag( return; } - // Greater or equal because the standards are stored in - // backward chronological order. + // If the standard requested is older than the compiler's default + // 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) { std::string option_flag = "CMAKE_" + lang + *stdIt + "_" + type + "_COMPILE_OPTION"; @@ -1649,6 +1651,9 @@ void cmLocalGenerator::AddCompilerRequirementFlag( 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) { std::string option_flag = "CMAKE_" + lang + *stdIt + "_" + type + "_COMPILE_OPTION"; |