Don't include function pointers when building with cfg doc-only.

This commit is contained in:
Martin Dahl 2023-06-20 08:40:59 +02:00
parent 8142b253da
commit 64bc3dcab6
1 changed files with 9 additions and 2 deletions

View File

@ -84,8 +84,15 @@ fn generate_bindings(bindgen_dir: &Path, msg_list: &[RosMsg]) {
let bindings_file = bindgen_dir.join(BINDINGS_FILENAME); let bindings_file = bindgen_dir.join(BINDINGS_FILENAME);
let mut includes = String::new(); let mut includes = String::new();
let mut introspecion_map = String::from( let mut introspecion_map = String::from("
"\ #[cfg(feature = \"doc-only\")]
lazy_static! {
static ref INTROSPECTION_FNS: HashMap<&'static str, usize> = {
HashMap::new()
};
}
#[cfg(not(feature = \"doc-only\"))]
lazy_static! { lazy_static! {
static ref INTROSPECTION_FNS: HashMap<&'static str, usize> = { static ref INTROSPECTION_FNS: HashMap<&'static str, usize> = {
let mut m = HashMap::new(); let mut m = HashMap::new();