mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-03 05:08:47 -06:00
In order to keep infinitely-recursive scripts from causing a stack overflow in the CMake executable, CMake now imposes a maximum recursion limit before issuing an error message. The limit can be adjusted at runtime with CMAKE_MAXIMUM_RECURSION_DEPTH. Fixes: #18694
14 lines
319 B
CMake
14 lines
319 B
CMake
cmake_minimum_required(VERSION 3.12)
|
|
|
|
message("${x}")
|
|
math(EXPR x "${x} + 1")
|
|
try_compile(result
|
|
"${CMAKE_CURRENT_BINARY_DIR}/try_compile"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}"
|
|
try_compile
|
|
CMAKE_FLAGS -Dx:STRING=${x}
|
|
)
|
|
|
|
# We put this last to avoid prematurely triggering the recursion limit
|
|
project(try_compile NONE)
|