summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.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/cmNinjaNormalTargetGenerator.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/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index ab086eb..34fad9d 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -316,7 +316,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
const char* linkCmd = mf->GetDefinition(linkCmdVar);
if (linkCmd) {
cmSystemTools::ExpandListArgument(linkCmd, linkCmds);
- if (this->GetGeneratorTarget()->GetProperty("LINK_WHAT_YOU_USE")) {
+ if (this->GetGeneratorTarget()->GetPropertyAsBool("LINK_WHAT_YOU_USE")) {
std::string cmakeCommand =
this->GetLocalGenerator()->ConvertToOutputFormat(
cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
@@ -512,7 +512,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
vars["LINK_PATH"] = frameworkPath + linkPath;
std::string lwyuFlags;
- if (genTarget.GetProperty("LINK_WHAT_YOU_USE")) {
+ if (genTarget.GetPropertyAsBool("LINK_WHAT_YOU_USE")) {
lwyuFlags = " -Wl,--no-as-needed";
}