From 656267c871f92f234563fa20c03aa4b4d7b60d75 Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Tue, 5 Nov 2024 12:35:25 +0100 Subject: [PATCH] COMPILE_WARNING_AS_ERROR: rename methods to prepare link similar functionality Methods renamed: * SetIgnoreWasinigAsError => SetIgnoreCompileWasningAsError * GetIgnoreWasinigAsError => GetIgnoreCompileWasningAsError --- Source/cmGlobalGenerator.cxx | 4 ++-- Source/cmGlobalNinjaGenerator.cxx | 3 ++- Source/cmGlobalVisualStudio8Generator.cxx | 2 +- Source/cmGlobalXCodeGenerator.cxx | 2 +- Source/cmLocalGenerator.cxx | 2 +- Source/cmLocalUnixMakefileGenerator3.cxx | 6 ++++-- Source/cmLocalVisualStudio7Generator.cxx | 2 +- Source/cmake.cxx | 2 +- Source/cmake.h | 12 +++++++++--- 9 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 382b656585..fd1145183f 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -3066,7 +3066,7 @@ void cmGlobalGenerator::AddGlobalTarget_EditCache( std::string edit_cmd = this->GetEditCacheCommand(); if (!edit_cmd.empty()) { singleLine.push_back(std::move(edit_cmd)); - if (this->GetCMakeInstance()->GetIgnoreWarningAsError()) { + if (this->GetCMakeInstance()->GetIgnoreCompileWarningAsError()) { singleLine.push_back("--compile-no-warning-as-error"); } singleLine.push_back("-S$(CMAKE_SOURCE_DIR)"); @@ -3102,7 +3102,7 @@ void cmGlobalGenerator::AddGlobalTarget_RebuildCache( cmCustomCommandLine singleLine; singleLine.push_back(cmSystemTools::GetCMakeCommand()); singleLine.push_back("--regenerate-during-build"); - if (this->GetCMakeInstance()->GetIgnoreWarningAsError()) { + if (this->GetCMakeInstance()->GetIgnoreCompileWarningAsError()) { singleLine.push_back("--compile-no-warning-as-error"); } singleLine.push_back("-S$(CMAKE_SOURCE_DIR)"); diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index d46ec81ad3..d6d0a5145d 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1956,7 +1956,8 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) cmNinjaRule rule("RERUN_CMAKE"); rule.Command = cmStrCat( this->CMakeCmd(), " --regenerate-during-build", - cm->GetIgnoreWarningAsError() ? " --compile-no-warning-as-error" : "", + cm->GetIgnoreCompileWarningAsError() ? " --compile-no-warning-as-error" + : "", " -S", lg->ConvertToOutputFormat(lg->GetSourceDirectory(), cmOutputConverter::SHELL), diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index d9accad173..eabdd8eede 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -325,7 +325,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() cmCustomCommandLines commandLines = cmMakeSingleCommandLine( { cmSystemTools::GetCMakeCommand(), argS, argB, "--check-stamp-list", stampList, "--vs-solution-file", sln }); - if (cm->GetIgnoreWarningAsError()) { + if (cm->GetIgnoreCompileWarningAsError()) { commandLines[0].emplace_back("--compile-no-warning-as-error"); } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index a45e23f330..e7ada0da42 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -781,7 +781,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile( << ConvertToMakefilePath(cmSystemTools::GetCMakeCommand()) << " -S" << ConvertToMakefilePath(root->GetSourceDirectory()) << " -B" << ConvertToMakefilePath(root->GetBinaryDirectory()) - << (cm->GetIgnoreWarningAsError() + << (cm->GetIgnoreCompileWarningAsError() ? " --compile-no-warning-as-error" : "") << '\n'; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index b011747561..fe43401904 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1100,7 +1100,7 @@ void cmLocalGenerator::AddCompileOptions(std::vector>& flags, } // Add Warning as errors flags - if (!this->GetCMakeInstance()->GetIgnoreWarningAsError()) { + if (!this->GetCMakeInstance()->GetIgnoreCompileWarningAsError()) { const cmValue wError = target->GetProperty("COMPILE_WARNING_AS_ERROR"); const cmValue wErrorOpts = this->Makefile->GetDefinition( cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_WARNING_AS_ERROR")); diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 4a776b4dfc..aa4bbac6eb 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -829,7 +829,8 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsBottom( std::string cmakefileName = "CMakeFiles/Makefile.cmake"; std::string runRule = cmStrCat( "$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) ", - cm->GetIgnoreWarningAsError() ? "--compile-no-warning-as-error " : "", + cm->GetIgnoreCompileWarningAsError() ? "--compile-no-warning-as-error " + : "", "--check-build-system ", this->ConvertToOutputFormat(cmakefileName, cmOutputConverter::SHELL), " 0"); @@ -1831,7 +1832,8 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( { std::string runRule = cmStrCat( "$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) ", - cm->GetIgnoreWarningAsError() ? "--compile-no-warning-as-error " : "", + cm->GetIgnoreCompileWarningAsError() ? "--compile-no-warning-as-error " + : "", "--check-build-system ", this->ConvertToOutputFormat(cmakefileName, cmOutputConverter::SHELL), " 1"); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 97df2a5f16..f6931bd19f 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -259,7 +259,7 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule() cmMakeSingleCommandLine({ cmSystemTools::GetCMakeCommand(), argS, argB, "--check-stamp-file", stampName }); - if (cm->GetIgnoreWarningAsError()) { + if (cm->GetIgnoreCompileWarningAsError()) { commandLines[0].emplace_back("--compile-no-warning-as-error"); } std::string comment = cmStrCat("Building Custom Rule ", makefileIn); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 2817819d57..cdab3c76e8 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1241,7 +1241,7 @@ void cmake::SetArgs(const std::vector& args) [](std::string const&, cmake* state) -> bool { std::cout << "Ignoring COMPILE_WARNING_AS_ERROR target property and " "CMAKE_COMPILE_WARNING_AS_ERROR variable.\n"; - state->SetIgnoreWarningAsError(true); + state->SetIgnoreCompileWarningAsError(true); return true; } }, CommandArgument{ "--debugger", CommandArgument::Values::Zero, diff --git a/Source/cmake.h b/Source/cmake.h index d5c8bbb4ee..62533b6297 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -542,8 +542,14 @@ public: void SetWarnUnusedCli(bool b) { this->WarnUnusedCli = b; } bool GetCheckSystemVars() const { return this->CheckSystemVars; } void SetCheckSystemVars(bool b) { this->CheckSystemVars = b; } - bool GetIgnoreWarningAsError() const { return this->IgnoreWarningAsError; } - void SetIgnoreWarningAsError(bool b) { this->IgnoreWarningAsError = b; } + bool GetIgnoreCompileWarningAsError() const + { + return this->IgnoreCompileWarningAsError; + } + void SetIgnoreCompileWarningAsError(bool b) + { + this->IgnoreCompileWarningAsError = b; + } void MarkCliAsUsed(const std::string& variable); @@ -753,7 +759,7 @@ private: bool WarnUninitialized = false; bool WarnUnusedCli = true; bool CheckSystemVars = false; - bool IgnoreWarningAsError = false; + bool IgnoreCompileWarningAsError = false; std::map UsedCliVariables; std::string CMakeEditCommand; std::string CXXEnvironment;