From aaf95ce849e7ae22a838aad5eac3dd5754a925cd Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 5 Dec 2022 15:54:07 -0700 Subject: [PATCH] CMake: adjust apple clang compiler check Before it was checking if the compiler was AppleClang, however, this did not handle the case when using a compiled-from-source Clang on a macOS computer, in which case the linker is still Apple ld64, and it is in fact the linker that needs to have the different flag to communicate stack size. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7291ea59b9..3f1a9ce43c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -731,7 +731,7 @@ else() set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99 -O2") set(ZIG1_COMPILE_FLAGS "-std=c99 -Os") set(ZIG2_COMPILE_FLAGS "-std=c99 -O0") - if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang") + if(APPLE) set(ZIG2_LINK_FLAGS "-Wl,-stack_size,0x10000000") else() set(ZIG2_LINK_FLAGS "-Wl,-z,stack-size=0x10000000")