|
|
@@ -1028,10 +1028,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));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|