cfg dep detection

This commit is contained in:
stelzo 2024-05-20 16:27:58 +02:00
parent 67a5879ad2
commit 3437f26c94
No known key found for this signature in database
GPG Key ID: FC4EF89052319374
10 changed files with 13 additions and 18 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"]

View File

@ -32,7 +32,7 @@ pub struct TimeMsg {
pub nanosec: u32,
}
#[cfg(feature = "rosrust_msg")]
#[cfg(rosrust)]
impl From<rosrust::Time> 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<r2r::sensor_msgs::msg::PointCloud2> for crate::PointCloud2Msg {
fn from(msg: r2r::sensor_msgs::msg::PointCloud2) -> Self {
Self {
@ -113,7 +113,7 @@ impl From<r2r::sensor_msgs::msg::PointCloud2> for crate::PointCloud2Msg {
}
}
#[cfg(feature = "r2r_msg")]
#[cfg(r2r)]
impl From<crate::PointCloud2Msg> for r2r::sensor_msgs::msg::PointCloud2 {
fn from(msg: crate::PointCloud2Msg) -> Self {
r2r::sensor_msgs::msg::PointCloud2 {
@ -151,7 +151,7 @@ impl From<crate::PointCloud2Msg> for r2r::sensor_msgs::msg::PointCloud2 {
}
}
#[cfg(feature = "rosrust_msg")]
#[cfg(rosrust)]
impl From<rosrust_msg::sensor_msgs::PointCloud2> for crate::PointCloud2Msg {
fn from(msg: rosrust_msg::sensor_msgs::PointCloud2) -> Self {
Self {
@ -194,7 +194,7 @@ impl From<rosrust_msg::sensor_msgs::PointCloud2> for crate::PointCloud2Msg {
}
}
#[cfg(feature = "rosrust_msg")]
#[cfg(rosrust)]
impl From<crate::PointCloud2Msg> for rosrust_msg::sensor_msgs::PointCloud2 {
fn from(msg: crate::PointCloud2Msg) -> Self {
rosrust_msg::sensor_msgs::PointCloud2 {

View File

@ -1,4 +1,4 @@
#[cfg(feature = "r2r_msg")]
#[cfg(r2r)]
#[test]
fn convertxyz_r2r_msg() {
use ros_pointcloud2::{points::PointXYZ, PointCloud2Msg};

View File

@ -1,4 +1,4 @@
#[cfg(feature = "rosrust_msg")]
#[cfg(rosrust)]
#[test]
fn convertxyz_rosrust_msg() {
use ros_pointcloud2::{points::PointXYZ, PointCloud2Msg};