#ninja-build #build-system #generator #file #meta

build ninja-files2

Build your own ninja file meta build generators in rust

1 unstable release

0.2.0 Apr 15, 2024

#672 in Build Utils


Used in cargo-ninja

MIT license

41KB
1K SLoC

Ninja Files

This is a collection of rust modules to help build.ninja files. This allows you to use rust to generate ninja build files, offers more functionality than just cargo.

https://ninja-build.org/manual.html

This is also general enough for all project kinds, not just rust. It allows rust to be used as the 'meta-build' system for the ninja build system

Project Structure

The project is structured as a mono repo, with a meta package that pulls in common items that can be enabled with features.

data - is the core data types and builders to create files cookie - is a file writer written using the cookie-factory crate.

Other folders in lib are various 'modules' that will be published as crates. These can be picked and chosen for your project, so you only pull in what you need to

Contributing

Having extra 'modules' for people to consume is greatly encouraged. It is the hope that many useful modules will be mono-repo'd into this repository, so that everyone can benefit.

It is still also possible to publish your own packages under your own names.

Examples

The util/configure is an real world example, it generates the build.ninja file for this project. To initially seed the file run ./configure in the root directory to generate the ninja file.

An awesome feature of ninja, is it can be configure that the build.ninja file has dependencies on the util/configure project, so it will automatically be regenerated if the configure project is updated.

Dependencies

~290–425KB