From d930ae9b50620b830465b96b38eab9bb73c35b33 Mon Sep 17 00:00:00 2001 From: Michael Ekstrand Date: Fri, 7 Jul 2023 11:42:46 -0600 Subject: [PATCH] Correct INCLUDE for msvc builds 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. --- libffi-sys-rs/build/msvc.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/libffi-sys-rs/build/msvc.rs b/libffi-sys-rs/build/msvc.rs index 51dba9f5..1a884816 100644 --- a/libffi-sys-rs/build/msvc.rs +++ b/libffi-sys-rs/build/msvc.rs @@ -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();