Skip to content

Commit

Permalink
Don't links="riot-sys" any more
Browse files Browse the repository at this point in the history
The CC/CFLAGS are thus not exported any more (riot-wrappers doesn't need
them since [79]), and the modules list is not neede any more because it
was only taken in to be forwarded.

[79]: RIOT-OS/rust-riot-wrappers#79
  • Loading branch information
chrysn committed Jan 31, 2024
1 parent 833a533 commit 0248e7d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ keywords = ["riot", "riot-os", "iot", "bindings"]
categories = ["external-ffi-bindings", "no-std"]
license = "LGPL-2.1"

links = "riot-sys"

[dependencies]
cty = "^0.2"
c2rust-asm-casts = "0.2"
Expand Down
35 changes: 0 additions & 35 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,41 +123,6 @@ fn main() {
cflags = shlex::try_join(consensus_cflag_groups.unwrap().iter().flatten().map(|s| *s))
.expect("Input is not expected to contain NUL characters");

let usemodule = {
#[cfg(not(feature = "riot-rs"))]
{
println!("cargo:rerun-if-env-changed=RIOT_USEMODULE");
env::var("RIOT_USEMODULE").expect(&format!(
"RIOT_USEMODULE is required when {} is given",
&compile_commands_json,
))
}
#[cfg(feature = "riot-rs")]
{
println!("cargo:rerun-if-env-changed=DEP_RIOT_BUILD_DIR");
let riot_builddir = env::var("DEP_RIOT_BUILD_DIR").expect("DEP_RIOT_BUILD_DIR unset?");
get_riot_var(&riot_builddir, "USEMODULE")
}
};

for m in usemodule.split(" ") {
// Hack around https://github.com/RIOT-OS/RIOT/pull/16129#issuecomment-805810090
write!(
cflags,
" -DMODULE_{}",
m.to_uppercase()
// avoid producing MODULE_BOARDS_COMMON_SAMDX1-ARDUINO-BOOTLOADER
.replace('-', "_")
)
.unwrap();
}

// pass CC and CFLAGS to dependees
// this requires a `links = "riot-sys"` directive in Cargo.toml.
// Dependees can then access these as DEP_RIOT_SYS_CC and DEP_RIOT_SYS_CFLAGS.
println!("cargo:CC={}", &cc);
println!("cargo:CFLAGS={}", &cflags);

println!("cargo:rerun-if-changed=riot-bindgen.h");

let cflags = shlex::split(&cflags).expect("Odd shell escaping in RIOT_CFLAGS");
Expand Down

0 comments on commit 0248e7d

Please sign in to comment.