From f71ce084079eb8da836a12aab76b0fc048755ae8 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Sun, 18 Sep 2022 15:07:39 -0700 Subject: [PATCH] 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. --- CHANGELOG.md | 4 ++++ build.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a32ae5643..49b1dfa41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 0.37 (unreleased) +### Build + +Fixed an issue with building on Windows with gcc. + ## 0.36.1 (released 17th September 2022) Fixed a release script that prevented 0.36.0 from including Windows diff --git a/build.rs b/build.rs index 1f44bdf4b..e993f2950 100644 --- a/build.rs +++ b/build.rs @@ -107,7 +107,7 @@ impl TreeSitterParser { } let mut build = cc::Build::new(); - if cfg!(windows) { + if cfg!(target_env = "msvc") { build.flag("/utf-8"); } build.include(&dir).warnings(false); // ignore unused parameter warnings