Skip to content

Commit

Permalink
🏁 set stack size for some unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Aug 20, 2021
1 parent ebf3a80 commit 01daa32
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,11 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
endif()

# avoid stack overflow, see https://github.com/nlohmann/json/issues/2955
target_link_libraries(test-cbor PRIVATE "$<$<CXX_COMPILER_ID:MSVC>:/STACK:4000000;>")
target_link_libraries(test-msgpack PRIVATE "$<$<CXX_COMPILER_ID:MSVC>:/STACK:4000000;>")
target_link_libraries(test-ubjson PRIVATE "$<$<CXX_COMPILER_ID:MSVC>:/STACK:4000000;>")
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set_property(TARGET test-cbor APPEND_STRING PROPERTY LINK_FLAGS " /STACK:4000000")
set_property(TARGET test-msgpack APPEND_STRING PROPERTY LINK_FLAGS " /STACK:4000000")
set_property(TARGET test-ubjson APPEND_STRING PROPERTY LINK_FLAGS " /STACK:4000000")
endif()

#############################################################################
# Test the generated build configs
Expand Down

0 comments on commit 01daa32

Please sign in to comment.