Skip to content

Add CMAKE_MAXIMUM_RECURSION_DEPTH environment variable

Brad King requested to merge brad.king/cmake:recursion-limit into master

Extend the recursion limit controls added by !2746 (merged) with an environment variable that is used if the CMake variable of the same name is not set.

Use the environment variable to allow the RunCMake.MaxRecursionDepth test to cover 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.

Inspired by discussion on discourse.

Edited by Brad King

Merge request reports