-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
160 lines (141 loc) · 4.07 KB
/
CMakeLists.txt
File metadata and controls
160 lines (141 loc) · 4.07 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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
cmake_minimum_required(VERSION 3.10.2)
project(audiomark
DESCRIPTION "Firmware for the AudoMark Self-Hosted Benchmark"
LANGUAGES C
VERSION 1.0.0)
set(CMAKE_C_FLAGS "-O2")
# Windows command line limit workaround
set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS ON)
set(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES ON)
include_directories(lib/speexdsp)
include_directories(lib/speexdsp/include)
include_directories(lib/speexdsp/include/speex)
include_directories(lib/speexdsp/libspeexdsp)
include_directories(src)
if(DEFINED PORT_DIR)
include(${PORT_DIR}/port.cmake)
else()
message(FATAL_ERROR "Please define PORT_DIR, e.g. -DPORT_DIR=<path>")
endif()
# For Xiph we are using Float, never Fixed
add_definitions(-DFLOATING_POINT)
# This macro is used extensively in LibSpeeX for function visibility.
add_definitions(-DEXPORT=)
# Benchmark system integrator provides heap
add_definitions(-DOVERRIDE_SPEEX_ALLOC)
add_definitions(-DOS_SUPPORT_CUSTOM)
add_definitions(-D__RESTRICT=)
set(EE_SOURCE
# Note: main.c is just for self-hosted testing
main.c
src/ee_audiomark.c
src/ee_aec_f32.c
src/ee_anr_f32.c
src/ee_abf_f32.c
src/ee_abf_f32_tables.c
src/ee_kws.c
src/ee_mfcc_f32.c
src/ee_mfcc_f32_tables.c
lib/speexdsp/libspeexdsp/buffer.c
lib/speexdsp/libspeexdsp/fftwrap.c
lib/speexdsp/libspeexdsp/filterbank.c
lib/speexdsp/libspeexdsp/jitter.c
lib/speexdsp/libspeexdsp/kiss_fft.c
lib/speexdsp/libspeexdsp/kiss_fftr.c
lib/speexdsp/libspeexdsp/mdf.c
lib/speexdsp/libspeexdsp/preprocess.c
lib/speexdsp/libspeexdsp/resample.c
lib/speexdsp/libspeexdsp/scal.c
lib/speexdsp/libspeexdsp/smallft.c
)
set(TH_SOURCE
# This is essentially an include needed in th_api.c
src/ee_nn_tables.c
src/ee_abf_f32_tables.c
${PORT_SOURCE}
)
set(TEST_AEC_F32_SOURCE
src/ee_aec_f32.c
lib/speexdsp/libspeexdsp/buffer.c
lib/speexdsp/libspeexdsp/fftwrap.c
lib/speexdsp/libspeexdsp/filterbank.c
lib/speexdsp/libspeexdsp/jitter.c
lib/speexdsp/libspeexdsp/kiss_fft.c
lib/speexdsp/libspeexdsp/kiss_fftr.c
lib/speexdsp/libspeexdsp/mdf.c
lib/speexdsp/libspeexdsp/preprocess.c
lib/speexdsp/libspeexdsp/resample.c
lib/speexdsp/libspeexdsp/scal.c
lib/speexdsp/libspeexdsp/smallft.c
${TH_SOURCE}
tests/data/aec_f32_input_source.c
tests/data/aec_f32_input_echo.c
tests/data/aec_f32_expected.c
tests/test_aec_f32.c
)
add_executable(test_aec_f32 ${TEST_AEC_F32_SOURCE})
set(TEST_ANR_F32_SOURCE
src/ee_anr_f32.c
lib/speexdsp/libspeexdsp/buffer.c
lib/speexdsp/libspeexdsp/fftwrap.c
lib/speexdsp/libspeexdsp/filterbank.c
lib/speexdsp/libspeexdsp/jitter.c
lib/speexdsp/libspeexdsp/kiss_fft.c
lib/speexdsp/libspeexdsp/kiss_fftr.c
lib/speexdsp/libspeexdsp/mdf.c
lib/speexdsp/libspeexdsp/preprocess.c
lib/speexdsp/libspeexdsp/resample.c
lib/speexdsp/libspeexdsp/scal.c
lib/speexdsp/libspeexdsp/smallft.c
${TH_SOURCE}
tests/data/anr_f32_input.c
tests/data/anr_f32_expected.c
tests/test_anr_f32.c
)
add_executable(test_anr_f32 ${TEST_ANR_F32_SOURCE})
set(TEST_ABF_F32_SOURCE
src/ee_abf_f32.c
${TH_SOURCE}
tests/data/abf_f32_input_ch1.c
tests/data/abf_f32_input_ch2.c
tests/data/abf_f32_expected.c
tests/test_abf_f32.c
)
add_executable(test_abf_f32 ${TEST_ABF_F32_SOURCE})
set(TEST_MFCC_F32_SOURCE
src/ee_mfcc_f32.c
src/ee_mfcc_f32_tables.c
${TH_SOURCE}
tests/data/mfcc_f32_all.c
tests/test_mfcc_f32.c
)
add_executable(test_mfcc_f32 ${TEST_MFCC_F32_SOURCE})
set(TEST_KWS_SOURCE
src/ee_kws.c
src/ee_mfcc_f32.c
src/ee_mfcc_f32_tables.c
${TH_SOURCE}
tests/test_kws.c
tests/data/kws_input.c
tests/data/kws_expected.c
)
add_executable(test_kws ${TEST_KWS_SOURCE})
add_executable(audiomark ${EE_SOURCE} ${TH_SOURCE})
if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
else()
target_link_libraries(audiomark m)
target_link_libraries(test_abf_f32 m)
target_link_libraries(test_aec_f32 m)
target_link_libraries(test_anr_f32 m)
target_link_libraries(test_mfcc_f32 m)
target_link_libraries(test_kws m)
endif()
add_custom_target(test
COMMENT "Running unit tests..."
COMMAND ./test_abf_f32
COMMAND ./test_aec_f32
COMMAND ./test_anr_f32
COMMAND ./test_kws
COMMAND ./test_mfcc_f32
DEPENDS test_mfcc_f32 test_kws test_abf_f32 test_aec_f32 test_anr_f32
)