summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-10-10 13:49:36 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-10-10 13:49:46 (GMT)
commiteebbe36ae65ab18f96a06b34ae7ccf523f6f69e2 (patch)
tree5f7d3700b2e7acbb3810453a4beb67b63baefda7 /Source/cmLocalGenerator.cxx
parent6edcb1490a777b6d96dfd34212dbf2bc8bdcdf42 (diff)
parent13f3382b1c11318d6f1f7ad6756a5a353e76d2b3 (diff)
downloadCMake-eebbe36ae65ab18f96a06b34ae7ccf523f6f69e2.zip
CMake-eebbe36ae65ab18f96a06b34ae7ccf523f6f69e2.tar.gz
CMake-eebbe36ae65ab18f96a06b34ae7ccf523f6f69e2.tar.bz2
Merge topic 'Intel-Fortran-warn-errors'
13f3382b1c Intel/IntelLLVM: Fortran has distinct "-Werror"-like flag ab8a0a106e COMPILE_WARNING_AS_ERROR: Fix internal formatting of options table Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7758
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index defcba3..2a50dd3 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1030,10 +1030,14 @@ void cmLocalGenerator::AddCompileOptions(std::vector<BT<std::string>>& flags,
// Add Warning as errors flags
if (!this->GetCMakeInstance()->GetIgnoreWarningAsError()) {
const cmValue wError = target->GetProperty("COMPILE_WARNING_AS_ERROR");
- const cmValue wErrorFlag = this->Makefile->GetDefinition(
+ const cmValue wErrorOpts = this->Makefile->GetDefinition(
cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_WARNING_AS_ERROR"));
- if (wError.IsOn() && wErrorFlag.IsSet()) {
- flags.emplace_back(wErrorFlag);
+ if (wError.IsOn() && wErrorOpts.IsSet()) {
+ std::string wErrorFlags;
+ this->AppendCompileOptions(wErrorFlags, *wErrorOpts);
+ if (!wErrorFlags.empty()) {
+ flags.emplace_back(std::move(wErrorFlags));
+ }
}
}