summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-09 15:17:16 (GMT)
committerBrad King <brad.king@kitware.com>2023-03-09 15:53:05 (GMT)
commitfcad8d0630036cde6e99ae600e101dbbd5646c96 (patch)
tree08dc6b41fb3368443b918e76f7a7c13c432d17db /Source/cmMakefile.cxx
parent497f7d5c1af04f6c7120bcec40af9a1fee938883 (diff)
downloadCMake-fcad8d0630036cde6e99ae600e101dbbd5646c96.zip
CMake-fcad8d0630036cde6e99ae600e101dbbd5646c96.tar.gz
CMake-fcad8d0630036cde6e99ae600e101dbbd5646c96.tar.bz2
cmMakefile: Improve parsing of CMAKE_MAXIMUM_RECURSION_DEPTH variable
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 33843e2..a014776 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -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) {