From ba200e87c5db20d67e3c0d51bfb4ddf3151766fc Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Mon, 7 Nov 2022 17:24:10 +0000 Subject: [PATCH] tint: Bump stack size for MSVC + debug build Bug: tint:1749 Change-Id: Ic7a87a769ade9c459914ac745b449b4383812753 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108923 Auto-Submit: Ben Clayton Reviewed-by: James Price Kokoro: Kokoro Commit-Queue: James Price --- src/tint/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/tint/CMakeLists.txt b/src/tint/CMakeLists.txt index ca4456f41c..1d392434a4 100644 --- a/src/tint/CMakeLists.txt +++ b/src/tint/CMakeLists.txt @@ -752,6 +752,7 @@ if(${TINT_BUILD_SPV_READER} OR ${TINT_BUILD_SPV_WRITER}) endif() endif() + ################################################################################ # Tests ################################################################################ @@ -1351,7 +1352,16 @@ if(TINT_BUILD_TESTS) add_executable(tint_unittests ${TINT_TEST_SRCS}) set_target_properties(${target} PROPERTIES FOLDER "Tests") - if(NOT MSVC) + if(MSVC) + # TODO(crbug.com/tint/1749): MSVC debug builds can suffer from stack + # overflows when resolving deeply nested expression chains or statements. + # Production builds neither use MSVC nor debug, so just bump the stack size + # for this build combination. + string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type) + if ((NOT ${build_type} STREQUAL "RELEASE") AND (NOT ${build_type} STREQUAL "RELWITHDEBINFO")) + target_link_options(tint_unittests PRIVATE "/STACK 2097152") # 2MB, default is 1MB + endif() + else() target_compile_options(tint_unittests PRIVATE -Wno-global-constructors -Wno-weak-vtables