summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-09-18 15:17:45 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-09-18 15:18:00 (GMT)
commita8f628c0a456f74680bfdad0050f2614dbe50853 (patch)
treef072a8939837a3d6f954993fdbb9b54e43cdf1f0 /Source/cmGlobalGenerator.cxx
parent7adf3aabd55dd80784727a229a37c394740db628 (diff)
parentf4ff60a803170311f49511a60a381eef8b78c5dd (diff)
downloadCMake-a8f628c0a456f74680bfdad0050f2614dbe50853.zip
CMake-a8f628c0a456f74680bfdad0050f2614dbe50853.tar.gz
CMake-a8f628c0a456f74680bfdad0050f2614dbe50853.tar.bz2
Merge topic 'getsafedef-stdstring'
f4ff60a803 cmMakefile: Make GetSafeDefinition return std::string const& Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2350
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 24dc593..1dd20b6 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());
@@ -1596,7 +1597,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,