summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-07-07 12:42:16 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-07-07 12:42:22 (GMT)
commit1ff7cd1fe7cdd408d55827bdc10058167a09cf45 (patch)
treeb72c7b7e4b905bc02b7d743516aef8bd416e5cc9 /Source/cmLocalGenerator.cxx
parentd2617a28eb9f489d87be88851a313c58d5eaf027 (diff)
parentd8e6cd9ed8bfee9073cff26cb654bc01e653b0b9 (diff)
downloadCMake-1ff7cd1fe7cdd408d55827bdc10058167a09cf45.zip
CMake-1ff7cd1fe7cdd408d55827bdc10058167a09cf45.tar.gz
CMake-1ff7cd1fe7cdd408d55827bdc10058167a09cf45.tar.bz2
Merge topic 'iar_improved'
d8e6cd9e IAR: Improve support for IAR ARM Compiler 0b1a2876 Add a CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID variable fea7d69d Store CMAKE_ASM_COMPILER_VERSION persistently d2a8b5ce CMakeDetermineASMCompiler: Fix small copy-paste mistake a2112257 Add infrastructure to use language extensions without any standard 8cd28bb0 cmLocalGenerator: Switch order of <LANG>_{EXTENSIONS,STANDARD} check 0fc2d78e cmLocalGenerator: Simplify logic for language standard or extension flag Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !991
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx24
1 files changed, 17 insertions, 7 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 9049a42..b63683f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1501,20 +1501,30 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
// This compiler has no notion of language standard levels.
return;
}
- std::string stdProp = lang + "_STANDARD";
- const char* standardProp = target->GetProperty(stdProp);
- if (!standardProp) {
- return;
- }
std::string extProp = lang + "_EXTENSIONS";
- std::string type = "EXTENSION";
bool ext = true;
if (const char* extPropValue = target->GetProperty(extProp)) {
if (cmSystemTools::IsOff(extPropValue)) {
ext = false;
- type = "STANDARD";
}
}
+ std::string stdProp = lang + "_STANDARD";
+ const char* standardProp = target->GetProperty(stdProp);
+ if (!standardProp) {
+ if (ext) {
+ // No language standard is specified and extensions are not disabled.
+ // Check if this compiler needs a flag to enable extensions.
+ std::string const option_flag =
+ "CMAKE_" + lang + "_EXTENSION_COMPILE_OPTION";
+ if (const char* opt =
+ target->Target->GetMakefile()->GetDefinition(option_flag)) {
+ this->AppendFlagEscape(flags, opt);
+ }
+ }
+ return;
+ }
+
+ std::string const type = ext ? "EXTENSION" : "STANDARD";
if (target->GetPropertyAsBool(lang + "_STANDARD_REQUIRED")) {
std::string option_flag =