summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-05-30 21:23:42 (GMT)
committerBrad King <brad.king@kitware.com>2023-05-30 21:44:43 (GMT)
commitda27ff1e963b11dd91060fddb9e47a3135b4ac6c (patch)
treee82cf3edfcf507fbd0cb2a97a3bfdce6b7b0a60a /Source/cmLocalVisualStudio7Generator.cxx
parente0b48284a1beaef7f5a49073c8d4684418476ae1 (diff)
downloadCMake-da27ff1e963b11dd91060fddb9e47a3135b4ac6c.zip
CMake-da27ff1e963b11dd91060fddb9e47a3135b4ac6c.tar.gz
CMake-da27ff1e963b11dd91060fddb9e47a3135b4ac6c.tar.bz2
Preserve --compile-no-warning-as-error in automatic CMake re-runs
When the build system re-runs `cmake` to regenerate itself, preserve the `--compile-no-warning-as-error` option if it was used when `cmake` was last explicitly invoked. Normally such settings are preserved in the cache, but the purpose of this option is to be beyond the reach of project code.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index a7ea0df..af0e118 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -262,6 +262,10 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
cmCustomCommandLines commandLines =
cmMakeSingleCommandLine({ cmSystemTools::GetCMakeCommand(), argS, argB,
"--check-stamp-file", stampName });
+
+ if (cm->GetIgnoreWarningAsError()) {
+ commandLines[0].emplace_back("--compile-no-warning-as-error");
+ }
std::string comment = cmStrCat("Building Custom Rule ", makefileIn);
auto cc = cm::make_unique<cmCustomCommand>();
cc->SetOutputs(stampName);