From 23b23399f236e84fafaffc49dcf90115147f20c0 Mon Sep 17 00:00:00 2001 From: The-Mighty-Cat <54977668+The-Mighty-Cat@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:13:21 +0100 Subject: [PATCH] Create README.md --- README.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..0735db3 --- /dev/null +++ b/README.md @@ -0,0 +1,76 @@ +# About + +This is a simple and easy to use C++ build system for Linux, it uses JSON based project files. + +# Install + +## Prerequisites: +``` +clang 18> +git +``` +## Clone and build: +```bash +git clone https://github.com/The-Mighty-Cat/Crafter.Build.git +cd Crafter.Build +./build.sh +``` +(optionally add to path) + +# How to use + +## Quickstart + +create a ``project.json`` in an empty folder, open it in your preffered text editor. +Create a basic project file, with a base configuration and debug and release configuration +```JSON +{ + "name": "hello-world", + "configurations": [ + { + "name": "base", + "standard": "c++26", + "source_files": ["main"], + "module_files": [], + "build_dir": "./build", + "output_dir": "./bin" + }, + { + "name": "debug", + "extends": ["base"], + "optimization_level": "0" + } + { + "name": "release", + "extends": ["base"], + "optimization_level": "3" + } + ] +} +``` +Save and close the file, create a ``main.cpp`` +```cpp +#include +int main() { + std::println("Hello World!"); +} +``` +Save and close, then run ``crafter-build debug``. Now you can run the ``hello-world`` executable that has appeared in the ``build`` folder + +## CLI arguments +```bash +crafter-build +``` +builds the project with the specified configuration, using the defualt project filename ``project.json`` + +```bash +crafter-build +``` +builds the project with the specified configuration, using the specified project filename + +```bash +crafter-build --help +``` +displays this help message + +