Skip to content

[native_assets_cli] Add config.code.flutter.cApi #1836

Open
@dcharkes

Description

@dcharkes

Developers might want to build native code against flutter.h.

To prevent version skew between the package and the Flutter SDK, from-source build should use flutter.h from Flutter itself.
We should provide a path to it in the build config. Something along the lines of

config
  .code
    .flutter
      .cApi
        .headerPath
        .version

(Should flutter-specific code-specific config live under config.flutter.code or config.code.flutter?)

This is analogous to:

To support prebuilt binaries, the version should be taken into account.

Note that this doesn't solve version skew between generated dart:ffi bindings with FFIgen on a flutter.h and then flutter.h getting a breaking change. This could theoretically be solved by providing access to version in Dart (for example via passing in version as a define in a C lib and compiling it in and accessing it via an FFI call, or by writing the version to a data asset and accessing it at runtime), and then branching between two sets of generated bindings. (This is a similar issue to #1589.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions