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 | |
| parent | feat: initial commit (diff) | |
| download | wk7_platypusproject-a34820d26592ff8650963c566d90ce95292ef50a.tar.xz wk7_platypusproject-a34820d26592ff8650963c566d90ce95292ef50a.zip | |
chore(scripts): move format task to ninja
| -rw-r--r-- | build.ninja | 13 | ||||
| -rw-r--r-- | scripts/format | 3 |
2 files changed, 10 insertions, 6 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 diff --git a/scripts/format b/scripts/format deleted file mode 100644 index 2e46c61..0000000 --- a/scripts/format +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -clang-format -i platypus/*.cpp platypus/*.h |