diff options
author | Brad King <brad.king@kitware.com> | 2022-10-07 14:03:15 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-10-07 14:05:21 (GMT) |
commit | ab8a0a106ebeb2dd5592692c60512e7234ccfad2 (patch) | |
tree | ac4067bdc9784c38480fd672e46bb9fd905b3c42 /Source/cmLocalGenerator.cxx | |
parent | b18a86051e55d7cbdd7cb92325f13bfa8f92726f (diff) | |
download | CMake-ab8a0a106ebeb2dd5592692c60512e7234ccfad2.zip CMake-ab8a0a106ebeb2dd5592692c60512e7234ccfad2.tar.gz CMake-ab8a0a106ebeb2dd5592692c60512e7234ccfad2.tar.bz2 |
COMPILE_WARNING_AS_ERROR: Fix internal formatting of options table
In commit 76a08cd253 (COMPILE_WARNING_AS_ERROR: Add options to treat
warnings as errors, 2022-04-21, v3.24.0-rc1~173^2) we formatted the
options table entries as command-line string fragments. Since they are
part of the `CMAKE_${lang}_COMPILE_OPTIONS_*` tables, they should be
formatted as `;`-separated lists of compiler options.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 67c8bf2..99bd05f 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -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)); + } } } |