summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorArtur Ryt <artur.ryt@gmail.com>2018-12-13 19:45:15 (GMT)
committerCraig Scott <craig.scott@crascit.com>2018-12-29 21:31:09 (GMT)
commit1d32a35c10b384e8eb0dd2ce68c7bd11424409ac (patch)
tree1b3ba3b3db2d78fd200c01e7db5bfdbd6dbf1981 /Source
parent67ac4ed1dc5ad049ab443ce76a3f93b207703cec (diff)
downloadCMake-1d32a35c10b384e8eb0dd2ce68c7bd11424409ac.zip
CMake-1d32a35c10b384e8eb0dd2ce68c7bd11424409ac.tar.gz
CMake-1d32a35c10b384e8eb0dd2ce68c7bd11424409ac.tar.bz2
cmCommandArgumentParserHelper: use cmMakefile::MaybeWarnUninitialized
It removes logic duplication and need to have cached WarnUninitialized and CheckSystemVars
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx21
-rw-r--r--Source/cmCommandArgumentParserHelper.h2
2 files changed, 1 insertions, 22 deletions
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index 2b4ceaa..f94dc24 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -6,7 +6,6 @@
#include "cmMakefile.h"
#include "cmState.h"
#include "cmSystemTools.h"
-#include "cmake.h"
#include <iostream>
#include <sstream>
@@ -16,8 +15,6 @@ int cmCommandArgument_yyparse(yyscan_t yyscanner);
//
cmCommandArgumentParserHelper::cmCommandArgumentParserHelper()
{
- this->WarnUninitialized = false;
- this->CheckSystemVars = false;
this->FileLine = -1;
this->FileName = nullptr;
this->RemoveEmpty = true;
@@ -96,21 +93,7 @@ const char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
}
const char* value = this->Makefile->GetDefinition(var);
if (!value && !this->RemoveEmpty) {
- // check to see if we need to print a warning
- // if strict mode is on and the variable has
- // not been "cleared"/initialized with a set(foo ) call
- if (this->WarnUninitialized && !this->Makefile->VariableInitialized(var)) {
- if (this->CheckSystemVars ||
- (this->FileName &&
- (cmSystemTools::IsSubDirectory(
- this->FileName, this->Makefile->GetHomeDirectory()) ||
- cmSystemTools::IsSubDirectory(
- this->FileName, this->Makefile->GetHomeOutputDirectory())))) {
- std::ostringstream msg;
- msg << "uninitialized variable \'" << var << "\'";
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, msg.str());
- }
- }
+ this->Makefile->MaybeWarnUninitialized(var, this->FileName);
return nullptr;
}
if (this->EscapeQuotes && value) {
@@ -286,8 +269,6 @@ void cmCommandArgumentParserHelper::Error(const char* str)
void cmCommandArgumentParserHelper::SetMakefile(const cmMakefile* mf)
{
this->Makefile = mf;
- this->WarnUninitialized = mf->GetCMakeInstance()->GetWarnUninitialized();
- this->CheckSystemVars = mf->GetCMakeInstance()->GetCheckSystemVars();
}
void cmCommandArgumentParserHelper::SetResult(const char* value)
diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h
index 098c000..4dc238e 100644
--- a/Source/cmCommandArgumentParserHelper.h
+++ b/Source/cmCommandArgumentParserHelper.h
@@ -75,8 +75,6 @@ private:
long FileLine;
int CurrentLine;
int Verbose;
- bool WarnUninitialized;
- bool CheckSystemVars;
bool EscapeQuotes;
bool NoEscapeMode;
bool ReplaceAtSyntax;