mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 08:20:18 -06:00
cmMakefile: Improve parsing of CMAKE_MAXIMUM_RECURSION_DEPTH variable
This commit is contained in:
@@ -455,12 +455,11 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
|
||||
|
||||
// Check for maximum recursion depth.
|
||||
int depth = CMake_DEFAULT_RECURSION_LIMIT;
|
||||
cmValue depthStr = this->GetDefinition("CMAKE_MAXIMUM_RECURSION_DEPTH");
|
||||
if (depthStr) {
|
||||
std::istringstream s(*depthStr);
|
||||
int d;
|
||||
if (s >> d) {
|
||||
depth = d;
|
||||
if (cmValue depthStr =
|
||||
this->GetDefinition("CMAKE_MAXIMUM_RECURSION_DEPTH")) {
|
||||
unsigned long depthUL;
|
||||
if (cmStrToULong(depthStr.GetCStr(), &depthUL)) {
|
||||
depth = static_cast<int>(depthUL);
|
||||
}
|
||||
}
|
||||
if (this->RecursionDepth > depth) {
|
||||
|
||||
Reference in New Issue
Block a user