diff options
| author | Fuwn <[email protected]> | 2022-05-24 19:08:32 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-05-24 19:08:32 -0700 |
| commit | a34820d26592ff8650963c566d90ce95292ef50a (patch) | |
| tree | 259585a0a4337b51e37038dfb62967b9fa1d8008 /build.ninja | |
| parent | feat: initial commit (diff) | |
| download | wk7_platypusproject-a34820d26592ff8650963c566d90ce95292ef50a.tar.xz wk7_platypusproject-a34820d26592ff8650963c566d90ce95292ef50a.zip | |
chore(scripts): move format task to ninja
Diffstat (limited to 'build.ninja')
| -rw-r--r-- | build.ninja | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/build.ninja b/build.ninja index 87d0da8..5b4ffd5 100644 --- a/build.ninja +++ b/build.ninja @@ -5,15 +5,22 @@ name = platypus src_dir = $name out_ext = .exe +rule clang_format + command = clang-format -i $src_dir/*.cpp $src_dir/*.h + rule compile command = $cc $cxxflags -c $in -o $out rule link - command = $cc $in -o $out$out_ext + command = $cc $in -o $out + +build _format: clang_format + +build format: phony _format build $out_dir/platypus.o: compile $src_dir/platypus.cpp build $out_dir/testPlatypus.o: compile $src_dir/testPlatypus.cpp -build $out_dir/$name: link $out_dir/platypus.o $out_dir/testPlatypus.o +build $out_dir/$name$out_ext: link $out_dir/platypus.o $out_dir/testPlatypus.o | format -default $out_dir/$name +default $out_dir/$name$out_ext |