diff options
author | Brad King <brad.king@kitware.com> | 2022-05-10 14:30:31 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-05-10 14:30:42 (GMT) |
commit | 79b64690d9ccb8b6a3feac8e6600e7c7e7dcc33a (patch) | |
tree | 78edc69b3a1b9d7d607d7ffa88951b15d6a828a4 /Source/cmLocalGenerator.cxx | |
parent | 54c3563e951edf70f4fa4fe310cbed21f5412a56 (diff) | |
parent | 76a08cd25332b74627802df8817068219b89161d (diff) | |
download | CMake-79b64690d9ccb8b6a3feac8e6600e7c7e7dcc33a.zip CMake-79b64690d9ccb8b6a3feac8e6600e7c7e7dcc33a.tar.gz CMake-79b64690d9ccb8b6a3feac8e6600e7c7e7dcc33a.tar.bz2 |
Merge topic 'werror-property'
76a08cd253 COMPILE_WARNING_AS_ERROR: Add options to treat warnings as errors
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Michael Hirsch <michael@scivision.dev>
Merge-request: !7187
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 4b0a78b..e2bcea8 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1025,6 +1025,14 @@ void cmLocalGenerator::AddCompileOptions(std::vector<BT<std::string>>& flags, flags.emplace_back(std::move(compReqFlag)); } + // 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); + } + // Add compile flag for the MSVC compiler only. cmMakefile* mf = this->GetMakefile(); if (cmValue jmc = @@ -1919,6 +1927,7 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, std::string compilerSimulateId = this->Makefile->GetSafeDefinition( cmStrCat("CMAKE_", lang, "_SIMULATE_ID")); + if (lang == "Swift") { if (cmValue v = target->GetProperty("Swift_LANGUAGE_VERSION")) { if (cmSystemTools::VersionCompare( |