zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit aaf95ce849e7ae22a838aad5eac3dd5754a925cd (tree)
parent e73170f9725c530befc688dd40053022072f5058
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Mon,  5 Dec 2022 15:54:07 -0700

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.

Diffstat:
MCMakeLists.txt | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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")