summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2018-09-05 10:41:28 (GMT)
committerBrad King <brad.king@kitware.com>2018-09-18 15:16:46 (GMT)
commitf4ff60a803170311f49511a60a381eef8b78c5dd (patch)
tree14e5ff6fb69f5c0fc7e815cd612dab1c0ba1e299 /Source/cmGeneratorTarget.cxx
parent42212f7539040139ecec092547b7d58ef12a4d72 (diff)
downloadCMake-f4ff60a803170311f49511a60a381eef8b78c5dd.zip
CMake-f4ff60a803170311f49511a60a381eef8b78c5dd.tar.gz
CMake-f4ff60a803170311f49511a60a381eef8b78c5dd.tar.bz2
cmMakefile: Make GetSafeDefinition return std::string const&
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e8e7b90..f563dd8 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -138,8 +138,7 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
this->SourceEntries, true);
this->DLLPlatform =
- strcmp(this->Makefile->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"),
- "") != 0;
+ !this->Makefile->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX").empty();
this->PolicyMap = t->PolicyMap;
}
@@ -3489,12 +3488,13 @@ void cmGeneratorTarget::GetFullNameInternal(
}
// if there is no prefix on the target use the cmake definition
+ std::string targetPrefix2, targetSuffix2;
if (!targetPrefix && prefixVar) {
- targetPrefix = this->Makefile->GetSafeDefinition(prefixVar);
+ targetPrefix2 = this->Makefile->GetSafeDefinition(prefixVar);
}
// if there is no suffix on the target use the cmake definition
if (!targetSuffix && suffixVar) {
- targetSuffix = this->Makefile->GetSafeDefinition(suffixVar);
+ targetSuffix2 = this->Makefile->GetSafeDefinition(suffixVar);
}
// frameworks have directory prefix but no suffix
@@ -3502,19 +3502,19 @@ void cmGeneratorTarget::GetFullNameInternal(
if (this->IsFrameworkOnApple()) {
fw_prefix = this->GetFrameworkDirectory(config, ContentLevel);
fw_prefix += "/";
- targetPrefix = fw_prefix.c_str();
- targetSuffix = nullptr;
+ targetPrefix2 = fw_prefix;
+ targetSuffix2.clear();
}
if (this->IsCFBundleOnApple()) {
fw_prefix = this->GetCFBundleDirectory(config, FullLevel);
fw_prefix += "/";
- targetPrefix = fw_prefix.c_str();
- targetSuffix = nullptr;
+ targetPrefix2 = fw_prefix;
+ targetSuffix2.clear();
}
// Begin the final name with the prefix.
- outPrefix = targetPrefix ? targetPrefix : "";
+ outPrefix = targetPrefix2;
// Append the target name or property-specified name.
outBase += this->GetOutputName(config, artifact);
@@ -3533,7 +3533,7 @@ void cmGeneratorTarget::GetFullNameInternal(
}
// Append the suffix.
- outSuffix = targetSuffix ? targetSuffix : "";
+ outSuffix = targetSuffix2;
}
std::string cmGeneratorTarget::GetLinkerLanguage(