1+ # *******************************************************************************
2+ # Copyright (c) 2026 Contributors to the Eclipse Foundation
3+ #
4+ # See the NOTICE file(s) distributed with this work for additional
5+ # information regarding copyright ownership.
6+ #
7+ # This program and the accompanying materials are made available under the
8+ # terms of the Apache License Version 2.0 which is available at
9+ # https://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # SPDX-License-Identifier: Apache-2.0
12+ # *******************************************************************************
13+
114diff --git a/CHANGELOG.md b/CHANGELOG.md
215index 169ae2d..dd3548f 100644
316--- a/CHANGELOG.md
@@ -14,17 +27,17 @@ index 169ae2d..dd3548f 100644
1427+ when using target-prefixed `clang` binaries
1528+
1629 ## [1.8.1] - 2024-05-28
17-
30+
1831 ### Added
1932@@ -20,8 +30,6 @@
2033 ### Fixed
2134 - Fixed handling of paths that contain characters that have special meaning in
2235 glob patterns (e.g., `[` or `]`)
2336- - Fixed `Clang::find` to support both the `-target` and `--target` arguments
2437- when using target-prefixed `clang` binaries
25-
38+
2639 ## [1.7.0] - 2023-12-31
27-
40+
2841diff --git a/build/common.rs b/build/common.rs
2942index 696d923..6653478 100644
3043--- a/build/common.rs
@@ -43,7 +56,7 @@ index d24490f..87e32cc 100644
4356+++ b/build/dynamic.rs
4457@@ -263,8 +263,8 @@ pub fn link() {
4558 let name = filename.trim_start_matches("lib");
46-
59+
4760 // Strip extensions and trailing version numbers (e.g., the `.so.7.0` in
4861- // `libclang.so.7.0`).
4962- let name = match name.find(".dylib").or_else(|| name.find(".so")) {
@@ -66,7 +79,7 @@ index 58e64b5..87f94ba 100644
6679+ pub(crate) path: PathBuf,
6780 pub functions: Functions,
6881 }
69-
82+
7083diff --git a/src/support.rs b/src/support.rs
7184index 51764d2..2d28b1c 100644
7285--- a/src/support.rs
@@ -91,7 +104,7 @@ index 51764d2..2d28b1c 100644
91104 /// ## Cross-compilation
92105 ///
93106@@ -70,7 +72,7 @@ impl Clang {
94-
107+
95108 let mut target = None;
96109 for i in 0..args.len() {
97110- if (args[i] == "-target" || args[i] == "-target") && i + 1 < args.len() {
@@ -102,7 +115,7 @@ index 51764d2..2d28b1c 100644
102115@@ -83,6 +85,16 @@ impl Clang {
103116 paths.push(path.into());
104117 }
105-
118+
106119+ #[cfg(feature = "runtime")]
107120+ if let Some(library) = crate::get_library() {
108121+ if let Some(directory) = library.path().parent() {
0 commit comments