Add freestanding riscv64 toolchain

This commit is contained in:
Duncan Ogilvie
2024-11-05 13:33:25 +01:00
parent 071498eaeb
commit 03f4b117a3
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
set(ZIG_TARGET "riscv64-freestanding-none")
include(${CMAKE_CURRENT_LIST_DIR}/zig-toolchain.cmake)

View File

@@ -18,8 +18,12 @@ elseif(ZIG_OS STREQUAL "windows")
set(CMAKE_SYSTEM_NAME "Windows") set(CMAKE_SYSTEM_NAME "Windows")
elseif(ZIG_OS STREQUAL "macos") elseif(ZIG_OS STREQUAL "macos")
set(CMAKE_SYSTEM_NAME "Darwin") set(CMAKE_SYSTEM_NAME "Darwin")
elseif(ZIG_OS STREQUAL "freestanding")
set(CMAKE_SYSTEM_NAME "Generic")
else() else()
message(WARNING "Unknown OS: ${ZIG_OS}") # NOTE: If this happens, add a new case with one of the following system names:
# https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_NAME.html#system-names-known-to-cmake
message(FATAL_ERROR "Unknown OS: ${ZIG_OS}")
endif() endif()
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)