diff options
author | Brad King <brad.king@kitware.com> | 2019-08-27 14:11:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-08-27 14:11:29 (GMT) |
commit | 6157c0fe84279f489ef0b458815480d6cc3736da (patch) | |
tree | 25701af86df8bbf8c756880cbef8a5fefcb8e62a | |
parent | dd6154ca1986f7451cf13d952f22faab2673b00a (diff) | |
parent | 17ce0c29ad6f344ac0e7f628028cf66a1cf19f55 (diff) | |
download | CMake-6157c0fe84279f489ef0b458815480d6cc3736da.zip CMake-6157c0fe84279f489ef0b458815480d6cc3736da.tar.gz CMake-6157c0fe84279f489ef0b458815480d6cc3736da.tar.bz2 |
Merge branch 'cmGlobalGenerator-compilerId-lifetime' into release-3.15
Merge-request: !3741
-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 9afc15a..6b001f2 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -924,12 +924,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() && @@ -959,7 +956,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility( } } - if (strcmp(compilerId, "QCC") == 0) { + if (compilerId == "QCC") { switch (mf->GetPolicyStatus(cmPolicies::CMP0047)) { case cmPolicies::WARN: if (!this->CMakeInstance->GetIsInTryCompile() && @@ -995,7 +992,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility( } } - if (strcmp(compilerId, "XLClang") == 0) { + if (compilerId == "XLClang") { switch (mf->GetPolicyStatus(cmPolicies::CMP0089)) { case cmPolicies::WARN: if (!this->CMakeInstance->GetIsInTryCompile() && |