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:34:35 (GMT) |
commit | 33cb0173d5ebcde2a8621edaa66f8401133d5cc9 (patch) | |
tree | dbaba3c7369de742393b92e3f77405f7a8e02039 /Source/cmMakefileLibraryTargetGenerator.cxx | |
parent | 8eb6038d0d98da7f7e04462a72bd2e7529a7baff (diff) | |
download | CMake-33cb0173d5ebcde2a8621edaa66f8401133d5cc9.zip CMake-33cb0173d5ebcde2a8621edaa66f8401133d5cc9.tar.gz CMake-33cb0173d5ebcde2a8621edaa66f8401133d5cc9.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 4488f06..860b912 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -168,7 +168,7 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink) this->AddModuleDefinitionFlag(linkLineComputer.get(), 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); @@ -660,7 +660,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); |