@@ -230,12 +230,12 @@ else()
230230 set (RUST_PROFILE "release" )
231231 set (RUST_CARGO_FLAGS "--release" )
232232 # For binary reproducibility, strip path prefixes that can be different depending on environment (e.g. /home/<user>, etc.).
233- string (APPEND RUSTFLAGS " --remap-path-prefix=${CMAKE_CURRENT_SOURCE_DIR} /rust=src --remap-path-prefix=$ENV{HOME} =" )
233+ string (JOIN " " RUSTFLAGS "${RUSTFLAGS} " " --remap-path-prefix=${CMAKE_CURRENT_SOURCE_DIR} /rust=src" " --remap-path-prefix=$ENV{HOME} =" )
234234endif ()
235235
236236# Use libsecp256k1 that we link ourselves.
237237# See https://github.com/rust-bitcoin/rust-secp256k1/tree/7c8270a8506e31731e540fab7ee1abde1f48314e/secp256k1-sys#linking-to-external-symbols
238- string (APPEND RUSTFLAGS " --cfg=rust_secp_no_symbol_renaming" )
238+ string (JOIN " " RUSTFLAGS "${RUSTFLAGS} " " --cfg=rust_secp_no_symbol_renaming" )
239239
240240if (CMAKE_CROSSCOMPILING )
241241 set (RUST_TARGET_ARCH thumbv7em-none-eabi)
@@ -284,7 +284,7 @@ add_custom_target(rust-cbindgen
284284
285285# Test rust crates that contain business logic. Avoid testing crates that depend on hardware.
286286if (NOT CMAKE_CROSSCOMPILING )
287- set (RUSTFLAGS_TESTS ${RUSTFLAGS} -L${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -lsecp256k1 -lstatic=fatfs)
287+ set (RUSTFLAGS_TESTS " ${RUSTFLAGS} -L${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -lsecp256k1 -lstatic=fatfs" )
288288
289289 # Since we build with all features we need to use a separate build directory.
290290 # Otherwise we invalidate the result from the normal compilation that uses a
@@ -295,7 +295,7 @@ if(NOT CMAKE_CROSSCOMPILING)
295295 CMAKE_SYSROOT=${CMAKE_SYSROOT}
296296 CMAKE_CURRENT_BINARY_DIR =${CMAKE_CURRENT_BINARY_DIR}
297297 FIRMWARE_VERSION_SHORT=${FIRMWARE_VERSION}
298- RUSTFLAGS=" ${RUSTFLAGS_TESTS} "
298+ RUSTFLAGS=${RUSTFLAGS_TESTS}
299299 # only one test thread because of unsafe concurrent access to `SafeData`, `mock_sd()` and `mock_memory()`. Using mutexes instead leads to mutex poisoning and very messy output in case of a unit test failure.
300300 ${CARGO}
301301 test
0 commit comments