From d686f81e58200c68c1e89094210e9587e0e90983 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 19 Sep 2018 07:41:22 -0400 Subject: Restore possibly regressed CMP0018 logic Refactoring in commit f4ff60a803 (cmMakefile: Make GetSafeDefinition return std::string const&, 2018-09-05) changed the treatment of the empty string in CMP0018 diagnostic logic. Restore the behavior. --- Source/cmGlobalGenerator.cxx | 5 +---- Source/cmLocalGenerator.cxx | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index f504b9f..c45acf7 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -828,11 +828,8 @@ void cmGlobalGenerator::EnableLanguage( std::string sharedLibFlagsVar = "CMAKE_SHARED_LIBRARY_"; sharedLibFlagsVar += lang; sharedLibFlagsVar += "_FLAGS"; - std::string const& sharedLibFlags = + this->LanguageToOriginalSharedLibFlags[lang] = mf->GetSafeDefinition(sharedLibFlagsVar); - if (!sharedLibFlags.empty()) { - this->LanguageToOriginalSharedLibFlags[lang] = sharedLibFlags; - } // Translate compiler ids for compatibility. this->CheckCompilerIdCompatibility(mf, lang); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 7eb4ef4..7030725 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1826,7 +1826,7 @@ bool cmLocalGenerator::GetShouldUseOldFlags(bool shared, flagsVar += "_FLAGS"; std::string const& flags = this->Makefile->GetSafeDefinition(flagsVar); - if (!flags.empty() && flags != originalFlags) { + if (flags != originalFlags) { switch (this->GetPolicyStatus(cmPolicies::CMP0018)) { case cmPolicies::WARN: { std::ostringstream e; -- cgit v0.12