native_toolchain_c
0.19.6, released 14 days ago by labs.dart.dev
Invoke the native C compiler installed on the host machine.
What it does
A library designed to invoke the native C compiler installed on the host machine. It provides tools such as CBuilder and CLinker to compile sources and link binaries.
AI-written summary of version 0.19.6, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to build and compile native C or C++ code as part of your Dart/Flutter build process.
- You are using native assets/hooks to build C libraries on the host machine.
Skip it when
- You are looking for a stable, non-experimental library (this is currently experimental under labs.dart.dev).
- You are developing pure Dart applications without native C dependencies.
Strengths
- Supports multiple platforms including Android, iOS, Windows, macOS, and Linux.
- Allows mocking file systems and process invocations for tests via package:file and package:process.
- Handles complex build scenarios like MSVC environments and linker options.
Weaknesses
- Currently experimental with a high expected rate of API and breaking changes.
- Published under labs.dart.dev with uncertain long-term graduation or discontinuation status.
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 8
Requires native C compilers to be installed on the host machine (such as MSVC on Windows, Xcode on macOS/iOS, or GCC/Clang on Linux/Android).
not documentedAlternatives
Packages that do the same job and could replace native_toolchain_c.
- jnigen
A Dart bindings generator for Java and Kotlin APIs using JNI and dart:ffi.
87Compare - objective_c
Support library for accessing Objective C via ffigen in Flutter
90Compare
Works with
Packages commonly used together with native_toolchain_c: ones it builds on, ones built on it, and its own family.
- pub_semvernative_toolchain_c depends on itVersions and version constraints implementing pub's versioning policy.
- globnative_toolchain_c depends on itA file and directory globbing library that supports Bash-style path matching and listing.
- hooksnative_toolchain_c depends on itDart API for the JSON-based protocol for package build and link hooks.
- code_assetsnative_toolchain_c depends on itProvides the hook protocol specification for bundling native code with Dart packages.
- processnative_toolchain_c depends on itPluggable, mockable process invocation abstraction for Dart.
- filenative_toolchain_c depends on itPluggable, mockable file system abstraction for Dart with in-memory support.
- loggingnative_toolchain_c depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- native_synchronizationSame familyProvides low‑level thread synchronization primitives (Mutex, ConditionVariable, Mailbox) via dart:ffi.