cmake: Add a ZIG2_NO_RTLIB option for building zig2 without compiler-rt.

This commit is contained in:
Alex Rønne Petersen 2024-09-08 01:35:35 +02:00 committed by Andrew Kelley
parent c234655e35
commit 3dd6456c0f

View File

@ -834,6 +834,11 @@ else()
endif()
endif()
option(ZIG2_NO_RTLIB "Build zig2 without linking to a compiler runtime library (for `zig cc` only)" OFF)
if(ZIG2_NO_RTLIB)
set(ZIG2_LINK_FLAGS "${ZIG2_LINK_FLAGS} -rtlib=none")
endif()
set(ZIG1_WASM_MODULE "${PROJECT_SOURCE_DIR}/stage1/zig1.wasm")
set(ZIG1_C_SOURCE "${PROJECT_BINARY_DIR}/zig1.c")
set(ZIG2_C_SOURCE "${PROJECT_BINARY_DIR}/zig2.c")