Skip to content

Commit

Permalink
build: Tolerate absence of RIOT_USEMODULES
Browse files Browse the repository at this point in the history
This is not a breaking change, it just turns what used to be a build.rs
error into a later error (eg. when used with an older riot-wrappers,
that would be missing modules -- but only if the build system suddenly
stopped passing in the variable).

Tolerating the absence allows the build system to phase out passing
dummy values into RIOT_USEMODULES even before [38] is through.

[38]: #38
  • Loading branch information
chrysn committed Feb 1, 2024
1 parent 870cf53 commit 17020f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ fn main() {
#[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,
))
// We tolerate the absence. Older versions of riot-wrappers would then fail to
// enable modules, but newer versions just work without it (and would need a dummy
// variable passed in otherwise). On the long run, this is going away anyway.
env::var("RIOT_USEMODULE").unwrap_or_default()
}
#[cfg(feature = "riot-rs")]
{
Expand Down

0 comments on commit 17020f4

Please sign in to comment.