mirror of
https://github.com/AmbiML/sparrow-kata-full.git
synced 2025-08-01 21:59:41 +00:00
rust.cmake: fix RELEASE handling
Cmake's list operator operates on the current scope so we were not setting --release on the cargo cmd line. Change-Id: I91aa8489869c3190d60c3f2dee374b3d9388ebda GitOrigin-RevId: 36fa241862c1cb94b736be89d09e8127fefdfc4d
This commit is contained in:
parent
2749156acf
commit
4fe71acb97
@ -16,10 +16,6 @@ set(CARGO_OPTIONS
|
|||||||
-Z avoid-dev-deps
|
-Z avoid-dev-deps
|
||||||
CACHE INTERNAL "cargo cmd line arguments")
|
CACHE INTERNAL "cargo cmd line arguments")
|
||||||
|
|
||||||
if("${RELEASE}")
|
|
||||||
list(APPEND CARGO_OPTIONS "--release")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# add_library but for rust libraries. Invokes cargo in the SOURCE_DIR that is provided,
|
# add_library but for rust libraries. Invokes cargo in the SOURCE_DIR that is provided,
|
||||||
# all build output is placed in BUILD_DIR or CMAKE_CURRENT_BINARY_DIR if BUILD_DIR isn't provided.
|
# all build output is placed in BUILD_DIR or CMAKE_CURRENT_BINARY_DIR if BUILD_DIR isn't provided.
|
||||||
# lib_name: Name of library that is created
|
# lib_name: Name of library that is created
|
||||||
@ -46,6 +42,10 @@ function(RustAddLibrary lib_name)
|
|||||||
set(RUST_TARGET "riscv32imac-unknown-none-elf")
|
set(RUST_TARGET "riscv32imac-unknown-none-elf")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if("${RELEASE}")
|
||||||
|
set(CARGO_RELEASE "--release")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
${lib_name}_custom
|
${lib_name}_custom
|
||||||
BYPRODUCTS
|
BYPRODUCTS
|
||||||
@ -57,7 +57,7 @@ function(RustAddLibrary lib_name)
|
|||||||
${CMAKE_COMMAND} -E env RUSTFLAGS=${RUSTFLAGS}
|
${CMAKE_COMMAND} -E env RUSTFLAGS=${RUSTFLAGS}
|
||||||
cargo +nightly-2021-08-05 build
|
cargo +nightly-2021-08-05 build
|
||||||
--target ${RUST_TARGET}
|
--target ${RUST_TARGET}
|
||||||
${CARGO_OPTIONS}
|
${CARGO_OPTIONS} ${CARGO_RELEASE}
|
||||||
--target-dir ${RUST_BUILD_DIR}
|
--target-dir ${RUST_BUILD_DIR}
|
||||||
--out-dir ${RUST_BUILD_DIR}
|
--out-dir ${RUST_BUILD_DIR}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user