diff --git a/CHANGELOG.md b/CHANGELOG.md index 169ae2dc9..9f06fe513 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.8.2] - UNRELEASED + +### Fixed +- Fixed linking to `libclang` on Windows with MSYS2 + ## [1.8.1] - 2024-05-28 ### Added diff --git a/build/common.rs b/build/common.rs index 696d92339..665347813 100644 --- a/build/common.rs +++ b/build/common.rs @@ -185,6 +185,7 @@ const DIRECTORIES_WINDOWS: &[(&str, bool)] = &[ // system-wide directories. ("C:\\Users\\*\\scoop\\apps\\llvm\\current\\lib", true), ("C:\\MSYS*\\MinGW*\\lib", false), + ("C:\\MSYS*\\clang*\\lib", false), ("C:\\Program Files*\\LLVM\\lib", true), ("C:\\LLVM\\lib", true), // LLVM + Clang can be installed as a component of Visual Studio. diff --git a/build/dynamic.rs b/build/dynamic.rs index d24490f6b..87e32ccf9 100644 --- a/build/dynamic.rs +++ b/build/dynamic.rs @@ -263,8 +263,8 @@ pub fn link() { let name = filename.trim_start_matches("lib"); // Strip extensions and trailing version numbers (e.g., the `.so.7.0` in - // `libclang.so.7.0`). - let name = match name.find(".dylib").or_else(|| name.find(".so")) { + // `libclang.so.7.0`) and also `.dll` for MinGW / MSYS. + let name = match name.find(".dylib").or_else(|| name.find(".so")).or_else(|| name.find(".dll")) { Some(index) => &name[0..index], None => name, };