mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-24 19:59:47 +08:00
COMPILE_WARNING_AS_ERROR: rename methods to prepare link similar functionality
Methods renamed: * SetIgnoreWasinigAsError => SetIgnoreCompileWasningAsError * GetIgnoreWasinigAsError => GetIgnoreCompileWasningAsError
This commit is contained in:
@@ -3066,7 +3066,7 @@ void cmGlobalGenerator::AddGlobalTarget_EditCache(
|
|||||||
std::string edit_cmd = this->GetEditCacheCommand();
|
std::string edit_cmd = this->GetEditCacheCommand();
|
||||||
if (!edit_cmd.empty()) {
|
if (!edit_cmd.empty()) {
|
||||||
singleLine.push_back(std::move(edit_cmd));
|
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("--compile-no-warning-as-error");
|
||||||
}
|
}
|
||||||
singleLine.push_back("-S$(CMAKE_SOURCE_DIR)");
|
singleLine.push_back("-S$(CMAKE_SOURCE_DIR)");
|
||||||
@@ -3102,7 +3102,7 @@ void cmGlobalGenerator::AddGlobalTarget_RebuildCache(
|
|||||||
cmCustomCommandLine singleLine;
|
cmCustomCommandLine singleLine;
|
||||||
singleLine.push_back(cmSystemTools::GetCMakeCommand());
|
singleLine.push_back(cmSystemTools::GetCMakeCommand());
|
||||||
singleLine.push_back("--regenerate-during-build");
|
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("--compile-no-warning-as-error");
|
||||||
}
|
}
|
||||||
singleLine.push_back("-S$(CMAKE_SOURCE_DIR)");
|
singleLine.push_back("-S$(CMAKE_SOURCE_DIR)");
|
||||||
|
|||||||
@@ -1956,7 +1956,8 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
|
|||||||
cmNinjaRule rule("RERUN_CMAKE");
|
cmNinjaRule rule("RERUN_CMAKE");
|
||||||
rule.Command = cmStrCat(
|
rule.Command = cmStrCat(
|
||||||
this->CMakeCmd(), " --regenerate-during-build",
|
this->CMakeCmd(), " --regenerate-during-build",
|
||||||
cm->GetIgnoreWarningAsError() ? " --compile-no-warning-as-error" : "",
|
cm->GetIgnoreCompileWarningAsError() ? " --compile-no-warning-as-error"
|
||||||
|
: "",
|
||||||
" -S",
|
" -S",
|
||||||
lg->ConvertToOutputFormat(lg->GetSourceDirectory(),
|
lg->ConvertToOutputFormat(lg->GetSourceDirectory(),
|
||||||
cmOutputConverter::SHELL),
|
cmOutputConverter::SHELL),
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
|
|||||||
cmCustomCommandLines commandLines = cmMakeSingleCommandLine(
|
cmCustomCommandLines commandLines = cmMakeSingleCommandLine(
|
||||||
{ cmSystemTools::GetCMakeCommand(), argS, argB, "--check-stamp-list",
|
{ cmSystemTools::GetCMakeCommand(), argS, argB, "--check-stamp-list",
|
||||||
stampList, "--vs-solution-file", sln });
|
stampList, "--vs-solution-file", sln });
|
||||||
if (cm->GetIgnoreWarningAsError()) {
|
if (cm->GetIgnoreCompileWarningAsError()) {
|
||||||
commandLines[0].emplace_back("--compile-no-warning-as-error");
|
commandLines[0].emplace_back("--compile-no-warning-as-error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -781,7 +781,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
|
|||||||
<< ConvertToMakefilePath(cmSystemTools::GetCMakeCommand())
|
<< ConvertToMakefilePath(cmSystemTools::GetCMakeCommand())
|
||||||
<< " -S" << ConvertToMakefilePath(root->GetSourceDirectory())
|
<< " -S" << ConvertToMakefilePath(root->GetSourceDirectory())
|
||||||
<< " -B" << ConvertToMakefilePath(root->GetBinaryDirectory())
|
<< " -B" << ConvertToMakefilePath(root->GetBinaryDirectory())
|
||||||
<< (cm->GetIgnoreWarningAsError()
|
<< (cm->GetIgnoreCompileWarningAsError()
|
||||||
? " --compile-no-warning-as-error"
|
? " --compile-no-warning-as-error"
|
||||||
: "")
|
: "")
|
||||||
<< '\n';
|
<< '\n';
|
||||||
|
|||||||
@@ -1100,7 +1100,7 @@ void cmLocalGenerator::AddCompileOptions(std::vector<BT<std::string>>& flags,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add Warning as errors 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 wError = target->GetProperty("COMPILE_WARNING_AS_ERROR");
|
||||||
const cmValue wErrorOpts = this->Makefile->GetDefinition(
|
const cmValue wErrorOpts = this->Makefile->GetDefinition(
|
||||||
cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_WARNING_AS_ERROR"));
|
cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_WARNING_AS_ERROR"));
|
||||||
|
|||||||
@@ -829,7 +829,8 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsBottom(
|
|||||||
std::string cmakefileName = "CMakeFiles/Makefile.cmake";
|
std::string cmakefileName = "CMakeFiles/Makefile.cmake";
|
||||||
std::string runRule = cmStrCat(
|
std::string runRule = cmStrCat(
|
||||||
"$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) ",
|
"$(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 ",
|
"--check-build-system ",
|
||||||
this->ConvertToOutputFormat(cmakefileName, cmOutputConverter::SHELL),
|
this->ConvertToOutputFormat(cmakefileName, cmOutputConverter::SHELL),
|
||||||
" 0");
|
" 0");
|
||||||
@@ -1831,7 +1832,8 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
|
|||||||
{
|
{
|
||||||
std::string runRule = cmStrCat(
|
std::string runRule = cmStrCat(
|
||||||
"$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) ",
|
"$(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 ",
|
"--check-build-system ",
|
||||||
this->ConvertToOutputFormat(cmakefileName, cmOutputConverter::SHELL),
|
this->ConvertToOutputFormat(cmakefileName, cmOutputConverter::SHELL),
|
||||||
" 1");
|
" 1");
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
|
|||||||
cmMakeSingleCommandLine({ cmSystemTools::GetCMakeCommand(), argS, argB,
|
cmMakeSingleCommandLine({ cmSystemTools::GetCMakeCommand(), argS, argB,
|
||||||
"--check-stamp-file", stampName });
|
"--check-stamp-file", stampName });
|
||||||
|
|
||||||
if (cm->GetIgnoreWarningAsError()) {
|
if (cm->GetIgnoreCompileWarningAsError()) {
|
||||||
commandLines[0].emplace_back("--compile-no-warning-as-error");
|
commandLines[0].emplace_back("--compile-no-warning-as-error");
|
||||||
}
|
}
|
||||||
std::string comment = cmStrCat("Building Custom Rule ", makefileIn);
|
std::string comment = cmStrCat("Building Custom Rule ", makefileIn);
|
||||||
|
|||||||
@@ -1241,7 +1241,7 @@ void cmake::SetArgs(const std::vector<std::string>& args)
|
|||||||
[](std::string const&, cmake* state) -> bool {
|
[](std::string const&, cmake* state) -> bool {
|
||||||
std::cout << "Ignoring COMPILE_WARNING_AS_ERROR target property and "
|
std::cout << "Ignoring COMPILE_WARNING_AS_ERROR target property and "
|
||||||
"CMAKE_COMPILE_WARNING_AS_ERROR variable.\n";
|
"CMAKE_COMPILE_WARNING_AS_ERROR variable.\n";
|
||||||
state->SetIgnoreWarningAsError(true);
|
state->SetIgnoreCompileWarningAsError(true);
|
||||||
return true;
|
return true;
|
||||||
} },
|
} },
|
||||||
CommandArgument{ "--debugger", CommandArgument::Values::Zero,
|
CommandArgument{ "--debugger", CommandArgument::Values::Zero,
|
||||||
|
|||||||
@@ -542,8 +542,14 @@ public:
|
|||||||
void SetWarnUnusedCli(bool b) { this->WarnUnusedCli = b; }
|
void SetWarnUnusedCli(bool b) { this->WarnUnusedCli = b; }
|
||||||
bool GetCheckSystemVars() const { return this->CheckSystemVars; }
|
bool GetCheckSystemVars() const { return this->CheckSystemVars; }
|
||||||
void SetCheckSystemVars(bool b) { this->CheckSystemVars = b; }
|
void SetCheckSystemVars(bool b) { this->CheckSystemVars = b; }
|
||||||
bool GetIgnoreWarningAsError() const { return this->IgnoreWarningAsError; }
|
bool GetIgnoreCompileWarningAsError() const
|
||||||
void SetIgnoreWarningAsError(bool b) { this->IgnoreWarningAsError = b; }
|
{
|
||||||
|
return this->IgnoreCompileWarningAsError;
|
||||||
|
}
|
||||||
|
void SetIgnoreCompileWarningAsError(bool b)
|
||||||
|
{
|
||||||
|
this->IgnoreCompileWarningAsError = b;
|
||||||
|
}
|
||||||
|
|
||||||
void MarkCliAsUsed(const std::string& variable);
|
void MarkCliAsUsed(const std::string& variable);
|
||||||
|
|
||||||
@@ -753,7 +759,7 @@ private:
|
|||||||
bool WarnUninitialized = false;
|
bool WarnUninitialized = false;
|
||||||
bool WarnUnusedCli = true;
|
bool WarnUnusedCli = true;
|
||||||
bool CheckSystemVars = false;
|
bool CheckSystemVars = false;
|
||||||
bool IgnoreWarningAsError = false;
|
bool IgnoreCompileWarningAsError = false;
|
||||||
std::map<std::string, bool> UsedCliVariables;
|
std::map<std::string, bool> UsedCliVariables;
|
||||||
std::string CMakeEditCommand;
|
std::string CMakeEditCommand;
|
||||||
std::string CXXEnvironment;
|
std::string CXXEnvironment;
|
||||||
|
|||||||
Reference in New Issue
Block a user