Skip to content

Commit f3673a7

Browse files
author
Jose Fernandez
committed
SYMX_STACK_SIZE cmake option
1 parent 911b416 commit f3673a7

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

symx/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,12 @@ target_include_directories(symx SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/extern
248248
## picoSHA2 — header-only, type appears in the public API (Scalar.h::_get_checksum).
249249
target_include_directories(symx SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/extern/picoSHA2/include)
250250

251+
# Conditionally increase the stack size (hugely complex expressions might need it)
252+
set(SYMX_STACK_SIZE "10480000" CACHE STRING "Linker stack size in bytes")
253+
254+
target_link_options(symx INTERFACE
255+
"$<$<CXX_COMPILER_ID:MSVC>:/STACK:${SYMX_STACK_SIZE}>"
256+
"$<$<CXX_COMPILER_ID:GNU>:-Wl,-z,stack-size=${SYMX_STACK_SIZE}>"
257+
"$<$<CXX_COMPILER_ID:Clang>:-Wl,-z,--stack_size=${SYMX_STACK_SIZE}>"
258+
"$<$<CXX_COMPILER_ID:AppleClang>:-Wl,-stack_size,${SYMX_STACK_SIZE}>"
259+
)

0 commit comments

Comments
 (0)