← ClaudeAtlas

dart-setup-ffi-assetslisted

Guides agents in compiling and packaging C/C++ source code into dynamic or static libraries (Code Assets) using Dart's Native Assets hook system (via hook/build.dart and hook/link.dart utilizing package:hooks and package:native_toolchain_c). Use when a user asks to: 'setup native assets', 'compile C/C++ source code', 'bundle dynamic libraries', 'build native C code', 'link native assets', 'implement build.dart or link.dart hooks', or 'integrate C/C++ interop in Dart/Flutter'. Helps agents avoid manual toolchain orchestration and configures secure hash-validated binary downloads or advanced linker tree-shaking with package:record_use mapping.
novahiz/novahiz · ★ 1 · AI & Automation · score 70
Install: claude install-skill novahiz/novahiz
# Compiling C Code into Code Assets with Native Assets Hooks Integrate and automate the compilation and packaging of native C/C++ source code into **Code Assets** under Dart's overarching **Native Assets** feature using build and link hooks. ## Contents - [Introduction](#introduction) - [Constraints](#constraints) - [Native Interop Packages](#native-interop-packages) - [Step-by-Step Workflow](#step-by-step-workflow) - [Choosing an Integration Approach](#choosing-an-integration-approach) - [Method 1: Local Compilation with Linker Tree-Shaking (Recommended)](#method-1-local-compilation-with-linker-tree-shaking-recommended) - [Prerequisite Host Compiler Toolchains](#prerequisite-host-compiler-toolchains) - [C Source and Bindings Setup](#c-source-and-bindings-setup) - [Defining the C Library Build Spec](#defining-the-c-library-build-spec) - [Implementing hook/build.dart](#implementing-hookbuilddart) - [Implementing hook/link.dart](#implementing-hooklinkdart) - [Method 2: Downloading Precompiled Dynamic Libraries](#method-2-downloading-precompiled-dynamic-libraries) - [Why Download Precompiled Binaries?](#why-download-precompiled-binaries) - [Implementing Precompiled Dynamic Downloads](#implementing-precompiled-dynamic-downloads) - [Verification Checklist](#verification-checklist) - [1. Local Execution Sandbox](#1-local-execution-sandbox) - [2. Verify Target Outputs](#2-verify-target-outputs) - [3. Verify Tree-Shaking Stripping](#3-verify-tree-shaking-strippi