Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
7f2bf831
Commit
7f2bf831
authored
Mar 10, 2008
by
Brad King
💬
Browse files
ENH: Enforce matching PUSH/POP calls for cmake_policy.
parent
eb6b3009
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/cmMakefile.cxx
View file @
7f2bf831
...
...
@@ -579,6 +579,7 @@ bool cmMakefile::ReadListFile(const char* filename_in,
}
// add this list file to the list of dependencies
this
->
ListFiles
.
push_back
(
filenametoread
);
bool
endScopeNicely
=
filename
?
true
:
false
;
const
size_t
numberFunctions
=
cacheFile
.
Functions
.
size
();
for
(
size_t
i
=
0
;
i
<
numberFunctions
;
++
i
)
{
...
...
@@ -587,17 +588,14 @@ bool cmMakefile::ReadListFile(const char* filename_in,
if
(
status
.
GetReturnInvoked
()
||
cmSystemTools
::
GetFatalErrorOccured
()
)
{
// pop the listfile off the stack
this
->
ListFileStack
.
pop_back
();
this
->
AddDefinition
(
"CMAKE_PARENT_LIST_FILE"
,
currentParentFile
.
c_str
());
this
->
AddDefinition
(
"CMAKE_CURRENT_LIST_FILE"
,
currentFile
.
c_str
());
return
true
;
// Exit early from processing this file.
endScopeNicely
=
false
;
break
;
}
}
// send scope ended to and function blockers
if
(
filename
)
if
(
endScopeNicely
)
{
// loop over all function blockers to see if any block this command
std
::
list
<
cmFunctionBlocker
*>::
iterator
pos
;
...
...
@@ -613,6 +611,20 @@ bool cmMakefile::ReadListFile(const char* filename_in,
}
}
// If this is the directory-level CMakeLists.txt file then enforce
// policy stack depth.
if
(
this
->
ListFileStack
.
size
()
==
1
)
{
while
(
this
->
PolicyStack
.
size
()
>
1
)
{
if
(
endScopeNicely
)
{
this
->
IssueError
(
"cmake_policy PUSH without matching POP"
);
}
this
->
PopPolicy
(
false
);
}
}
this
->
AddDefinition
(
"CMAKE_PARENT_LIST_FILE"
,
currentParentFile
.
c_str
());
this
->
AddDefinition
(
"CMAKE_CURRENT_LIST_FILE"
,
currentFile
.
c_str
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment