summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-08-07 15:16:24 (GMT)
committerBrad King <brad.king@kitware.com>2014-08-07 15:24:57 (GMT)
commit70796ef026e8d10a4e50c8e26472d469a45f7dd5 (patch)
treecb407fa267536d7346447d63b58364d071c63c6e /Source/cmGlobalGenerator.cxx
parent6f0d1a38c8eee267cf16c4b6bae90ddf218f3088 (diff)
downloadCMake-70796ef026e8d10a4e50c8e26472d469a45f7dd5.zip
CMake-70796ef026e8d10a4e50c8e26472d469a45f7dd5.tar.gz
CMake-70796ef026e8d10a4e50c8e26472d469a45f7dd5.tar.bz2
CMP0047: Fix CMAKE_COMPILER_IS_GNU(CC|CXX) in OLD behavior
The implementation of CMP0047 detects the QNX compiler id internally, then changes it to GNU after the language is fully enabled. This is too late to correctly set the old IS_GNU variables, so set them as part of the policy OLD behavior. Reported-by: Mike Lattanzio <mlattanzio@blackberry.com>
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 38ba5d1..3f948b5 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -844,6 +844,14 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf,
case cmPolicies::OLD:
// OLD behavior is to convert QCC to GNU.
mf->AddDefinition(compilerIdVar, "GNU");
+ if(lang == "C")
+ {
+ mf->AddDefinition("CMAKE_COMPILER_IS_GNUCC", "1");
+ }
+ else if(lang == "CXX")
+ {
+ mf->AddDefinition("CMAKE_COMPILER_IS_GNUCXX", "1");
+ }
break;
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS: