diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-02-04 18:14:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-02-04 23:36:36 (GMT) |
commit | 6027798a30eae02175ce4ad13e1439f4383b6cd3 (patch) | |
tree | 38c7dcf5adbb588522bd3c3a14cba3868e614eda | |
parent | 9d767810e1e54eb9233854f0dbf1345a0b5be60f (diff) | |
download | CMake-6027798a30eae02175ce4ad13e1439f4383b6cd3.zip CMake-6027798a30eae02175ce4ad13e1439f4383b6cd3.tar.gz CMake-6027798a30eae02175ce4ad13e1439f4383b6cd3.tar.bz2 |
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.
-rw-r--r-- | Source/cmLocalGenerator.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 81e37f6..400415b 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -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 |