-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
79 lines (57 loc) · 2.33 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# This makefile can be used with GNU Make and Windows NMAKE
# No part of this Makefile is required to build the project
# it's a convenience measure to launch CMake commands
# Windows NMAKE \
!ifndef 0 # \
CLEAN = if exist build rmdir /s /q build # \
RUN_EXAMPLE = build\example\Debug\example.exe # \
RUN_TESTS_EXCEPT = build\sub\tests-except\test\Debug\test.exe # \
RUN_TESTS_NOEXCEPT = build\sub\tests-noexcept\test\Debug\test.exe # \
!else
# GNU Make
CLEAN = rm -rf build xcode
RUN_EXAMPLE = build/example/example
RUN_TESTS_EXCEPT = build/sub/tests-except/test/test
RUN_TESTS_NOEXCEPT = build/sub/tests-noexcept/test/test
# \
!endif
gtest_filter = *
all:
cmake -B build -DKEYBOARD_AUTO_TYPE_WITH_EXAMPLE=1 .
cmake --build build -j4
rebuild: clean all
clean:
$(CLEAN)
run-example: all
$(RUN_EXAMPLE)
xcode-project:
cmake -G Xcode -B xcode -DCMAKE_C_COMPILER="$$(xcrun -find c++)" -DCMAKE_CXX_COMPILER="$$(xcrun -find cc)" -DKEYBOARD_AUTO_TYPE_WITH_TESTS=1 -DKEYBOARD_AUTO_TYPE_WITH_EXAMPLE=1 .
vs-project:
cmake -B build -DKEYBOARD_AUTO_TYPE_WITH_TESTS=1 -DKEYBOARD_AUTO_TYPE_WITH_EXAMPLE=1 .
format:
cmake -B build/sub/format -DKEYBOARD_AUTO_TYPE_WITH_CLANG_FORMAT=1 .
cmake --build build/sub/format --target clang-format
check: clang-tidy cppcheck
compile-commands-for-checks:
cmake -B build/sub/checks -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DKEYBOARD_AUTO_TYPE_WITH_STATIC_ANALYSIS=1 -DKEYBOARD_AUTO_TYPE_WITH_EXAMPLE=1 .
clang-tidy: compile-commands-for-checks
cmake --build build/sub/checks --target clang-tidy
cppcheck: compile-commands-for-checks
cmake --build build/sub/checks --target cppcheck
build-tests-except:
cmake -B build/sub/tests-except -DKEYBOARD_AUTO_TYPE_WITH_TESTS=1 -DKEYBOARD_AUTO_TYPE_USE_SANITIZERS=1 .
cmake --build build/sub/tests-except -j4
build-tests-noexcept:
cmake -B build/sub/tests-noexcept -DKEYBOARD_AUTO_TYPE_WITH_TESTS=1 -DKEYBOARD_AUTO_TYPE_USE_SANITIZERS=1 -DKEYBOARD_AUTO_TYPE_DISABLE_CPP_EXCEPTIONS=1 .
cmake --build build/sub/tests-noexcept -j4
tests-except: build-tests-except
$(RUN_TESTS_EXCEPT) --gtest_filter="$(gtest_filter)"
tests-noexcept: build-tests-noexcept
$(RUN_TESTS_NOEXCEPT) --gtest_filter="AutoTypeErrorsTest.*"
tests: tests-except tests-noexcept
x11-keysyms:
node scripts/x11-keysyms
build-test-keys-app:
cd test-keys-app && npm ci
run-test-keys-app:
node test-keys-app/start.js