Move RUST_TARGET setup to easy-settings.cmake.

RustAddLibrary was setting RUST_TARGET to a fixed string with a potential
override by the caller. The later is not used in our builds so move it
to east-settings.cmake so it can be changed from the cmd line.

Change-Id: I17f16cf8df16e6d7e997091165e8df097f7fcc32
GitOrigin-RevId: 98b687fd600e328cacbaf3c1127eef841d664a92
This commit is contained in:
Sam Leffler
2022-06-07 21:13:17 +00:00
parent a17ea9d0c2
commit 6d8badf052
2 changed files with 2 additions and 5 deletions

View File

@@ -21,11 +21,10 @@ set(CARGO_OPTIONS
# lib_name: Name of library that is created
# SOURCE_DIR: source directory of cargo project
# BUILD_DIR: directory for cargo build output
# TARGET: custom target to use. See in ../rust_targets/ for list of available targets.
# LIB_FILENAME: filename of library created by cargo
# DEPENDS: And target or file dependencies that need to be run before cargo
function(RustAddLibrary lib_name)
cmake_parse_arguments(PARSE_ARGV 1 RUST "" "SOURCE_DIR;BUILD_DIR;TARGET;LIB_FILENAME" "DEPENDS")
cmake_parse_arguments(PARSE_ARGV 1 RUST "" "SOURCE_DIR;BUILD_DIR;LIB_FILENAME" "DEPENDS")
if(NOT "${RUST_UNPARSED_ARGUMENTS}" STREQUAL "")
message(FATAL_ERROR "Unknown arguments to RustAddLibrary ${RUST_UNPARSED_ARGUMENTS}")
endif()
@@ -38,9 +37,6 @@ function(RustAddLibrary lib_name)
if("${RUST_BUILD_DIR}" STREQUAL "")
set(RUST_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})
endif()
if("${RUST_TARGET}" STREQUAL "")
set(RUST_TARGET "riscv32imac-unknown-none-elf")
endif()
if("${RELEASE}")
set(CARGO_RELEASE "--release")

View File

@@ -3,6 +3,7 @@ set(CAMKES_APP "system" CACHE STRING "The one and only CAmkES application in thi
set(CAPDL_LOADER_APP "kata-os-rootserver" CACHE STRING "")
set(PLATFORM "sparrow" CACHE STRING "The one and only seL4 platform for Sparrow")
set(RUST_TARGET "riscv32imac-unknown-none-elf" CACHE STRING "Rust target_arch")
set(KernelSel4Arch "riscv32" CACHE STRING "Specifies 32-bit branch of the seL4 spike platform")
set(KernelIsMCS ON CACHE BOOL "Enable seL4 MCS support")
set(KernelPrinting ON CACHE BOOL "Enable seL4 console output support")