File tree 2 files changed +19
-1
lines changed 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ must be passed to change this behaviour.
7
7
- __ Breaking change__ : Stop generating setters for global variables marked ` const ` in C.
8
8
- Fix objc_msgSend being used on arm64 platforms where it's not available.
9
9
- Fix missing comma with ` ffi-native ` functions marked ` leaf ` .
10
+ - Add support for finding libclang in Conda environment.
10
11
11
12
## 10.0.0
12
13
Original file line number Diff line number Diff line change @@ -305,10 +305,27 @@ Headers headersExtractor(
305
305
);
306
306
}
307
307
308
+ String ? _findLibInConda () {
309
+ final condaEnvPath = Platform .environment['CONDA_PREFIX' ] ?? '' ;
310
+ if (condaEnvPath.isNotEmpty) {
311
+ final locations = [
312
+ p.join (condaEnvPath, 'lib' ),
313
+ p.join (p.dirname (p.dirname (condaEnvPath)), 'lib' ),
314
+ ];
315
+ for (final l in locations) {
316
+ final k = findLibclangDylib (l);
317
+ if (k != null ) return k;
318
+ }
319
+ }
320
+ return null ;
321
+ }
322
+
308
323
/// Returns location of dynamic library by searching default locations. Logs
309
324
/// error and throws an Exception if not found.
310
325
String findDylibAtDefaultLocations () {
311
- String ? k;
326
+ // Assume clang in conda has a higher priority.
327
+ var k = _findLibInConda ();
328
+ if (k != null ) return k;
312
329
if (Platform .isLinux) {
313
330
for (final l in strings.linuxDylibLocations) {
314
331
k = findLibclangDylib (l);
You can’t perform that action at this time.
0 commit comments