diff options
author | Brad King <brad.king@kitware.com> | 2023-04-26 18:35:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-04-26 18:36:46 (GMT) |
commit | 0f6a1dd3ed129e4c18c84432e41381471d47c107 (patch) | |
tree | 2508099e1ef18748460c81abb6d2c04c6e584c21 /Source | |
parent | 663cc941bd176347fb2fa89191629c6843bb4ebd (diff) | |
download | CMake-0f6a1dd3ed129e4c18c84432e41381471d47c107.zip CMake-0f6a1dd3ed129e4c18c84432e41381471d47c107.tar.gz CMake-0f6a1dd3ed129e4c18c84432e41381471d47c107.tar.bz2 |
Ninja: Revert "Exclude NVHPC -Werror flags during Fortran preprocessing"
Revert commit 6b58cdd4cf (Ninja: Exclude NVHPC -Werror flags during
Fortran preprocessing, 2023-04-04). Since commit 9d40f01442 (NVHPC: Use
-Werror for COMPILE_OPTIONS_WARNING_AS_ERROR, 2023-04-13), `nvfortran`
can handle the plain `-Werror` flag during preprocessing.
Issue: #24665
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 905c68e..c2ae629 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -21,8 +21,6 @@ #include <cm3p/json/value.h> #include <cm3p/json/writer.h> -#include "cmsys/RegularExpression.hxx" - #include "cmComputeLinkInformation.h" #include "cmCustomCommandGenerator.h" #include "cmDyndepCollation.h" @@ -1262,7 +1260,6 @@ namespace { cmNinjaBuild GetScanBuildStatement(const std::string& ruleName, const std::string& ppFileName, bool compilePP, bool compilePPWithDefines, - cmValue ppExcludeFlagsRegex, cmNinjaBuild& objBuild, cmNinjaVars& vars, const std::string& objectFileName, cmLocalGenerator* lg) @@ -1291,20 +1288,6 @@ cmNinjaBuild GetScanBuildStatement(const std::string& ruleName, // Scanning and compilation generally use the same flags. scanBuild.Variables["FLAGS"] = vars["FLAGS"]; - // Exclude flags not valid during preprocessing. - if (compilePP && !ppExcludeFlagsRegex.IsEmpty()) { - std::string in = std::move(scanBuild.Variables["FLAGS"]); - std::string out; - cmsys::RegularExpression regex(*ppExcludeFlagsRegex); - std::string::size_type pos = 0; - while (regex.find(in.c_str() + pos)) { - out = cmStrCat(out, in.substr(pos, regex.start()), ' '); - pos += regex.end(); - } - out = cmStrCat(out, in.substr(pos)); - scanBuild.Variables["FLAGS"] = std::move(out); - } - if (compilePP && !compilePPWithDefines) { // Move preprocessor definitions to the scan/preprocessor build statement. std::swap(scanBuild.Variables["DEFINES"], vars["DEFINES"]); @@ -1529,22 +1512,18 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( std::string scanRuleName; std::string ppFileName; - cmValue ppExcludeFlagsRegex; if (compilePP) { scanRuleName = this->LanguagePreprocessAndScanRule(language, config); ppFileName = this->ConvertToNinjaPath( this->GetPreprocessedFilePath(source, config)); - ppExcludeFlagsRegex = this->Makefile->GetDefinition(cmStrCat( - "CMAKE_", language, "_PREPROCESS_SOURCE_EXCLUDE_FLAGS_REGEX")); } else { scanRuleName = this->LanguageScanRule(language, config); ppFileName = cmStrCat(objectFileName, ".ddi.i"); } cmNinjaBuild ppBuild = GetScanBuildStatement( - scanRuleName, ppFileName, compilePP, compilePPWithDefines, - ppExcludeFlagsRegex, objBuild, vars, objectFileName, - this->LocalGenerator); + scanRuleName, ppFileName, compilePP, compilePPWithDefines, objBuild, + vars, objectFileName, this->LocalGenerator); if (compilePP) { // In case compilation requires flags that are incompatible with |