summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorRuslan Baratov <ruslan_baratov@yahoo.com>2017-05-10 12:26:16 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-10 13:41:40 (GMT)
commit469813cce049e18357ab274316aac0cdb4ca6688 (patch)
treed5bb9eb1d17da5aefaab78c6e8d2651e067cad32 /Source
parent730cd10c64679bd0a8325bf7f0e9febda613bb8a (diff)
downloadCMake-469813cce049e18357ab274316aac0cdb4ca6688.zip
CMake-469813cce049e18357ab274316aac0cdb4ca6688.tar.gz
CMake-469813cce049e18357ab274316aac0cdb4ca6688.tar.bz2
CMP0069: Suppress warning if we are in 'try_compile'
Fixes: #16855
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorTarget.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 3f50e32..073bde2 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -489,7 +489,9 @@ bool cmGeneratorTarget::IsIPOEnabled(const std::string& config) const
// problem is already reported, no need to issue a message
return false;
}
- if (cmp0069 == cmPolicies::WARN) {
+ const bool in_try_compile =
+ this->LocalGenerator->GetCMakeInstance()->GetIsInTryCompile();
+ if (cmp0069 == cmPolicies::WARN && !in_try_compile) {
std::ostringstream w;
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0069) << "\n";
w << "INTERPROCEDURAL_OPTIMIZATION property will be ignored for target "