Commit aaf95ce849

Andrew Kelley <andrew@ziglang.org>
2022-12-05 23:54:07
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.
1 parent e73170f
Changed files (1)
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")