summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-09-19 14:32:55 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-09-19 14:33:01 (GMT)
commit76a19eb6c16272e4600267aed6ed7aff0fd9c765 (patch)
treef4052ab80d82c26830286fa724f064186ec4836c /Source/cmGeneratorTarget.cxx
parent3ada513413e2a911efac2de2c90bbebd820fef5d (diff)
parent2428422c02de1feac008d2ba1a6ad075aaf7ba2c (diff)
downloadCMake-76a19eb6c16272e4600267aed6ed7aff0fd9c765.zip
CMake-76a19eb6c16272e4600267aed6ed7aff0fd9c765.tar.gz
CMake-76a19eb6c16272e4600267aed6ed7aff0fd9c765.tar.bz2
Merge topic 'fix-getsafedef-stdstring'
2428422c02 Fix regression in target output file naming logic d686f81e58 Restore possibly regressed CMP0018 logic Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2402
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e2824e8..a58d3cb 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3494,13 +3494,12 @@ void cmGeneratorTarget::GetFullNameInternal(
}
// if there is no prefix on the target use the cmake definition
- std::string targetPrefix2, targetSuffix2;
if (!targetPrefix && prefixVar) {
- targetPrefix2 = this->Makefile->GetSafeDefinition(prefixVar);
+ targetPrefix = this->Makefile->GetSafeDefinition(prefixVar).c_str();
}
// if there is no suffix on the target use the cmake definition
if (!targetSuffix && suffixVar) {
- targetSuffix2 = this->Makefile->GetSafeDefinition(suffixVar);
+ targetSuffix = this->Makefile->GetSafeDefinition(suffixVar).c_str();
}
// frameworks have directory prefix but no suffix
@@ -3508,19 +3507,19 @@ void cmGeneratorTarget::GetFullNameInternal(
if (this->IsFrameworkOnApple()) {
fw_prefix = this->GetFrameworkDirectory(config, ContentLevel);
fw_prefix += "/";
- targetPrefix2 = fw_prefix;
- targetSuffix2.clear();
+ targetPrefix = fw_prefix.c_str();
+ targetSuffix = nullptr;
}
if (this->IsCFBundleOnApple()) {
fw_prefix = this->GetCFBundleDirectory(config, FullLevel);
fw_prefix += "/";
- targetPrefix2 = fw_prefix;
- targetSuffix2.clear();
+ targetPrefix = fw_prefix.c_str();
+ targetSuffix = nullptr;
}
// Begin the final name with the prefix.
- outPrefix = targetPrefix2;
+ outPrefix = targetPrefix ? targetPrefix : "";
// Append the target name or property-specified name.
outBase += this->GetOutputName(config, artifact);
@@ -3539,7 +3538,7 @@ void cmGeneratorTarget::GetFullNameInternal(
}
// Append the suffix.
- outSuffix = targetSuffix2;
+ outSuffix = targetSuffix ? targetSuffix : "";
}
std::string cmGeneratorTarget::GetLinkerLanguage(