Skip to content

Commit

Permalink
fix #1: allow injection of CMake flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Wanja Zaeske committed Sep 18, 2023
1 parent 1d9e4fd commit 7f97971
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
cargo = rust-toolchains.stable;
rustc = rust-toolchains.stable;
});

SEL4_ADDITIONAL_CMAKE_FLAGS = "-DCROSS_COMPILER_PREFIX=arm-none-eabihf-";

in
rec {

Expand Down Expand Up @@ -186,6 +189,8 @@
pkgs.nixpkgs-fmt # formatting nix files
pkgs.nodePackages.prettier # prettifier for MarkDown and YAML
];

inherit SEL4_ADDITIONAL_CMAKE_FLAGS;
};
};

Expand Down
5 changes: 5 additions & 0 deletions sel4-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ fn cmake_config(config: SeL4Config, build_dir: impl AsRef<Path>) -> 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() {
Expand Down

0 comments on commit 7f97971

Please sign in to comment.