diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2018-09-05 10:41:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-09-18 15:16:46 (GMT) |
commit | f4ff60a803170311f49511a60a381eef8b78c5dd (patch) | |
tree | 14e5ff6fb69f5c0fc7e815cd612dab1c0ba1e299 /Source/cmGlobalGenerator.cxx | |
parent | 42212f7539040139ecec092547b7d58ef12a4d72 (diff) | |
download | CMake-f4ff60a803170311f49511a60a381eef8b78c5dd.zip CMake-f4ff60a803170311f49511a60a381eef8b78c5dd.tar.gz CMake-f4ff60a803170311f49511a60a381eef8b78c5dd.tar.bz2 |
cmMakefile: Make GetSafeDefinition return std::string const&
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 99135c8..f504b9f 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -828,8 +828,9 @@ void cmGlobalGenerator::EnableLanguage( std::string sharedLibFlagsVar = "CMAKE_SHARED_LIBRARY_"; sharedLibFlagsVar += lang; sharedLibFlagsVar += "_FLAGS"; - const char* sharedLibFlags = mf->GetSafeDefinition(sharedLibFlagsVar); - if (sharedLibFlags) { + std::string const& sharedLibFlags = + mf->GetSafeDefinition(sharedLibFlagsVar); + if (!sharedLibFlags.empty()) { this->LanguageToOriginalSharedLibFlags[lang] = sharedLibFlags; } @@ -1092,7 +1093,7 @@ void cmGlobalGenerator::FillExtensionToLanguageMap(const std::string& l, { std::string extensionsVar = std::string("CMAKE_") + std::string(l) + std::string("_SOURCE_FILE_EXTENSIONS"); - std::string exts = mf->GetSafeDefinition(extensionsVar); + const std::string& exts = mf->GetSafeDefinition(extensionsVar); std::vector<std::string> extensionList; cmSystemTools::ExpandListArgument(exts, extensionList); for (std::string const& i : extensionList) { @@ -1112,7 +1113,7 @@ bool cmGlobalGenerator::GlobalSettingIsOn(std::string const& name) const return this->Makefiles[0]->IsOn(name); } -const char* cmGlobalGenerator::GetSafeGlobalSetting( +std::string cmGlobalGenerator::GetSafeGlobalSetting( std::string const& name) const { assert(!this->Makefiles.empty()); @@ -1593,7 +1594,7 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo() for (std::string const& li : langs) { std::string const standardIncludesVar = "CMAKE_" + li + "_STANDARD_INCLUDE_DIRECTORIES"; - std::string const standardIncludesStr = + std::string const& standardIncludesStr = mf->GetSafeDefinition(standardIncludesVar); std::vector<std::string> standardIncludesVec; cmSystemTools::ExpandListArgument(standardIncludesStr, |