summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-05-19 13:43:46 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-05-19 13:43:53 (GMT)
commit758756d1ba5a1fcb6b6caf7bb8ad93c406e2b062 (patch)
tree03fb2166801c5b7e578ec92100706b5e18ec976c /Source/cmLocalGenerator.cxx
parentf808b19020b3225b314a74fa3be65ea74b3c024f (diff)
parent65f7053d6c5a0d256691e156a22cc0e9f31a4d5a (diff)
downloadCMake-758756d1ba5a1fcb6b6caf7bb8ad93c406e2b062.zip
CMake-758756d1ba5a1fcb6b6caf7bb8ad93c406e2b062.tar.gz
CMake-758756d1ba5a1fcb6b6caf7bb8ad93c406e2b062.tar.bz2
Merge topic 'ignore-werror-command-arg'
65f7053d6c COMPILE_WARNING_AS_ERROR: Add command-line option Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7268
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index e2bcea8..d2c81ae 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1026,11 +1026,13 @@ void cmLocalGenerator::AddCompileOptions(std::vector<BT<std::string>>& flags,
}
// Add Warning as errors flags
- const cmValue wError = target->GetProperty("COMPILE_WARNING_AS_ERROR");
- const cmValue wErrorFlag = this->Makefile->GetDefinition(
- cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_WARNING_AS_ERROR"));
- if (wError.IsOn() && wErrorFlag.IsSet()) {
- flags.emplace_back(wErrorFlag);
+ if (!this->GetCMakeInstance()->GetIgnoreWarningAsError()) {
+ const cmValue wError = target->GetProperty("COMPILE_WARNING_AS_ERROR");
+ const cmValue wErrorFlag = this->Makefile->GetDefinition(
+ cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_WARNING_AS_ERROR"));
+ if (wError.IsOn() && wErrorFlag.IsSet()) {
+ flags.emplace_back(wErrorFlag);
+ }
}
// Add compile flag for the MSVC compiler only.