-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
68 lines (58 loc) · 1.77 KB
/
CMakeLists.txt
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
cmake_minimum_required (VERSION 2.8.12)
project (software-synthesizer)
set (CMAKE_CXX_COMPILER "clang++")
set (CMAKE_EXPORT_COMPILE_COMMANDS "ON")
include (FindPkgConfig)
pkg_check_modules (SDL2 sdl2 REQUIRED)
pkg_check_modules (GLEW glew REQUIRED)
pkg_check_modules (ALSA alsa REQUIRED)
include_directories (include
${SDL2_INCLUDE_DIRS}
${GLEW_INCLUDE_DIRS}
${ALSA_INCLUDE_DIRS})
add_compile_options(-std=c++17 -Werror -Wall -pedantic -Os)
#add_compile_options(-std=c++17 -Werror -Wall -pedantic -O0 -ggdb -fsanitize=undefined,leak,address)
add_library (ApplicationLib src/application.cpp)
add_library (OpenGLLib src/opengl.cpp)
add_library (MidiLib src/midi.cpp)
add_library (FiltersLib src/filters.cpp)
add_executable (software-synthesizer src/main.cpp)
target_link_libraries (software-synthesizer
ApplicationLib
OpenGLLib
MidiLib
FiltersLib
GL
#-fsanitize=leak,address,undefined
${SDL2_LDFLAGS}
${GLEW_LIBRARIES}
${ALSA_LIBRARIES}
-pthread
-s
)
add_custom_target (valgrind
DEPENDS software-synthesizer
COMMAND valgrind --track-origins=yes --show-leak-kinds=all --leak-check=full -v ./software-synthesizer
)
add_custom_target (perf
DEPENDS software-synthesizer
COMMAND perf stat ./software-synthesizer
)
add_custom_target (report
DEPENDS software-synthesizer
COMMAND perf record -g ./software-synthesizer
COMMAND perf report -g 'graph,0.5,caller' --sort comm,dso,sym
)
add_custom_target (tiny
DEPENDS software-synthesizer
COMMAND sstrip ./software-synthesizer
COMMAND gzip -cn9 ./software-synthesizer >small
COMMAND cat ../data/tiny ./small >compact
COMMAND chmod +x ./compact
COMMAND rm ./small ./software-synthesizer
COMMAND mv ./compact ./software-synthesizer
)
add_custom_target (tidy
DEPENDS software-synthesizer
COMMAND clang-tidy -p=. ../src/*.cpp
)