Fix linkage issue when doc-only feature is on

This commit is contained in:
aeon 2023-06-23 11:31:01 +08:00 committed by Martin Dahl
parent a4d04a5017
commit fd0e9a7291
3 changed files with 22 additions and 32 deletions

View File

@ -53,11 +53,8 @@ fn run_bindgen() {
}
fn run_dynlink() {
#[cfg(not(feature = "doc-only"))]
{
r2r_common::print_cargo_link_search();
println!("cargo:rustc-link-lib=dylib=rcl_action");
}
}
fn generate_bindings(out_file: &Path) {

View File

@ -253,8 +253,6 @@ fn add_constants(key: &str, bindings: &str, constants: &mut HashMap<String, Vec<
}
fn run_dynlink(#[allow(unused_variables)] msg_list: &[RosMsg]) {
#[cfg(not(feature = "doc-only"))]
{
r2r_common::print_cargo_link_search();
let msg_map = r2r_common::as_map(msg_list);
@ -269,7 +267,6 @@ fn run_dynlink(#[allow(unused_variables)] msg_list: &[RosMsg]) {
);
println!("cargo:rustc-link-lib=dylib={}__rosidl_generator_c", module);
}
}
}
fn touch(path: &Path) {

View File

@ -57,9 +57,6 @@ fn run_bindgen() {
}
fn run_dynlink() {
// Run dynamic linking if (1) "docs-only" feature is disabled.
#[cfg(not(feature = "doc-only"))]
{
r2r_common::print_cargo_link_search();
println!("cargo:rustc-link-lib=dylib=rcl");
println!("cargo:rustc-link-lib=dylib=rcl_logging_spdlog");
@ -68,7 +65,6 @@ fn run_dynlink() {
println!("cargo:rustc-link-lib=dylib=rmw");
println!("cargo:rustc-link-lib=dylib=rosidl_typesupport_c");
println!("cargo:rustc-link-lib=dylib=rosidl_runtime_c");
}
}
fn gen_bindings(out_file: &Path) {