diff options
author | Jamie Snape <jamie.snape@kitware.com> | 2016-10-12 22:15:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-10-13 17:32:22 (GMT) |
commit | 933e54d3ccf59fd756997752a041ee84e5f85897 (patch) | |
tree | a8c311fbbd44c783c35d9bdba1fd11c1a057bdae /Source/cmMakefileLibraryTargetGenerator.cxx | |
parent | b99bbfe88d1bb02dc903507f3e1bbe716ac04c12 (diff) | |
download | CMake-933e54d3ccf59fd756997752a041ee84e5f85897.zip CMake-933e54d3ccf59fd756997752a041ee84e5f85897.tar.gz CMake-933e54d3ccf59fd756997752a041ee84e5f85897.tar.bz2 |
Honor LINK_WHAT_YOU_USE when set to OFF
Explicitly setting variable CMAKE_LINK_WHAT_YOU_USE or property
LINK_WHAT_YOU_USE to OFF should not cause LWYU to run. Fix the
property lookup to use GetPropertyAsBool.
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index b969bfb..2b1d7cc 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -161,7 +161,7 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink) extraFlags, "CMAKE_SHARED_LINKER_FLAGS", this->ConfigName); this->AddModuleDefinitionFlag(extraFlags); - if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) { + if (this->GeneratorTarget->GetPropertyAsBool("LINK_WHAT_YOU_USE")) { this->LocalGenerator->AppendFlags(extraFlags, " -Wl,--no-as-needed"); } this->WriteLibraryRules(linkRuleVar, extraFlags, relink); @@ -638,7 +638,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( // Get the set of commands. std::string linkRule = this->GetLinkRule(linkRuleVar); cmSystemTools::ExpandListArgument(linkRule, real_link_commands); - if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE") && + if (this->GeneratorTarget->GetPropertyAsBool("LINK_WHAT_YOU_USE") && (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY)) { std::string cmakeCommand = this->LocalGenerator->ConvertToOutputFormat( cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); |