-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
106 lines (80 loc) · 3.54 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
cmake_minimum_required(VERSION 3.23...3.27)
file(STRINGS VERSION CURRENT_VERSION)
project(grit-eurorack-dev VERSION ${CURRENT_VERSION} LANGUAGES C CXX)
option(GRITWAVE_EURORACK_ENABLE_PLUGIN "Build plugin (development tool)" OFF)
find_program(CCACHE ccache)
if (CCACHE)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
endif ()
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_EXTENSIONS ON)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(LIBDAISY_DIR ${CMAKE_SOURCE_DIR}/3rd_party/libDaisy)
set(LINKER_SCRIPT ${LIBDAISY_DIR}/core/STM32H750IB_flash.lds)
enable_testing()
include("cmake/add_baremetal_executable.cmake")
add_subdirectory(3rd_party/tetl/include)
add_subdirectory(lib)
if(CMAKE_CROSSCOMPILING)
add_subdirectory(${LIBDAISY_DIR})
add_subdirectory(tool/benchmark)
add_subdirectory(src/ares)
add_subdirectory(src/astra)
add_subdirectory(src/hermas)
add_subdirectory(src/kyma)
add_subdirectory(src/poseidon)
endif()
if(NOT CMAKE_CROSSCOMPILING)
include(FetchContent)
FetchContent_Declare(Catch2 GIT_REPOSITORY "https://github.com/catchorg/Catch2" GIT_TAG "v3.5.2" GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(Catch2)
include(${Catch2_SOURCE_DIR}/extras/Catch.cmake)
add_executable(grit-eurorack-tests)
catch_discover_tests(grit-eurorack-tests WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
target_link_libraries(grit-eurorack-tests PRIVATE gritwave::eurorack Catch2::Catch2WithMain)
target_compile_options(grit-eurorack-tests PRIVATE "-Wall" "-Wextra" "-Wpedantic")
target_sources(grit-eurorack-tests
PRIVATE
"lib/grit/audio_test.cpp"
"lib/grit/audio/airwindows/airwindows_test.cpp"
"lib/grit/audio/delay/static_delay_line_test.cpp"
"lib/grit/audio/dynamic/gain_computer_test.cpp"
"lib/grit/audio/dynamic/transient_shaper_test.cpp"
"lib/grit/audio/envelope/envelope_adsr_test.cpp"
"lib/grit/audio/envelope/envelope_follower_test.cpp"
"lib/grit/audio/filter/biquad_test.cpp"
"lib/grit/audio/filter/state_variable_filter_test.cpp"
"lib/grit/audio/music/note_test.cpp"
"lib/grit/audio/noise/dither_test.cpp"
"lib/grit/audio/noise/white_noise_test.cpp"
"lib/grit/audio/stereo/stereo_frame_test.cpp"
"lib/grit/audio/waveshape/diode_rectifier_test.cpp"
"lib/grit/audio/waveshape/full_wave_rectifier_test.cpp"
"lib/grit/audio/waveshape/half_wave_rectifier_test.cpp"
"lib/grit/audio/waveshape/hard_clipper_test.cpp"
"lib/grit/audio/waveshape/tanh_clipper_test.cpp"
"lib/grit/audio/waveshape/wave_shaper_test.cpp"
"lib/grit/audio/waveshape/wave_shaper_adaa1_test.cpp"
"lib/grit/eurorack_test.cpp"
"lib/grit/fft_test.cpp"
"lib/grit/fft/fft_test.cpp"
"lib/grit/math_test.cpp"
"lib/grit/math/ilog2_test.cpp"
"lib/grit/math/ipow_test.cpp"
"lib/grit/math/normalizable_range_test.cpp"
"lib/grit/math/power_test.cpp"
"lib/grit/math/remap_test.cpp"
"lib/grit/math/static_lookup_table_test.cpp"
"lib/grit/math/trigonometry_test.cpp"
"lib/grit/unit_test.cpp"
"lib/grit/unit/decibel_test.cpp"
)
if(GRITWAVE_EURORACK_ENABLE_PLUGIN)
add_subdirectory(tool/plugin)
endif()
endif()