diff options
author | Brad King <brad.king@kitware.com> | 2023-03-09 15:17:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-13 15:45:58 (GMT) |
commit | 89b69bf1addad6138b9aa51c2f67380c9e489f2f (patch) | |
tree | 7831693deb449f72c7d9e983c3a3ca5f3deef6ba /Source | |
parent | 395895bda72462c59e18135e98662e47f52138ba (diff) | |
download | CMake-89b69bf1addad6138b9aa51c2f67380c9e489f2f.zip CMake-89b69bf1addad6138b9aa51c2f67380c9e489f2f.tar.gz CMake-89b69bf1addad6138b9aa51c2f67380c9e489f2f.tar.bz2 |
Add CMAKE_MAXIMUM_RECURSION_DEPTH environment variable
Extend the recursion limit controls added by commit a6982cff0d
(cmMakefile: Impose maximum recursion limit, 2018-12-14,
v3.14.0-rc1~82^2) with an environment variable that is used if the
CMake variable of the same name is not set.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMakefile.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 383a818..638da06 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2865,6 +2865,12 @@ size_t cmMakefile::GetRecursionDepthLimit() const if (cmStrToULong(depthStr.GetCStr(), &depthUL)) { depth = depthUL; } + } else if (cm::optional<std::string> depthEnv = + cmSystemTools::GetEnvVar("CMAKE_MAXIMUM_RECURSION_DEPTH")) { + unsigned long depthUL; + if (cmStrToULong(*depthEnv, &depthUL)) { + depth = depthUL; + } } return depth; } |