Skip to content

Commit

Permalink
windows build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Nov 21, 2023
1 parent 008231f commit d21e2c7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,13 @@ set_genexpr_condition(libs DEBUG $<CONFIG:Debug> "${libsd}" "${libsr}")
#
# Build rust sources
#
set_genexpr_condition(cargo_release_flag DEBUG $<CONFIG:Debug> "" "--release")
set(cargo_flags ${ZENOHC_CARGO_FLAGS} ${cargo_release_flag})
set(cargo_flags ${cargo_flags} --manifest-path=${cargo_toml_dir}/Cargo.toml)

# Combine "--release" and "--manifest-path" options under DEBUG condition to avoid passing empty parameter to cargo command line in `add_custom_command`, causing build failure
# This empty item ($<IF:$<CONFIG:Debug>;,--release>) can't be filtered out by `list(FILTER ...)` because it becomes empty only on
# build stage when generator expressions are evaluated.
set_genexpr_condition(cargo_flags DEBUG $<CONFIG:Debug>
"--manifest-path=${cargo_toml_dir}/Cargo.toml"
"--release;--manifest-path=${cargo_toml_dir}/Cargo.toml")

if(ZENOHC_BUILD_WITH_LOGGER_AUTOINIT)
set(cargo_flags ${cargo_flags} --features=logger-autoinit)
Expand Down

0 comments on commit d21e2c7

Please sign in to comment.