Files
MINGW-packages/mingw-w64-tree-sitter/rquickjs-sys-clang-build.patch
2025-09-22 00:24:35 +03:00

20 lines
586 B
Diff

--- a/build.rs
+++ b/build.rs
@@ -300,10 +300,16 @@ where
K: AsRef<str> + 'a,
V: AsRef<str> + 'a,
{
- let target = env::var("TARGET").unwrap();
+ let mut target = env::var("TARGET").unwrap();
let out_dir = out_dir.as_ref();
let header_file = header_file.as_ref();
+ // *-pc-windows-gnullvm is special for Rust, Clang accepts only
+ // *-pc-windows-gnu
+ if target.ends_with("windows-gnullvm") {
+ target = target.replace("llvm", "");
+ }
+
let mut cflags = vec![format!("--target={}", target)];
cflags.append(&mut add_cflags);