Random improvements to samples/native-stack-overflow (#3353)

This commit is contained in:
YAMAMOTO Takashi
2024-04-25 12:22:08 +09:00
committed by GitHub
parent 9d6d3466ff
commit a36c7d5aa9
7 changed files with 124 additions and 28 deletions

View File

@ -11,6 +11,9 @@ else()
project (native-stack-overflow C ASM)
endif()
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_EXTENSIONS YES)
################ runtime settings ################
string (TOLOWER ${CMAKE_HOST_SYSTEM_NAME} WAMR_BUILD_PLATFORM)
if (APPLE)
@ -43,7 +46,7 @@ if (NOT DEFINED WAMR_BUILD_TARGET)
endif ()
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Debug)
set (CMAKE_BUILD_TYPE Release)
endif ()
set (WAMR_BUILD_INTERP 1)
@ -65,6 +68,10 @@ if (NOT MSVC)
endif ()
endif ()
if (CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 13.0.0)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-usage")
endif ()
# build out vmlib
set (WAMR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)