-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (51 loc) · 2.21 KB
/
Makefile
File metadata and controls
72 lines (51 loc) · 2.21 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
default: release
.PHONY: default release debug all clean doc
include make-utils/flags.mk
include make-utils/cpp-utils.mk
# Use C++23
$(eval $(call use_cpp23))
# Enable coverage
$(eval $(call enable_coverage))
WARNING_FLAGS += -pedantic
CXX_FLAGS += -Iinclude -Idoctest -Werror -Wno-deprecated-declarations
LD_FLAGS += -pthread
# Enable coverage if not disabled by the user
ifeq (,$(CPP_UTILS_NO_COVERAGE))
ifneq (,$(findstring clang,$(CXX)))
DEBUG_FLAGS += -fprofile-arcs -ftest-coverage
else
ifneq (,$(findstring g++,$(CXX)))
DEBUG_FLAGS += --coverage
endif
endif
endif
# Compile the tests and create the executables
$(eval $(call auto_folder_compile,test))
$(eval $(call auto_add_executable,test))
release: release/bin/test
release_debug: release_debug/bin/test
debug: debug/bin/test
clang-tidy:
@ /usr/share/clang/run-clang-tidy.py -p . -header-filter '^include/cpp_utils' -checks='cert-*,cppcoreguidelines-*,google-*,llvm-*,misc-*,modernize-*,performance-*,readility-*,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-google-readability-namespace-comments,-llvm-namespace-comment,-llvm-include-order,-google-runtime-references' -j9 2>/dev/null | /usr/bin/zgrep -v "^clang-tidy"
clang-tidy-all:
@ /usr/share/clang/run-clang-tidy.py -p . -header-filter '^include/cpp_utils' -checks='*' -j9
clang-tidy-mono:
clang-tidy -p . -header-filter '^include/cpp_utils' -checks='cert-*,cppcoreguidelines-*,google-*,llvm-*,misc-*,modernize-*,performance-*,readility-*,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-google-readability-namespace-comments,-llvm-namespace-comment,-llvm-include-order,-google-runtime-references' test/*.cpp
clang-tidy-mono-all:
clang-tidy -p . -header-filter '^include/cpp_utils' -checks='*' test/*.cpp
all: release release_debug debug
debug_test: debug/bin/test
./debug/bin/test
release_test: release/bin/test
./release/bin/test
release_debug_test: release_debug/bin/test
./release_debug/bin/test
cpp_test: debug/bin/test release_debug/bin/test release/bin/test
./debug/bin/test
./release_debug/bin/test
./release/bin/test
doc:
doxygen Doxyfile
clean: base_clean
rm -rf doc
include make-utils/cpp-utils-finalize.mk