[ffigen] Detect Scoop LLVM installation on Windows (#535)
diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index d507dde..6dd3b69 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md
@@ -1,3 +1,7 @@ +# 7.2.9 + +- Detect LLVM installed using Scoop on Windows machines. + # 7.2.8 - Automatically generate `ignore_for_file: type=lint` if not specified in preamble.
diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 9b03ebb..dfe6bbf 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart
@@ -495,7 +495,13 @@ } } } else if (Platform.isWindows) { - for (final l in strings.windowsDylibLocations) { + final dylibLocations = strings.windowsDylibLocations.toList(); + final userHome = Platform.environment['USERPROFILE']; + if (userHome != null) { + dylibLocations + .add(p.join(userHome, 'scoop', 'apps', 'llvm', 'current', 'bin')); + } + for (final l in dylibLocations) { k = findLibclangDylib(l); if (k != null) return k; }
diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 4f647fb..e9ef8be 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml
@@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.8 +version: 7.2.9 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen