summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2019-02-20 15:54:47 (GMT)
committerBrad King <brad.king@kitware.com>2019-02-20 19:30:57 (GMT)
commit98a2d42301ec9ba0cd1c69b0a05351039bc69dc8 (patch)
tree7db14bcb2aca9f65a8c582709335a9050eb99147 /Source/cmGeneratorTarget.cxx
parente6897c72e7c59f7a0b82ed19c1bdb40d42f7adaa (diff)
downloadCMake-98a2d42301ec9ba0cd1c69b0a05351039bc69dc8.zip
CMake-98a2d42301ec9ba0cd1c69b0a05351039bc69dc8.tar.gz
CMake-98a2d42301ec9ba0cd1c69b0a05351039bc69dc8.tar.bz2
PIE link options: No warning when policy CMP0083 is not set.
Fixes: #18955
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx19
1 files changed, 4 insertions, 15 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 78040c3..25349d4 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -510,21 +510,10 @@ const char* cmGeneratorTarget::GetLinkPIEProperty(
return nullptr;
}
- switch (this->GetPolicyStatusCMP0083()) {
- case cmPolicies::WARN: {
- std::ostringstream e;
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0083);
- this->LocalGenerator->IssueMessage(MessageType::AUTHOR_WARNING, e.str());
- CM_FALLTHROUGH;
- }
- case cmPolicies::OLD:
- return nullptr;
- default:
- // nothing to do
- break;
- }
-
- return PICValue.c_str();
+ auto status = this->GetPolicyStatusCMP0083();
+ return (status != cmPolicies::WARN && status != cmPolicies::OLD)
+ ? PICValue.c_str()
+ : nullptr;
}
bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang,