summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileExecutableTargetGenerator.cxx
diff options
context:
space:
mode:
authorJamie Snape <jamie.snape@kitware.com>2016-10-12 22:15:35 (GMT)
committerBrad King <brad.king@kitware.com>2016-10-13 17:34:35 (GMT)
commit33cb0173d5ebcde2a8621edaa66f8401133d5cc9 (patch)
treedbaba3c7369de742393b92e3f77405f7a8e02039 /Source/cmMakefileExecutableTargetGenerator.cxx
parent8eb6038d0d98da7f7e04462a72bd2e7529a7baff (diff)
downloadCMake-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/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index bfc4857..ed34ce6 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -198,7 +198,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
this->LocalGenerator->GetLinkLibsCMP0065(
linkLanguage, *this->GeneratorTarget));
- if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
+ if (this->GeneratorTarget->GetPropertyAsBool("LINK_WHAT_YOU_USE")) {
this->LocalGenerator->AppendFlags(linkFlags, " -Wl,--no-as-needed");
}
@@ -375,7 +375,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
vars.LinkFlags = linkFlags.c_str();
vars.Manifests = manifests.c_str();
- if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
+ if (this->GeneratorTarget->GetPropertyAsBool("LINK_WHAT_YOU_USE")) {
std::string cmakeCommand = this->LocalGenerator->ConvertToOutputFormat(
cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
cmakeCommand += " -E __run_iwyu --lwyu=";