Skip to content

Commit

Permalink
Support for zenoh features (#715)
Browse files Browse the repository at this point in the history
* add support for zenoh features

* overwrite cmake feature flags if cargo feature flags are different

* remove transport_unixsock-stream from default

* run clippy only without default features

* simplify cargo flags feature checks in cmake
  • Loading branch information
DenisBiryukov91 authored Sep 25, 2024
1 parent 2d47715 commit 4935f8f
Show file tree
Hide file tree
Showing 11 changed files with 1,091 additions and 566 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
- name: Install Rust toolchain
run: rustup component add rustfmt clippy

- name: Run clippy
run: cargo clippy --all-targets --all-features -- --deny warnings
- name: Run clippy without default features
run: cargo clippy --all-targets --no-default-features --features unstable,shared-memory -- --deny warnings

- name: Run rustfmt
run: cargo fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate"
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,16 @@ set(cargo_flags ${cargo_flags} ${ZENOHC_CARGO_FLAGS})

if(ZENOHC_BUILD_WITH_SHARED_MEMORY)
set(cargo_flags ${cargo_flags} --features=shared-memory)
elseif("${cargo_flags}" MATCHES ^.*shared-memory.*$)
set(ZENOHC_BUILD_WITH_SHARED_MEMORY TRUE)
message(STATUS "Due to ZENOHC_CARGO_FLAGS setting ZENOHC_BUILD_WITH_SHARED_MEMORY = TRUE")
endif()

if(ZENOHC_BUILD_WITH_UNSTABLE_API)
set(cargo_flags ${cargo_flags} --features=unstable)
elseif("${cargo_flags}" MATCHES ^.*unstable.*$)
set(ZENOHC_BUILD_WITH_UNSTABLE_API TRUE)
message(STATUS "Due to ZENOHC_CARGO_FLAGS setting ZENOHC_BUILD_WITH_UNSTABLE_API = TRUE")
endif()


Expand Down
Loading

0 comments on commit 4935f8f

Please sign in to comment.