dart-setup-ffi-assetslisted
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