Add a Git dependency

September 22, 2026 · View on GitHub

Flint Logo

Flint

The Cargo experience for C/C++—minimalist, Git-native, and CMake-free.

CLI Docs | Chert Compositions

Platform Status License


Flint brings the modern developer workflow of Rust’s cargo or Go modules to C and C++.

Instead of writing hundreds of lines of complex CMakeLists.txt or Makefile glue code, Flint manages dependencies directly from standard Git repositories and drives GCC/Clang compilers automatically through a single JSON manifest.


Demo


Flint Terminal Demo

Flint initializing a workspace, fetching dependencies, and running a build.



Features

  • Cargo-Like Simplicity: Build, sync dependencies, and execute code in a single command.
  • Git-Native Package Management: Fetch dependencies directly into standard subdirectories using Git URLs.
  • Version & Commit Pinning: Lock dependencies by release tag, branch, or exact commit hash.
  • Single Manifest (composition.json): One human-readable file replaces entire build script directory structures.
  • Chert Compositions: Instant compatibility layer for standard C/C++ repositories without a native composition.json.
  • Global VERSION Macro: Automatically inject project version headers into C/C++ source code during compilation.
  • Convention Over Configuration: Clean standard directory layout (src/, include/, deps/).

Quick Start

Prerequisites

  • OS: Linux (Beta)
  • Compiler: gcc or clang
  • Tool: git

1. Installation

Install via official script:

curl -fsSL -H "Accept: application/vnd.github.v3.raw" https://api.github.com/repos/mainak55512/flint/contents/install.sh | bash

Or build from source:

Bash

git clone https://github.com/mainak55512/flint.git
cd flint && ./install.sh

2. Quick Workflow

# Initialize a new C project workspace
flint init

# Add a Git dependency
flint add https://github.com/user/example_lib@1.0.0

# Compile and execute immediately
flint run

Project Structure

Flint enforces a clean, zero-config directory model:

my_project/
├── src/                # Source files (.c, .cpp)
├── include/            # Local header files (.h, .hpp)
├── deps/               # External dependencies (Managed by Flint)
├── static/             # Static library files (.a)
├── shared/             # Dynamic/Shared library files (.so)
└── composition.json    # Project manifest & build configuration

Manifest Specification (composition.json)

{
  "project_name": "example_project",
  "project_language": "c",
  "version": "0.1.0",
  "compiler_path": "/usr/bin/gcc",
  "executable": true,
  "flags": ["-Wall", "-O2"],
  "lib_links": [],
  "include_paths": ["include"],
  "src": ["src"],
  "dependencies": {
    "example_lib": {
      "version": "1.0.0",
      "remote": "https://github.com/user/example_lib.git"
    }
  }
}

How Flint Compares

Feature / AttributeFlintCMake + vcpkgcmkr + FetchContentMeson + WrapDB
Tool ArchitectureIntegrated Build System & PMMeta-Build Generator + Standalone PMMeta-Wrapper Generator (outputs CMakeLists.txt)Meta-Build Generator + Package Resolver
Runtime DependenciesSystem git, gcc/clangC++ runtime, git, build backend (ninja/make)cmkr, CMake, git, build backendPython 3, ninja, git
Config Formatcomposition.json (JSON)CMakeLists.txt + vcpkg.json (Custom DSL + JSON)cmake.toml (TOML)meson.build (Declarative DSL)
Package Management MethodGit-native clones to deps/ via CLI (flint add)Manifest/Port-tree repos & binary cachingCMake FetchContent (configure-time download)Wrap files (.wrap) & WrapDB registry
Non-Native Library HandlingChert Compositions (custom specs for non-Flint repos)vcpkg Port Overlay recipesRequires manual CMake target wrappingMeson Wrap subproject patches
Incremental Build EngineNative state/modification trackingDelegated to backend (Ninja/Make)Delegated to CMake backendDelegated to Ninja
Directory ModelConvention-over-configuration (src/, include/, deps/)Fully explicit & customisableExplicit & customisableExplicit & customisable
Platform SupportLinux & macOS (Current)Cross-Platform (Linux, macOS, Windows)Cross-Platform (Linux, macOS, Windows)Cross-Platform (Linux, macOS, Windows)
Cross-CompilationFlags passed to system compilerToolchain files (-DCMAKE_TOOLCHAIN_FILE)Toolchain files via CMakeCross-definition files (--cross-file)

Community & Support

Package Discovery & Contributions

When you create a new library project using flint, it is automatically designed to be modular and can be fetched directly by other projects via flint add <repo_url>@<version>.

If you are working with a legacy or existing third-party C/C++ library that doesn't natively support flint, you can still use it by defining a chert composition (composition.json).

How to Contribute Legacy Libraries:

We maintain a community repository of pre-made library compositions called flint-cherts.

If you write a chert composition for a popular C/C++ library, contributions to flint-cherts are highly appreciated!

  1. Check out the flint-cherts README Guide to learn how to structure a composition.json.
  2. Submit a Pull Request with your library composition.
  3. Help the community seamlessly use legacy C/C++ packages without needing manual setup!

License

Distributed under the MIT License. See LICENSE for details.