Don't assume that Windows is building on MSVC

The flag /utf-8 is supported by cl.exe, but gcc.exe interprets it as a
non-existent linker script.
pull/381/head
Wilfred Hughes 2022-09-18 15:07:39 +07:00
parent 17ec5de754
commit f71ce08407
2 changed files with 5 additions and 1 deletions

@ -1,5 +1,9 @@
## 0.37 (unreleased) ## 0.37 (unreleased)
### Build
Fixed an issue with building on Windows with gcc.
## 0.36.1 (released 17th September 2022) ## 0.36.1 (released 17th September 2022)
Fixed a release script that prevented 0.36.0 from including Windows Fixed a release script that prevented 0.36.0 from including Windows

@ -107,7 +107,7 @@ impl TreeSitterParser {
} }
let mut build = cc::Build::new(); let mut build = cc::Build::new();
if cfg!(windows) { if cfg!(target_env = "msvc") {
build.flag("/utf-8"); build.flag("/utf-8");
} }
build.include(&dir).warnings(false); // ignore unused parameter warnings build.include(&dir).warnings(false); // ignore unused parameter warnings