diff options
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index e145ad4..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() && @@ -1110,8 +1107,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l, std::string ignoreExtensionsVar = std::string("CMAKE_") + std::string(l) + std::string("_IGNORE_EXTENSIONS"); std::string ignoreExts = mf->GetSafeDefinition(ignoreExtensionsVar); - std::vector<std::string> extensionList; - cmExpandList(ignoreExts, extensionList); + std::vector<std::string> extensionList = cmExpandedList(ignoreExts); for (std::string const& i : extensionList) { this->IgnoreExtensions[i] = true; } @@ -1123,8 +1119,7 @@ void cmGlobalGenerator::FillExtensionToLanguageMap(const std::string& l, std::string extensionsVar = std::string("CMAKE_") + std::string(l) + std::string("_SOURCE_FILE_EXTENSIONS"); const std::string& exts = mf->GetSafeDefinition(extensionsVar); - std::vector<std::string> extensionList; - cmExpandList(exts, extensionList); + std::vector<std::string> extensionList = cmExpandedList(exts); for (std::string const& i : extensionList) { this->ExtensionToLanguage[i] = l; } @@ -1581,8 +1576,8 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo() "CMAKE_" + li + "_STANDARD_INCLUDE_DIRECTORIES"; std::string const& standardIncludesStr = mf->GetSafeDefinition(standardIncludesVar); - std::vector<std::string> standardIncludesVec; - cmExpandList(standardIncludesStr, standardIncludesVec); + std::vector<std::string> standardIncludesVec = + cmExpandedList(standardIncludesStr); standardIncludesSet.insert(standardIncludesVec.begin(), standardIncludesVec.end()); } |