dart-lang / dart-lang/native

Abstract Apple platforms in ffigen config

Open
#1,509 0 comments 0 reactions 0 assignees View on GitHub
lang-objective_c package:ffigen
Dominant language
Dart
Stars
275
Forks
144
Avg merge
2d 10h
Merged PRs (30d)
47

Description

Currently to write Dart code that will run on both iOS and macOS and uses a system SDK that supports both, I have to pick one of the two platforms arbitrarily to list header entry points for, as the paths are platform-specific. E.g.: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Versions/A/Headers/AVFoundation.h

It would be nice to be able to put a placeholder in place of the whole platform-specific sub-path, and then list the platforms in the config via something like:

```yaml
headers:
platforms:
- ios
- macos
entry-points:
...
```

and have ffigen create the necessary paths for both and then merge the output of using both.

(See also https://github.com/dart-lang/native/issues/471 and https://github.com/dart-lang/native/issues/1469 for related issues.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.