diff options
author | Brad King <brad.king@kitware.com> | 2023-03-10 15:39:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-13 15:50:21 (GMT) |
commit | 49167cf68fcfea201e4e81824baadf8bef413e4c (patch) | |
tree | eebb5b15ad078945c18dae00e9083c4f5f893764 /Source/cmMakefile.cxx | |
parent | 9504cef8c4d505f4f9fa66cbd485a2ac8b24ab72 (diff) | |
download | CMake-49167cf68fcfea201e4e81824baadf8bef413e4c.zip CMake-49167cf68fcfea201e4e81824baadf8bef413e4c.tar.gz CMake-49167cf68fcfea201e4e81824baadf8bef413e4c.tar.bz2 |
Source: Adjust stack sizes and recursion limits to work together
Adjust `CMake_DEFAULT_RECURSION_LIMIT` and/or the process stack size on
each platform to pass the `RunCMake.MaxRecursionDepth` test's "default"
cases.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 638da06..f37268d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -67,6 +67,24 @@ # include "cmVariableWatch.h" #endif +#ifndef __has_feature +# define __has_feature(x) 0 +#endif + +// Select a recursion limit that fits within the stack size. +// See stack size flags in '../CompileFlags.cmake'. +#ifndef CMake_DEFAULT_RECURSION_LIMIT +# if __has_feature(address_sanitizer) +# define CMake_DEFAULT_RECURSION_LIMIT 400 +# elif defined(_MSC_VER) && defined(_DEBUG) +# define CMake_DEFAULT_RECURSION_LIMIT 600 +# elif defined(__ibmxl__) && defined(__linux) +# define CMake_DEFAULT_RECURSION_LIMIT 600 +# else +# define CMake_DEFAULT_RECURSION_LIMIT 1000 +# endif +#endif + class cmMessenger; cmDirectoryId::cmDirectoryId(std::string s) |