From f83541a24ca79102c7fb0aa359788618af19be0f Mon Sep 17 00:00:00 2001 From: Kristofer Bengtsson Date: Fri, 27 Mar 2020 18:25:49 +0100 Subject: [PATCH] A fix to better support rust-analyzer and type support. This probably generates a large file to compile, so we need to look into that when we need to --- Cargo.toml | 2 +- build.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c02c636..df4d85a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "r2r" -version = "0.0.1" +version = "0.0.2" authors = ["Martin Dahl "] description = "Minimal ros2 bindings." license = "Apache-2.0/MIT" diff --git a/build.rs b/build.rs index 1b0fbda..ee2402b 100644 --- a/build.rs +++ b/build.rs @@ -26,8 +26,8 @@ fn main() { ); println!("cargo:rustc-link-lib=dylib={}__rosidl_generator_c", module); - - modules.push_str(&format!("pub mod {};\n", module)); + modules.push_str(&format!(r#"pub mod {module}{{include!(concat!(env!("OUT_DIR"), "/{module}.rs"));}}{lf}"#, module=module, lf="\n")); + //modules.push_str(&format!("pub mod {};\n", module)); let mut codegen = String::new(); for (prefix, msgs) in prefixes {