From 6d9b5a99f55014f487170c7a5da33d0b039bc63b Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Fri, 17 Oct 2025 23:35:11 +0200 Subject: [PATCH] Add text to README and .gitignore --- .gitignore | 12 ++++++++++++ README.md | 31 ++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d85036f --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +# IDEs and editors +/.idea +/.vscode + +# General +/tmp +/_tmp +.cache + +# Python +__pycache__/ +*.py[cod] diff --git a/README.md b/README.md index cc9b1c8..ca83c07 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,32 @@ # shuriken -A simplistic C++ build tool based on Ninja with first-class support for C++20 modules. \ No newline at end of file +A simplistic C++ build tool based on [Ninja](https://ninja-build.org/) with first-class support for C++20 modules. + +It's written in Python with minimal dependencies (so far only PyYAML) and as a single file, to allow for easy integration into a project and quick customizability if needed. + + +## Design goals + +First and foremost, the goal of this project is to have a simple C++ build script for my own personal projects. It is **not** designed as a general purpose build system, but specifically tailored to my own use cases. + +That being said, feel free to use it in your own projects if it works for you, and tell me your feedback. + +The main design goals are as follows: + +- Keep it simple by relying on conventions rather than supporting every possible use case. +- Support C++20 modules for structuring code without header files, but without supporting every possible use case of modules. +- Allow building for multiple targets (e.g. Linux, Windows, WebAssembly). +- Allow overriding config values with a local override file instead of modifying the build config. +- Autodetect source files instead of listing them all manually. + + +## Requirements / conventions + +Projects need to follow some rules to allow building them with shuriken. + +- All source code must be in a source directory (defaults to `src`, configurable with `source_dir`). +- All build artifacts will be created in a build directory (defaults to `build`, configurable with `build_dir`) with subdirectories for each target (e.g. `build/linux/`). +- C++ source files must use the extension `.cppm` if they define a module, `.cpp` otherwise. +- Modules must be defined in source files using the same path and name as the module, replacing `.` with `/`. (For example, the module `foo.bar.baz` must be defined in `src/foo/bar/baz.cppm`.) +- Modules can only be defined in one file. Splitting module interface and implementation is not supported. +- Clang should be used as the compiler for the default target. While the compiler itself is configurable, the build dependency detection for modules uses `clang-scan-deps`. Other targets can use other compilers, since dependency detection is always done using the default target.