Commit d98eae8c authored by David Brown's avatar David Brown Committed by David Brown
Browse files

rust: zephyr-sys: Use absolute path for wrapper

Change the header passed into bindgen to be an absolute path.  This will
cause the generated wrapper to refer to this file also using an absolute
path.  As such, remove the explicit include path added as part of the
build.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent c440acd3
Loading
Loading
Loading
Loading
+0 −4
Changes for cmake/modules/rust.cmake: 0 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -178,8 +178,4 @@ ${config_paths}
  # Presumably, Rust applications will have no C source files, but cmake will require them.
  # Add an empty file so that this will build.  The main will come from the rust library.
  target_sources(app PRIVATE ${ZEPHYR_BASE}/lib/rust/main.c ${WRAPPER_FILE})
  set_source_files_properties(
    ${WRAPPER_FILE}
    COMPILE_FLAGS "-I${ZEPHYR_BASE}/lib/rust/zephyr-sys"
  )
endfunction()
+2 −2
Changes for lib/rust/zephyr-sys/build.rs: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ use anyhow::Result;
use bindgen::Builder;

use std::env;
use std::path::PathBuf;
use std::path::{Path, PathBuf};

fn main() -> Result<()> {
    // Pass in the target used to build the native code.
@@ -30,7 +30,7 @@ fn main() -> Result<()> {

    // Bindgen everything.
    let bindings = Builder::default()
        .header("wrapper.h")
        .header(Path::new("wrapper.h").canonicalize().unwrap().to_str().unwrap())
        .use_core()
        .clang_arg(&target_arg);
    let bindings = define_args(bindings, "-I", "INCLUDE_DIRS");