mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-25 00:59:19 -06:00
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.
This commit is contained in:
@@ -828,11 +828,8 @@ void cmGlobalGenerator::EnableLanguage(
|
|||||||
std::string sharedLibFlagsVar = "CMAKE_SHARED_LIBRARY_";
|
std::string sharedLibFlagsVar = "CMAKE_SHARED_LIBRARY_";
|
||||||
sharedLibFlagsVar += lang;
|
sharedLibFlagsVar += lang;
|
||||||
sharedLibFlagsVar += "_FLAGS";
|
sharedLibFlagsVar += "_FLAGS";
|
||||||
std::string const& sharedLibFlags =
|
this->LanguageToOriginalSharedLibFlags[lang] =
|
||||||
mf->GetSafeDefinition(sharedLibFlagsVar);
|
mf->GetSafeDefinition(sharedLibFlagsVar);
|
||||||
if (!sharedLibFlags.empty()) {
|
|
||||||
this->LanguageToOriginalSharedLibFlags[lang] = sharedLibFlags;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Translate compiler ids for compatibility.
|
// Translate compiler ids for compatibility.
|
||||||
this->CheckCompilerIdCompatibility(mf, lang);
|
this->CheckCompilerIdCompatibility(mf, lang);
|
||||||
|
|||||||
@@ -1826,7 +1826,7 @@ bool cmLocalGenerator::GetShouldUseOldFlags(bool shared,
|
|||||||
flagsVar += "_FLAGS";
|
flagsVar += "_FLAGS";
|
||||||
std::string const& flags = this->Makefile->GetSafeDefinition(flagsVar);
|
std::string const& flags = this->Makefile->GetSafeDefinition(flagsVar);
|
||||||
|
|
||||||
if (!flags.empty() && flags != originalFlags) {
|
if (flags != originalFlags) {
|
||||||
switch (this->GetPolicyStatus(cmPolicies::CMP0018)) {
|
switch (this->GetPolicyStatus(cmPolicies::CMP0018)) {
|
||||||
case cmPolicies::WARN: {
|
case cmPolicies::WARN: {
|
||||||
std::ostringstream e;
|
std::ostringstream e;
|
||||||
|
|||||||
Reference in New Issue
Block a user