build.rs: Skip .S files on x86 and x86-64 Windows.

So far .S files are only used on non-x86, non-x86_64 targets. That
will change soon, so prepare for that by filtering them out so that
we don't feed them to MSVC.
This commit is contained in:
Brian Smith 2023-10-02 17:29:51 -07:00
parent 244a1dee00
commit fa6631463c

View File

@ -462,6 +462,19 @@ fn build_c_code(
let core_srcs = sources_for_arch(&target.arch)
.into_iter()
.filter(|p| !is_perlasm(p))
.filter(|p| {
if let Some(extension) = p.extension() {
// We don't (and can't) use any .S on Windows since MSVC and NASM can't assemble
// them.
if extension == "S"
&& (target.arch == X86_64 || target.arch == X86)
&& target.os == WINDOWS
{
return false;
}
}
true
})
.collect::<Vec<_>>();
let test_srcs = RING_TEST_SRCS.iter().map(PathBuf::from).collect::<Vec<_>>();