From 3437f26c94df259a549e32633dde353240948f98 Mon Sep 17 00:00:00 2001 From: stelzo Date: Mon, 20 May 2024 16:27:58 +0200 Subject: [PATCH] cfg dep detection --- .github/workflows/r2r_galactic.yml | 2 +- .github/workflows/r2r_humble.yml | 2 +- .github/workflows/r2r_iron.yml | 2 +- .github/workflows/rclrs_humble.yml | 2 +- .github/workflows/rclrs_iron.yml | 2 +- .github/workflows/rosrust_noetic.yml | 2 +- rpcl2/Cargo.toml | 5 ----- rpcl2/src/ros.rs | 10 +++++----- rpcl2/tests/r2r_msg_test.rs | 2 +- rpcl2/tests/rosrust_msg_test.rs | 2 +- 10 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/r2r_galactic.yml b/.github/workflows/r2r_galactic.yml index ae0ec96..c58e3fc 100644 --- a/.github/workflows/r2r_galactic.yml +++ b/.github/workflows/r2r_galactic.yml @@ -18,4 +18,4 @@ jobs: steps: - uses: actions/checkout@v2 - run: docker build . --file ./rpcl2/tests/Dockerfile_r2r_galactic --tag r2r_galactic - - run: docker run r2r_galactic cargo test --features r2r_msg,derive,nalgebra,rayon + - run: docker run r2r_galactic cargo test diff --git a/.github/workflows/r2r_humble.yml b/.github/workflows/r2r_humble.yml index aa2ec11..a3d3e2e 100644 --- a/.github/workflows/r2r_humble.yml +++ b/.github/workflows/r2r_humble.yml @@ -18,4 +18,4 @@ jobs: steps: - uses: actions/checkout@v2 - run: docker build . --file ./rpcl2/tests/Dockerfile_r2r_humble --tag r2r_humble - - run: docker run r2r_humble cargo test --features r2r_msg,derive,nalgebra,rayon + - run: docker run r2r_humble cargo test diff --git a/.github/workflows/r2r_iron.yml b/.github/workflows/r2r_iron.yml index 61db09e..71242b8 100644 --- a/.github/workflows/r2r_iron.yml +++ b/.github/workflows/r2r_iron.yml @@ -18,4 +18,4 @@ jobs: steps: - uses: actions/checkout@v2 - run: docker build . --file ./rpcl2/tests/Dockerfile_r2r_iron --tag r2r_iron - - run: docker run r2r_iron cargo test --features r2r_msg,derive,nalgebra,rayon + - run: docker run r2r_iron cargo test diff --git a/.github/workflows/rclrs_humble.yml b/.github/workflows/rclrs_humble.yml index 6102b2e..9a84d99 100644 --- a/.github/workflows/rclrs_humble.yml +++ b/.github/workflows/rclrs_humble.yml @@ -18,4 +18,4 @@ jobs: steps: - uses: actions/checkout@v2 - run: docker build . --file ./rpcl2/tests/Dockerfile_rclrs_humble --tag rclrs_humble - - run: docker run rclrs_humble cargo test --features derive,nalgebra,rayon + - run: docker run rclrs_humble cargo test diff --git a/.github/workflows/rclrs_iron.yml b/.github/workflows/rclrs_iron.yml index 0259f63..511c9b6 100644 --- a/.github/workflows/rclrs_iron.yml +++ b/.github/workflows/rclrs_iron.yml @@ -18,4 +18,4 @@ jobs: steps: - uses: actions/checkout@v2 - run: docker build . --file ./rpcl2/tests/Dockerfile_rclrs_iron --tag rclrs_iron - - run: docker run rclrs_iron cargo test --features derive,nalgebra,rayon + - run: docker run rclrs_iron cargo test diff --git a/.github/workflows/rosrust_noetic.yml b/.github/workflows/rosrust_noetic.yml index bbf6403..a1ab3e8 100644 --- a/.github/workflows/rosrust_noetic.yml +++ b/.github/workflows/rosrust_noetic.yml @@ -105,4 +105,4 @@ jobs: - name: test run: | source /opt/ros/$ROS_DISTRO/setup.bash - cargo test --features rosrust_msg,derive,nalgebra,rayon + cargo test diff --git a/rpcl2/Cargo.toml b/rpcl2/Cargo.toml index d79577b..5b47d80 100644 --- a/rpcl2/Cargo.toml +++ b/rpcl2/Cargo.toml @@ -31,9 +31,6 @@ exclude = [ rust-version = "1.63" [dependencies] -rosrust_msg = { version = "0.1", optional = true } -rosrust = { version = "0.9.11", optional = true } -r2r = { version = "0.9.0", optional = true } rayon = { version = "1", optional = true } nalgebra = { version = "0.32.5", optional = true, default-features = false } rpcl2-derive = { version = "0.2.0", optional = true, path = "../rpcl2-derive" } @@ -49,8 +46,6 @@ harness = false path = "benches/roundtrip.rs" [features] -rosrust_msg = ["dep:rosrust_msg", "dep:rosrust"] -r2r_msg = ["dep:r2r"] rayon = ["dep:rayon"] derive = ["dep:rpcl2-derive", "dep:memoffset"] nalgebra = ["dep:nalgebra"] diff --git a/rpcl2/src/ros.rs b/rpcl2/src/ros.rs index b2b395b..1c61b51 100644 --- a/rpcl2/src/ros.rs +++ b/rpcl2/src/ros.rs @@ -32,7 +32,7 @@ pub struct TimeMsg { pub nanosec: u32, } -#[cfg(feature = "rosrust_msg")] +#[cfg(rosrust)] impl From for TimeMsg { fn from(time: rosrust::Time) -> Self { Self { @@ -70,7 +70,7 @@ impl Default for PointFieldMsg { } } -#[cfg(feature = "r2r_msg")] +#[cfg(r2r)] impl From for crate::PointCloud2Msg { fn from(msg: r2r::sensor_msgs::msg::PointCloud2) -> Self { Self { @@ -113,7 +113,7 @@ impl From for crate::PointCloud2Msg { } } -#[cfg(feature = "r2r_msg")] +#[cfg(r2r)] impl From for r2r::sensor_msgs::msg::PointCloud2 { fn from(msg: crate::PointCloud2Msg) -> Self { r2r::sensor_msgs::msg::PointCloud2 { @@ -151,7 +151,7 @@ impl From for r2r::sensor_msgs::msg::PointCloud2 { } } -#[cfg(feature = "rosrust_msg")] +#[cfg(rosrust)] impl From for crate::PointCloud2Msg { fn from(msg: rosrust_msg::sensor_msgs::PointCloud2) -> Self { Self { @@ -194,7 +194,7 @@ impl From for crate::PointCloud2Msg { } } -#[cfg(feature = "rosrust_msg")] +#[cfg(rosrust)] impl From for rosrust_msg::sensor_msgs::PointCloud2 { fn from(msg: crate::PointCloud2Msg) -> Self { rosrust_msg::sensor_msgs::PointCloud2 { diff --git a/rpcl2/tests/r2r_msg_test.rs b/rpcl2/tests/r2r_msg_test.rs index 78b924a..016cf77 100644 --- a/rpcl2/tests/r2r_msg_test.rs +++ b/rpcl2/tests/r2r_msg_test.rs @@ -1,4 +1,4 @@ -#[cfg(feature = "r2r_msg")] +#[cfg(r2r)] #[test] fn convertxyz_r2r_msg() { use ros_pointcloud2::{points::PointXYZ, PointCloud2Msg}; diff --git a/rpcl2/tests/rosrust_msg_test.rs b/rpcl2/tests/rosrust_msg_test.rs index 2e7c795..845efed 100644 --- a/rpcl2/tests/rosrust_msg_test.rs +++ b/rpcl2/tests/rosrust_msg_test.rs @@ -1,4 +1,4 @@ -#[cfg(feature = "rosrust_msg")] +#[cfg(rosrust)] #[test] fn convertxyz_rosrust_msg() { use ros_pointcloud2::{points::PointXYZ, PointCloud2Msg};