File tree Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,18 @@ use filenames::*;
36
36
37
37
fn main ( ) {
38
38
r2r_common:: print_cargo_watches ( ) ;
39
+ // Declare all the custom cfg directives we use
40
+ // to silence cargo warnings.
41
+ r2r_common:: print_cargo_used_cfgs ( & [
42
+ "r2r__rosgraph_msgs__msg__Clock" ,
43
+ "r2r__action_msgs__msg__GoalStatus" ,
44
+ "r2r__test_msgs__msg__Defaults" ,
45
+ "r2r__test_msgs__msg__Arrays" ,
46
+ "r2r__test_msgs__msg__WStrings" ,
47
+ "r2r__example_interfaces__srv__AddTwoInts" ,
48
+ "r2r__std_srvs__srv__Empty" ,
49
+ "r2r__example_interfaces__action__Fibonacci" ,
50
+ ] ) ;
39
51
r2r_common:: print_cargo_ros_distro ( ) ;
40
52
41
53
let out_dir = PathBuf :: from ( env:: var_os ( "OUT_DIR" ) . unwrap ( ) ) ;
Original file line number Diff line number Diff line change @@ -150,6 +150,19 @@ pub fn print_cargo_ros_distro() {
150
150
}
151
151
}
152
152
153
+ pub fn print_cargo_used_cfgs ( message_cfgs : & [ & str ] ) {
154
+ // Declare all supported ros distros as cfg directives for cargo
155
+ for d in SUPPORTED_ROS_DISTROS {
156
+ println ! ( "cargo::rustc-check-cfg=cfg(r2r__ros__distro__{d})" ) ;
157
+ }
158
+
159
+ // additionally we have conditional tests and features based on some
160
+ // optional ros message packages.
161
+ for c in message_cfgs {
162
+ println ! ( "cargo::rustc-check-cfg=cfg({c})" ) ;
163
+ }
164
+ }
165
+
153
166
pub fn print_cargo_link_search ( ) {
154
167
let ament_prefix_var_name = "AMENT_PREFIX_PATH" ;
155
168
if let Some ( paths) = env:: var_os ( ament_prefix_var_name) {
Original file line number Diff line number Diff line change 3
3
#![ allow( non_snake_case) ]
4
4
#![ allow( improper_ctypes) ]
5
5
#![ allow( dead_code) ]
6
+ // Silence "`extern` fn uses type `u128`, which is not FFI-safe"
7
+ // As of rustc 1.78, this has been fixed.
8
+ // It could be good to still warn if building with an older rust version.
9
+ #![ allow( improper_ctypes) ]
6
10
include ! ( concat!( env!( "OUT_DIR" ) , "/rcl_bindings.rs" ) ) ;
7
11
8
12
use std:: ffi:: { CStr , CString } ;
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
# Use the local version of r2r when building the minimal node.
4
+ rm /r2r/r2r_minimal_node/r2r_minimal_node/Cargo.lock
4
5
cat >> /r2r/r2r_minimal_node/r2r_minimal_node/Cargo.toml << EOF
5
6
6
7
[patch.crates-io]
You can’t perform that action at this time.
0 commit comments