Tests: Allow RunCMake.MaxRecursionDepth to test public-facing default limit

Previously we compiled in a smaller default limit during nightly testing
and CI builds, so we were not testing the same default limit that
end-users will see.  Instead, set the limit during testing using an
environment variable so that we can unset it when testing the default
limit in `RunCMake.MaxRecursionDepth`.
This commit is contained in:
Brad King 2023-03-09 11:06:58 -05:00
parent 60ef076bac
commit 9504cef8c4
2 changed files with 4 additions and 3 deletions

View File

@ -12,9 +12,7 @@ endif()
include(CheckIncludeFile)
if(NOT CMake_DEFAULT_RECURSION_LIMIT)
if(DEFINED ENV{DASHBOARD_TEST_FROM_CTEST})
set(CMake_DEFAULT_RECURSION_LIMIT 100)
elseif(MINGW OR MSYS)
if(MINGW OR MSYS)
set(CMake_DEFAULT_RECURSION_LIMIT 400)
elseif(WIN32 AND CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64")
set(CMake_DEFAULT_RECURSION_LIMIT 400)

View File

@ -35,5 +35,8 @@ unset(ENV{CMAKE_GENERATOR_PLATFORM})
unset(ENV{CMAKE_GENERATOR_TOOLSET})
unset(ENV{CMAKE_EXPORT_COMPILE_COMMANDS})
# Verify that our module implementations do not recurse too much.
set(ENV{CMAKE_MAXIMUM_RECURSION_DEPTH} 100)
@TEST_HOME_ENV_CODE@
@TEST_WARN_VS_CODE@