-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (46 loc) · 1.61 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
CONFIG ?= Release
GENERATOR ?= Ninja
BUILD_DIR ?= build
.PHONY: all
all: config build test
.PHONY: config
config:
cmake -S. -B$(BUILD_DIR) -G$(GENERATOR) -DCMAKE_BUILD_TYPE=$(CONFIG)
.PHONY: build
build:
cmake --build $(BUILD_DIR) --config $(CONFIG)
.PHONY: test
test:
cd $(BUILD_DIR) && ctest
.PHONY: sanitize
sanitize:
cmake -S. -G$(GENERATOR) -Bbuild_sanitize \
-DTOBANTEAUDIO_BUILD_ASAN=ON \
-DTOBANTEAUDIO_BUILD_UBSAN=ON \
.
cmake --build build_sanitize
cd build_sanitize && ctest -c
.PHONY: coverage
coverage:
cmake -S. -G$(GENERATOR) -B build_coverage -DTOBANTEAUDIO_BUILD_COVERAGE=ON
cd build_coverage && cmake --build . -- -j2
cd build_coverage && lcov -c -i -d . --base-directory . -o base_cov.info
cd build_coverage && ctest
cd build_coverage && lcov -c -d . --base-directory . -o test_cov.info
cd build_coverage && lcov -a base_cov.info -a test_cov.info -o cov.info
cd build_coverage && lcov --remove cov.info "*boost/*" -o cov.info
cd build_coverage && lcov --remove cov.info "*3rd_party/*" -o cov.info
cd build_coverage && lcov --remove cov.info "*c++*" -o cov.info
cd build_coverage && lcov --remove cov.info "*v1*" -o cov.info
cd build_coverage && lcov --remove cov.info "*x86_64-linux-gnu*" -o cov.info
cd build_coverage && lcov --remove cov.info "*Xcode.app*" -o cov.info
.PHONY: report
report:
cd build_coverage && genhtml cov.info --output-directory lcov
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
.PHONY: format
format:
find plugin -iname '*.h' -o -iname '*.hpp' -o -iname '*.cpp' | xargs clang-format -i
find tests -iname '*.h' -o -iname '*.hpp' -o -iname '*.cpp' | xargs clang-format -i