diff --git a/flake.nix b/flake.nix index d3744d7..708b5d4 100644 --- a/flake.nix +++ b/flake.nix @@ -69,6 +69,9 @@ cargo = rust-toolchains.stable; rustc = rust-toolchains.stable; }); + + SEL4_ADDITIONAL_CMAKE_FLAGS = "-DCROSS_COMPILER_PREFIX=arm-none-eabihf-"; + in rec { @@ -186,6 +189,8 @@ pkgs.nixpkgs-fmt # formatting nix files pkgs.nodePackages.prettier # prettifier for MarkDown and YAML ]; + + inherit SEL4_ADDITIONAL_CMAKE_FLAGS; }; }; diff --git a/sel4-sys/build.rs b/sel4-sys/build.rs index 49e7bf1..213d211 100644 --- a/sel4-sys/build.rs +++ b/sel4-sys/build.rs @@ -147,6 +147,11 @@ fn cmake_config(config: SeL4Config, build_dir: impl AsRef) -> Result<()> { args.append(&mut config.get_cmake_args()); + // allows user overrides to the build script + if let Ok(flags) = std::env::var("SEL4_ADDITIONAL_CMAKE_FLAGS") { + args.push(flags); + } + let output = cmd("cmake", args).read()?; for line in output.lines() {