diff options
author | Brad King <brad.king@kitware.com> | 2018-09-18 15:17:45 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-09-18 15:18:00 (GMT) |
commit | a8f628c0a456f74680bfdad0050f2614dbe50853 (patch) | |
tree | f072a8939837a3d6f954993fdbb9b54e43cdf1f0 /Source/cmGeneratorTarget.cxx | |
parent | 7adf3aabd55dd80784727a229a37c394740db628 (diff) | |
parent | f4ff60a803170311f49511a60a381eef8b78c5dd (diff) | |
download | CMake-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/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index efcfaf7..e2824e8 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; } @@ -3495,12 +3494,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 @@ -3508,19 +3508,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); @@ -3539,7 +3539,7 @@ void cmGeneratorTarget::GetFullNameInternal( } // Append the suffix. - outSuffix = targetSuffix ? targetSuffix : ""; + outSuffix = targetSuffix2; } std::string cmGeneratorTarget::GetLinkerLanguage( |