From b361e994ef4aac5e2f5672a291d4abf1a3714bc6 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 27 Aug 2014 11:53:46 +0300 Subject: AnvilStats: Added cmake directive for larger executable stack. This fixes runtime "stack overflow" errors caused by large stack-allocated arrays used for decompression. --- Tools/AnvilStats/CMakeLists.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Tools/AnvilStats') diff --git a/Tools/AnvilStats/CMakeLists.txt b/Tools/AnvilStats/CMakeLists.txt index 8cbcf6be4..557a4c17a 100644 --- a/Tools/AnvilStats/CMakeLists.txt +++ b/Tools/AnvilStats/CMakeLists.txt @@ -118,5 +118,27 @@ add_executable(AnvilStats ${SHARED_OSS_HDR} ) + target_link_libraries(AnvilStats zlib) + + + + +# Under MSVC we need to enlarge the default stack size for the executable: +if (MSVC) + get_target_property(TEMP AnvilStats LINK_FLAGS) + if (TEMP STREQUAL "TEMP-NOTFOUND") + SET(TEMP "") # set to empty string + message("LINKER_FLAGS not found") + else () + SET(TEMP "${TEMP} ") # a space to cleanly separate from existing content + message("LINKER_FLAGS: ${LINKER_FLAGS}") + endif () + # append our values + SET(TEMP "${TEMP}/STACK:16777216") + set_target_properties(AnvilStats PROPERTIES LINK_FLAGS ${TEMP}) +endif () + + + -- cgit v1.2.3