From 73a06a4975966294f99d507ee074ebe343a1aab7 Mon Sep 17 00:00:00 2001 From: chao an Date: Thu, 13 Jul 2023 22:15:03 +0800 Subject: [PATCH] cmake/win32: set default LINK_STACKSIZE to avoid stack overflow Signed-off-by: chao an --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fedeaa335..4dda33be20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -603,6 +603,10 @@ if(NOT CONFIG_ARCH_SIM) endif() elseif(WIN32) target_link_options(nuttx PUBLIC /SAFESEH:NO) + math(EXPR LINK_STACKSIZE + "${CONFIG_SIM_STACKSIZE_ADJUSTMENT} + ${CONFIG_IDLETHREAD_STACKSIZE}" + OUTPUT_FORMAT DECIMAL) + target_link_options(nuttx PUBLIC /STACK:${LINK_STACKSIZE},${LINK_STACKSIZE}) set(nuttx_libs_paths) foreach(lib ${nuttx_libs}) list(APPEND nuttx_libs_paths $)