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
This commit is contained in:
Brad King
2022-10-10 13:49:36 +00:00
committed by Kitware Robot
5 changed files with 29 additions and 11 deletions
+7 -3
View File
@@ -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));
}
}
}