Skip to content
pubscout

native_toolchain_cmake

0.3.2, released 3 months ago by rainyl.dev

A library to invoke and build CMake projects for Dart Native Assets.

$ flutter pub add native_toolchain_cmake
Source repository

What it does

Provides utilities to invoke and build CMake projects specifically for Dart Native Assets. Allows configuring CMake and Ninja versions, as well as Android NDK discovery through pubspec.yaml hooks.

AI-written summary of version 0.3.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are building Dart Native Assets that require compiling a CMake project.
  • You need to configure custom CMake, Ninja, or Android NDK versions for your native builds via pubspec.yaml.

Skip it when

  • Your project does not use Dart Native Assets or CMake.
  • You want an established, stable toolchain library and wish to avoid experimental features.

Strengths

  • Simplifies integrating CMake projects into Dart Native Assets workflows.
  • Supports fine-grained configuration for Android, iOS, Windows, Linux, and macOS in pubspec.yaml.

Weaknesses

  • Explicitly marked as experimental and may change without warning.
  • Relies on external tools like CMake and Ninja being properly configured or discoverable.

Setup

Kind
Pure Dart
Effort
Medium
Code generation
No
Direct dependencies
8

Requires configuring hooks and user defines in pubspec.yaml, along with having CMake and Ninja or appropriate NDK paths set up for target platforms.

hooks:
  user_defines:
    YOUR_PACKAGE_NAME:
      cmake_version: "3.22.1"
      ninja_version: "1.10.2"

Alternatives

Packages that do the same job and could replace native_toolchain_cmake.

  • flutter_olm

    Builds the native Olm library for Android and iOS to be used via dart:ffi.

Works with

Packages commonly used together with native_toolchain_cmake: ones it builds on, ones built on it, and its own family.