diff options
author | Brad King <brad.king@kitware.com> | 2019-08-27 14:16:31 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-08-27 14:18:57 (GMT) |
commit | 297df45d003bc1084896c2ce9ac35d4ba26c4c6e (patch) | |
tree | 77cd52f068aafa5769f7a2bbc802a17d496e8a92 /Source | |
parent | 8a8b2fa695c477dff1e801bc7094dd1ee3352713 (diff) | |
parent | 17ce0c29ad6f344ac0e7f628028cf66a1cf19f55 (diff) | |
download | CMake-297df45d003bc1084896c2ce9ac35d4ba26c4c6e.zip CMake-297df45d003bc1084896c2ce9ac35d4ba26c4c6e.tar.gz CMake-297df45d003bc1084896c2ce9ac35d4ba26c4c6e.tar.bz2 |
Merge topic 'cmGlobalGenerator-compilerId-lifetime'
17ce0c29ad cmGlobalGenerator: Fix CheckCompilerIdCompatibility local var lifetime
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3741
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 363ad6e..4342e9f 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -884,12 +884,9 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility( cmMakefile* mf, std::string const& lang) const { std::string compilerIdVar = "CMAKE_" + lang + "_COMPILER_ID"; - const char* compilerId = mf->GetDefinition(compilerIdVar); - if (!compilerId) { - return; - } + std::string const compilerId = mf->GetSafeDefinition(compilerIdVar); - if (strcmp(compilerId, "AppleClang") == 0) { + if (compilerId == "AppleClang") { switch (mf->GetPolicyStatus(cmPolicies::CMP0025)) { case cmPolicies::WARN: if (!this->CMakeInstance->GetIsInTryCompile() && @@ -919,7 +916,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility( } } - if (strcmp(compilerId, "QCC") == 0) { + if (compilerId == "QCC") { switch (mf->GetPolicyStatus(cmPolicies::CMP0047)) { case cmPolicies::WARN: if (!this->CMakeInstance->GetIsInTryCompile() && @@ -955,7 +952,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility( } } - if (strcmp(compilerId, "XLClang") == 0) { + if (compilerId == "XLClang") { switch (mf->GetPolicyStatus(cmPolicies::CMP0089)) { case cmPolicies::WARN: if (!this->CMakeInstance->GetIsInTryCompile() && |