Skip to content

Commit

Permalink
[ffigen] Search dylib in conda env path
Browse files Browse the repository at this point in the history
  • Loading branch information
lindeer committed Dec 29, 2023
1 parent 985ddd0 commit 9da1d6c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkgs/ffigen/lib/src/config_provider/spec_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,17 @@ Headers headersExtractor(
/// error and throws an Exception if not found.
String findDylibAtDefaultLocations() {
String? k;
final condaEnvPath = Platform.environment['CONDA_PREFIX'] ?? '';
if (condaEnvPath.isNotEmpty) {
final localtions = [
p.join(condaEnvPath, 'lib'),
p.join(p.dirname(p.dirname(condaEnvPath)), 'lib'),
];
for (final l in localtions) {
k = findLibclangDylib(l);
if (k != null) return k;
}
}
if (Platform.isLinux) {
for (final l in strings.linuxDylibLocations) {
k = findLibclangDylib(l);
Expand Down

0 comments on commit 9da1d6c

Please sign in to comment.