Skip to content

Commit

Permalink
Correct INCLUDE for msvc builds
Browse files Browse the repository at this point in the history
This ensures the `INCLUDE` variable is always set for MSVC builds, even if the build environment does not define it, so that it correctly builds in non-cross-build contexts without an `INCLUDE` variable from the environment.
  • Loading branch information
mdekstrand authored Jul 7, 2023
1 parent 7cab761 commit d930ae9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libffi-sys-rs/build/msvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ pub fn pre_process_asm(include_dirs: &[&str], target: &str, target_arch: &str) -
};

let mut cmd = cc::windows_registry::find(target, "cl.exe").expect("Could not locate cl.exe");
cmd.env("INCLUDE", include_dirs.join(";"));

// When cross-compiling we should provide MSVC includes as part of the INCLUDE env.var
let build = cc::Build::new();
Expand Down

0 comments on commit d930ae9

Please sign in to comment.