diff options
author | Brad King <brad.king@kitware.com> | 2014-08-07 15:25:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-08-07 15:25:36 (GMT) |
commit | 59c3695edd8795b9c3b8eb7cacd3991b6a9860f6 (patch) | |
tree | c3a6adeec7dd321f599d773b8ad70c6d7eeb8fd8 /Source | |
parent | 3151024d241c581463d20bf0ce3d1060bdd22de4 (diff) | |
download | CMake-59c3695edd8795b9c3b8eb7cacd3991b6a9860f6.zip CMake-59c3695edd8795b9c3b8eb7cacd3991b6a9860f6.tar.gz CMake-59c3695edd8795b9c3b8eb7cacd3991b6a9860f6.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')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index beb10da..203735a 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -804,6 +804,14 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf, case cmPolicies::OLD: // OLD behavior is to convert QCC to GNU. mf->AddDefinition(compilerIdVar.c_str(), "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: |