diff options
| author | Fuwn <[email protected]> | 2022-06-24 04:34:06 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-06-24 04:34:06 -0700 |
| commit | 06a2da38c0bffa43c9e8a26b6d98dc95595dc081 (patch) | |
| tree | 09d1c29f9202b1cb8670fa1f0d6bcf256f8f738c /build.ninja | |
| parent | docs(license): add gpl-3.0 (diff) | |
| download | cait-06a2da38c0bffa43c9e8a26b6d98dc95595dc081.tar.xz cait-06a2da38c0bffa43c9e8a26b6d98dc95595dc081.zip | |
ci: push source to remote
Diffstat (limited to 'build.ninja')
| -rw-r--r-- | build.ninja | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/build.ninja b/build.ninja new file mode 100644 index 0000000..5134409 --- /dev/null +++ b/build.ninja @@ -0,0 +1,40 @@ +cc = clang++ +cxxflags = -Isrc -O3 -std=c++20 -Weverything -Wno-c++98-compat +out_dir = out +name = cait +src_dir = src +out_ext = .exe +obj_ext = .o +cc_ext = .cc + +rule cc + command = $cc $cxxflags -c $in -o $out +rule clang_format + command = clang-format -i -style=LLVM $src_dir/*$cc_ext $src_dir/*.hh +rule clang_tidy + command = run-clang-tidy -checks="*" -j 8 files $src_dir -p=out +rule link + command = $cc $in -o $out + +build $out_dir/$name$obj_ext: cc $src_dir/$name$cc_ext +build $out_dir/cli$obj_ext: cc $src_dir/cli$cc_ext +build $out_dir/context$obj_ext: cc $src_dir/context$cc_ext +build $out_dir/help$obj_ext: cc $src_dir/help$cc_ext +build $out_dir/lexer$obj_ext: cc $src_dir/lexer$cc_ext +build $out_dir/node$obj_ext: cc $src_dir/node$cc_ext +build $out_dir/parser$obj_ext: cc $src_dir/parser$cc_ext +build $out_dir/token$obj_ext: cc $src_dir/token$cc_ext +build $out_dir/$name$out_ext: link $out_dir/$name$obj_ext $ + $out_dir/cli$obj_ext $ + $out_dir/context$obj_ext $ + $out_dir/help$obj_ext $ + $out_dir/lexer$obj_ext $ + $out_dir/node$obj_ext $ + $out_dir/parser$obj_ext $ + $out_dir/token$obj_ext +build _format: clang_format +build format: phony _format +build _tidy: clang_tidy +build tidy: phony _tidy + +default format $out_dir/$name$out_ext |