mirror of
https://github.com/ziglang/zig.git
synced 2025-01-05 18:00:25 +00:00
cmake: fix host target detection
This commit is contained in:
parent
f421efbcc1
commit
687ea31ef9
@ -723,7 +723,20 @@ else()
|
||||
set(ZIG2_LINK_FLAGS "-Wl,-z,stack-size=0x10000000")
|
||||
endif()
|
||||
|
||||
string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}-${CMAKE_HOST_SYSTEM_NAME}" HOST_TARGET_TRIPLE)
|
||||
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64")
|
||||
set(HOST_TARGET_ARCH "x86_64")
|
||||
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
|
||||
set(HOST_TARGET_ARCH "aarch64")
|
||||
else()
|
||||
string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" HOST_TARGET_ARCH)
|
||||
endif()
|
||||
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
|
||||
set(HOST_TARGET_OS "macos")
|
||||
else()
|
||||
string(TOLOWER "${CMAKE_HOST_SYSTEM_NAME}" HOST_TARGET_OS)
|
||||
endif()
|
||||
set(HOST_TARGET_TRIPLE "${HOST_TARGET_ARCH}-${HOST_TARGET_OS}")
|
||||
|
||||
set(ZIG1_WASM_SOURCE "${CMAKE_SOURCE_DIR}/stage1/zig1.wasm.zst")
|
||||
set(ZIG1_C_SOURCE "${CMAKE_BINARY_DIR}/zig1.c")
|
||||
set(ZIG2_C_SOURCE "${CMAKE_BINARY_DIR}/zig2.c")
|
||||
|
Loading…
Reference in New Issue
Block a user