cmMakefile: Create a scoped context for parsing listfiles.
Update the Syntax tests to check for updated/improved backtraces.
This commit is contained in:
parent
30d44efaf8
commit
821f91d6ab
@ -547,6 +547,26 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class cmParseFileScope
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
cmParseFileScope(cmMakefile* mf)
|
||||||
|
: Makefile(mf)
|
||||||
|
{
|
||||||
|
this->Context.FilePath = this->Makefile->GetExecutionFilePath();
|
||||||
|
this->Makefile->ContextStack.push_back(&this->Context);
|
||||||
|
}
|
||||||
|
|
||||||
|
~cmParseFileScope()
|
||||||
|
{
|
||||||
|
this->Makefile->ContextStack.pop_back();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
cmMakefile* Makefile;
|
||||||
|
cmListFileContext Context;
|
||||||
|
};
|
||||||
|
|
||||||
bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
|
bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
|
||||||
{
|
{
|
||||||
this->AddDefinition("CMAKE_PARENT_LIST_FILE",
|
this->AddDefinition("CMAKE_PARENT_LIST_FILE",
|
||||||
@ -558,10 +578,14 @@ bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
|
|||||||
IncludeScope incScope(this, filenametoread, noPolicyScope);
|
IncludeScope incScope(this, filenametoread, noPolicyScope);
|
||||||
|
|
||||||
cmListFile listFile;
|
cmListFile listFile;
|
||||||
|
{
|
||||||
|
cmParseFileScope pfs(this);
|
||||||
if (!listFile.ParseFile(filenametoread.c_str(), false, this))
|
if (!listFile.ParseFile(filenametoread.c_str(), false, this))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this->ReadListFile(listFile, filenametoread);
|
this->ReadListFile(listFile, filenametoread);
|
||||||
if(cmSystemTools::GetFatalErrorOccured())
|
if(cmSystemTools::GetFatalErrorOccured())
|
||||||
{
|
{
|
||||||
@ -619,10 +643,13 @@ bool cmMakefile::ReadListFile(const char* filename)
|
|||||||
ListFileScope scope(this, filenametoread);
|
ListFileScope scope(this, filenametoread);
|
||||||
|
|
||||||
cmListFile listFile;
|
cmListFile listFile;
|
||||||
|
{
|
||||||
|
cmParseFileScope pfs(this);
|
||||||
if (!listFile.ParseFile(filenametoread.c_str(), false, this))
|
if (!listFile.ParseFile(filenametoread.c_str(), false, this))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this->ReadListFile(listFile, filenametoread);
|
this->ReadListFile(listFile, filenametoread);
|
||||||
if(cmSystemTools::GetFatalErrorOccured())
|
if(cmSystemTools::GetFatalErrorOccured())
|
||||||
@ -1738,11 +1765,14 @@ void cmMakefile::Configure()
|
|||||||
this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentStart.c_str());
|
this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentStart.c_str());
|
||||||
|
|
||||||
cmListFile listFile;
|
cmListFile listFile;
|
||||||
|
{
|
||||||
|
cmParseFileScope pfs(this);
|
||||||
if (!listFile.ParseFile(currentStart.c_str(), this->IsRootMakefile(), this))
|
if (!listFile.ParseFile(currentStart.c_str(), this->IsRootMakefile(), this))
|
||||||
{
|
{
|
||||||
this->SetConfigured();
|
this->SetConfigured();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this->ReadListFile(listFile, currentStart);
|
this->ReadListFile(listFile, currentStart);
|
||||||
if(cmSystemTools::GetFatalErrorOccured())
|
if(cmSystemTools::GetFatalErrorOccured())
|
||||||
{
|
{
|
||||||
|
@ -940,6 +940,7 @@ private:
|
|||||||
std::vector<cmListFileContext const*> ContextStack;
|
std::vector<cmListFileContext const*> ContextStack;
|
||||||
std::vector<cmExecutionStatus*> ExecutionStatusStack;
|
std::vector<cmExecutionStatus*> ExecutionStatusStack;
|
||||||
friend class cmMakefileCall;
|
friend class cmMakefileCall;
|
||||||
|
friend class cmParseFileScope;
|
||||||
|
|
||||||
std::vector<cmTarget*> ImportedTargetsOwned;
|
std::vector<cmTarget*> ImportedTargetsOwned;
|
||||||
TargetMap ImportedTargets;
|
TargetMap ImportedTargets;
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
CMake Error at CMakeLists.txt:3 \(include\):
|
CMake Error in BOM-UTF-16-BE.cmake:
|
||||||
File
|
File
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/BOM-UTF-16-BE.cmake
|
.*/Tests/RunCMake/Syntax/BOM-UTF-16-BE.cmake
|
||||||
|
|
||||||
starts with a Byte-Order-Mark that is not UTF-8.
|
starts with a Byte-Order-Mark that is not UTF-8.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
CMake Error at CMakeLists.txt:3 \(include\):
|
CMake Error in BOM-UTF-16-LE.cmake:
|
||||||
File
|
File
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/BOM-UTF-16-LE.cmake
|
.*/Tests/RunCMake/Syntax/BOM-UTF-16-LE.cmake
|
||||||
|
|
||||||
starts with a Byte-Order-Mark that is not UTF-8.
|
starts with a Byte-Order-Mark that is not UTF-8.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
CMake Error at CMakeLists.txt:3 \(include\):
|
CMake Error in BOM-UTF-32-BE.cmake:
|
||||||
File
|
File
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/BOM-UTF-32-BE.cmake
|
.*/Tests/RunCMake/Syntax/BOM-UTF-32-BE.cmake
|
||||||
|
|
||||||
starts with a Byte-Order-Mark that is not UTF-8.
|
starts with a Byte-Order-Mark that is not UTF-8.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
CMake Error at CMakeLists.txt:3 \(include\):
|
CMake Error in BOM-UTF-32-LE.cmake:
|
||||||
File
|
File
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/BOM-UTF-32-LE.cmake
|
.*/Tests/RunCMake/Syntax/BOM-UTF-32-LE.cmake
|
||||||
|
|
||||||
starts with a Byte-Order-Mark that is not UTF-8.
|
starts with a Byte-Order-Mark that is not UTF-8.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
CMake Error at CMakeLists.txt:3 \(include\):
|
CMake Error in BracketNoSpace0.cmake:
|
||||||
Syntax Error in cmake code at
|
Syntax Error in cmake code at
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/BracketNoSpace0.cmake:1:27
|
.*/Tests/RunCMake/Syntax/BracketNoSpace0.cmake:1:27
|
||||||
|
|
||||||
Argument not separated from preceding token by whitespace.
|
Argument not separated from preceding token by whitespace.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
CMake Error at CMakeLists.txt:3 \(include\):
|
CMake Error in BracketNoSpace1.cmake:
|
||||||
Syntax Error in cmake code at
|
Syntax Error in cmake code at
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/BracketNoSpace1.cmake:1:24
|
.*/Tests/RunCMake/Syntax/BracketNoSpace1.cmake:1:24
|
||||||
|
|
||||||
Argument not separated from preceding token by whitespace.
|
Argument not separated from preceding token by whitespace.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
CMake Error at CMakeLists.txt:3 \(include\):
|
CMake Error in BracketNoSpace2.cmake:
|
||||||
Syntax Error in cmake code at
|
Syntax Error in cmake code at
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/BracketNoSpace2.cmake:1:44
|
.*/Tests/RunCMake/Syntax/BracketNoSpace2.cmake:1:44
|
||||||
|
|
||||||
Argument not separated from preceding token by whitespace.
|
Argument not separated from preceding token by whitespace.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
CMake Error at CMakeLists.txt:3 \(include\):
|
CMake Error in BracketNoSpace3.cmake:
|
||||||
Syntax Error in cmake code at
|
Syntax Error in cmake code at
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/BracketNoSpace3.cmake:1:45
|
.*/Tests/RunCMake/Syntax/BracketNoSpace3.cmake:1:45
|
||||||
|
|
||||||
Argument not separated from preceding token by whitespace.
|
Argument not separated from preceding token by whitespace.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
CMake Error at CMakeLists.txt:3 \(include\):
|
CMake Error in BracketNoSpace4.cmake:
|
||||||
Syntax Error in cmake code at
|
Syntax Error in cmake code at
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/BracketNoSpace4.cmake:1:44
|
.*/Tests/RunCMake/Syntax/BracketNoSpace4.cmake:1:44
|
||||||
|
|
||||||
Argument not separated from preceding token by whitespace.
|
Argument not separated from preceding token by whitespace.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
CMake Error at CMakeLists.txt:3 \(include\):
|
CMake Error in BracketNoSpace5.cmake:
|
||||||
Syntax Error in cmake code at
|
Syntax Error in cmake code at
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/BracketNoSpace5.cmake:1:45
|
.*/Tests/RunCMake/Syntax/BracketNoSpace5.cmake:1:45
|
||||||
|
|
||||||
Argument not separated from preceding token by whitespace.
|
Argument not separated from preceding token by whitespace.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
|
CMake Warning \(dev\) in ParenInENV.cmake:
|
||||||
Syntax Warning in cmake code at
|
Syntax Warning in cmake code at
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/ParenInENV.cmake:2:21
|
.*/Tests/RunCMake/Syntax/ParenInENV.cmake:2:21
|
||||||
|
|
||||||
Argument not separated from preceding token by whitespace.
|
Argument not separated from preceding token by whitespace.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
This warning is for project developers. Use -Wno-dev to suppress it.
|
This warning is for project developers. Use -Wno-dev to suppress it.
|
||||||
|
|
||||||
CMake Error at ParenInENV.cmake:2 \(message\):
|
CMake Error at ParenInENV.cmake:2 \(message\):
|
||||||
|
@ -1,22 +1,28 @@
|
|||||||
CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
|
CMake Warning \(dev\) in ParenNoSpace1.cmake:
|
||||||
Syntax Warning in cmake code at
|
Syntax Warning in cmake code at
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:1:26
|
.*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:1:26
|
||||||
|
|
||||||
Argument not separated from preceding token by whitespace.
|
Argument not separated from preceding token by whitespace.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
This warning is for project developers. Use -Wno-dev to suppress it.
|
This warning is for project developers. Use -Wno-dev to suppress it.
|
||||||
|
|
||||||
CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
|
CMake Warning \(dev\) in ParenNoSpace1.cmake:
|
||||||
Syntax Warning in cmake code at
|
Syntax Warning in cmake code at
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:2:26
|
.*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:2:26
|
||||||
|
|
||||||
Argument not separated from preceding token by whitespace.
|
Argument not separated from preceding token by whitespace.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
This warning is for project developers. Use -Wno-dev to suppress it.
|
This warning is for project developers. Use -Wno-dev to suppress it.
|
||||||
|
|
||||||
CMake Error at CMakeLists.txt:3 \(include\):
|
CMake Error in ParenNoSpace1.cmake:
|
||||||
Syntax Error in cmake code at
|
Syntax Error in cmake code at
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:3:29
|
.*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:3:29
|
||||||
|
|
||||||
Argument not separated from preceding token by whitespace.
|
Argument not separated from preceding token by whitespace.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
|
@ -1,17 +1,21 @@
|
|||||||
CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
|
CMake Warning \(dev\) in StringNoSpace.cmake:
|
||||||
Syntax Warning in cmake code at
|
Syntax Warning in cmake code at
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/StringNoSpace.cmake:2:28
|
.*/Tests/RunCMake/Syntax/StringNoSpace.cmake:2:28
|
||||||
|
|
||||||
Argument not separated from preceding token by whitespace.
|
Argument not separated from preceding token by whitespace.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
This warning is for project developers. Use -Wno-dev to suppress it.
|
This warning is for project developers. Use -Wno-dev to suppress it.
|
||||||
|
|
||||||
CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
|
CMake Warning \(dev\) in StringNoSpace.cmake:
|
||||||
Syntax Warning in cmake code at
|
Syntax Warning in cmake code at
|
||||||
|
|
||||||
.*/Tests/RunCMake/Syntax/StringNoSpace.cmake:2:31
|
.*/Tests/RunCMake/Syntax/StringNoSpace.cmake:2:31
|
||||||
|
|
||||||
Argument not separated from preceding token by whitespace.
|
Argument not separated from preceding token by whitespace.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
This warning is for project developers. Use -Wno-dev to suppress it.
|
This warning is for project developers. Use -Wno-dev to suppress it.
|
||||||
|
|
||||||
\[1 \${var} \\n 4\]
|
\[1 \${var} \\n 4\]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user