-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
264 lines (226 loc) · 8.72 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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# MicroLink EchoLink Station
# Copyright (C) 2024, Bruce MacKinnon KC1FSZ
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ( at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# NOT FOR COMMERCIAL USE WITHOUT PERMISSION.
#
cmake_minimum_required(VERSION 3.13)
if(DEFINED ENV{PICO_BUILD})
include(pico_sdk_import.cmake)
endif()
project(microlink C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
file(MAKE_DIRECTORY tmp)
if(DEFINED ENV{PICO_BUILD})
pico_sdk_init()
endif()
if(DEFINED ENV{PICO_BUILD})
message("----- PICO build ---------------------------------------------------------------")
add_compile_options(-Wall -g)
else()
message("Desktop build!")
add_compile_options(-fstack-protector-all -Wall -Wpedantic -g)
endif()
# ------ link-main-2 ------------------------------------------------------------
#
add_executable(link-main-2
src/link-main-2.cpp
src/common.cpp
src/Prompts.cpp
src/Synth.cpp
src/RXMonitor.cpp
src/LinkUserInfo.cpp
src/Conference.cpp
src/ConferenceBridge.cpp
src/SNTPClient.cpp
src/contexts/LwIPLib.cpp
#src/contexts/SIM7600IPLib.cpp
#kc1fsz-tools-cpp/src/rp2040/PicoUartChannel.cpp
src/contexts/I2CAudioOutputContext.cpp
src/contexts/PicoAudioInputContext.cpp
src/machines/DNSMachine.cpp
src/machines/LogonMachine2.cpp
src/machines/LookupMachine3.cpp
kc1fsz-tools-cpp/src/Common.cpp
kc1fsz-tools-cpp/src/IPAddress.cpp
kc1fsz-tools-cpp/src/AudioAnalyzer.cpp
kc1fsz-tools-cpp/src/DTMFDetector.cpp
kc1fsz-tools-cpp/src/CommandShell.cpp
kc1fsz-tools-cpp/src/rp2040/PicoPollTimer.cpp
kc1fsz-tools-cpp/src/rp2040/PicoPerfTimer.cpp
kc1fsz-tools-cpp/src/md5/md5c.c
gsm-0610-codec/src/fixed_math.cpp
gsm-0610-codec/src/wav_util.cpp
gsm-0610-codec/src/Parameters.cpp
gsm-0610-codec/src/Encoder.cpp
gsm-0610-codec/src/Decoder.cpp
)
if(DEFINED ENV{PICO_BUILD})
pico_enable_stdio_usb(link-main-2 1)
# Watch out! Don't let the STDIO get sent to the UART
pico_enable_stdio_uart(link-main-2 0)
# ADDED FOR PICO W
pico_add_extra_outputs(link-main-2)
target_compile_definitions(link-main-2 PRIVATE PARAM_ASSERTIONS_ENABLE_ALL=1)
target_compile_definitions(link-main-2 PRIVATE PICO_BUILD=1)
target_link_libraries(link-main-2 pico_stdlib hardware_i2c hardware_adc pico_cyw43_arch_lwip_poll)
#target_link_libraries(link-main-2 pico_stdlib hardware_i2c hardware_adc)
endif()
target_include_directories(link-main-2 PRIVATE src)
target_include_directories(link-main-2 PRIVATE kc1fsz-tools-cpp/include)
target_include_directories(link-main-2 PRIVATE gsm-0610-codec/include)
target_include_directories(link-main-2 PRIVATE microtunnel/include)
target_include_directories(link-main-2 PRIVATE ${CMAKE_CURRENT_LIST_DIR})
# ------ hello-world ---------------------------------------------------------
#
add_executable(hello-world
tests/hello-world.cpp
tests/dhcpserver.c
kc1fsz-tools-cpp/src/Common.cpp
)
if(DEFINED ENV{PICO_BUILD})
pico_enable_stdio_usb(hello-world 1)
# Watch out! Don't let the STDIO get sent to the UART
pico_enable_stdio_uart(hello-world 0)
# ADDED FOR PICO W
pico_add_extra_outputs(hello-world)
target_compile_definitions(hello-world PRIVATE PARAM_ASSERTIONS_ENABLE_ALL=1)
target_compile_definitions(hello-world PRIVATE PICO_BUILD=1)
target_link_libraries(hello-world pico_stdlib hardware_i2c hardware_adc pico_cyw43_arch_lwip_poll)
endif()
target_include_directories(hello-world PRIVATE src)
target_include_directories(hello-world PRIVATE kc1fsz-tools-cpp/include)
target_include_directories(hello-world PRIVATE ${CMAKE_CURRENT_LIST_DIR})
# ------ shell-test ------------------------------------------------------------
#
add_executable(shell-test
tests/shell-test.cpp
src/common.cpp
kc1fsz-tools-cpp/src/Common.cpp
kc1fsz-tools-cpp/src/CommandShell.cpp
)
if(DEFINED ENV{PICO_BUILD})
pico_enable_stdio_usb(shell-test 1)
# Watch out! Don't let the STDIO get sent to the UART
pico_enable_stdio_uart(shell-test 0)
# ADDED FOR PICO W
pico_add_extra_outputs(shell-test)
target_compile_definitions(shell-test PRIVATE PARAM_ASSERTIONS_ENABLE_ALL=1)
target_compile_definitions(shell-test PRIVATE PICO_BUILD=1)
target_link_libraries(shell-test pico_stdlib hardware_i2c hardware_adc pico_cyw43_arch_lwip_poll)
endif()
target_include_directories(shell-test PRIVATE src)
target_include_directories(shell-test PRIVATE kc1fsz-tools-cpp/include)
target_include_directories(shell-test PRIVATE ${CMAKE_CURRENT_LIST_DIR})
# ------ server-test-1 -------------------------------------------------------
add_executable(server-test-1
tests/server-test-1.cpp
src/common.cpp
)
target_include_directories(server-test-1 PRIVATE src)
# ------ packet-test-1 -------------------------------------------------------
add_executable(packet-test-1
tests/packet-test-1.cpp
src/common.cpp
../gsm-0610-codec/src/fixed_math.cpp
../gsm-0610-codec/src/wav_util.cpp
../gsm-0610-codec/src/Parameters.cpp
../gsm-0610-codec/src/Encoder.cpp
../gsm-0610-codec/src/Decoder.cpp
)
target_include_directories(packet-test-1 PRIVATE src)
target_include_directories(packet-test-1 PRIVATE kc1fsz-tools-cpp/include)
target_include_directories(packet-test-1 PRIVATE gsm-0610-codec/include)
# ------ common-test-1 -------------------------------------------------------
add_executable(common-test-1
tests/common-test-1.cpp
src/common.cpp
kc1fsz-tools-cpp/src/win32/Win32PerfTimer.cpp
kc1fsz-tools-cpp/src/Common.cpp
)
target_include_directories(common-test-1 PRIVATE src)
target_include_directories(common-test-1 PRIVATE kc1fsz-tools-cpp/include)
# ------ audio-test-1 --------------------------------------------------------
add_executable(audio-test-1
tests/audio-test-1.cpp
src/common.cpp
)
target_include_directories(audio-test-1 PRIVATE src)
target_link_libraries(audio-test-1 winmm)
# ------ audio-test-2 --------------------------------------------------------
add_executable(audio-test-2
tests/audio-test-2.cpp
src/common.cpp
src/contexts/W32AudioOutputContext.cpp
kc1fsz-tools-cpp/src/win32/Win32PerfTimer.cpp
kc1fsz-tools-cpp/src/Common.cpp
)
target_include_directories(audio-test-2 PRIVATE src)
target_include_directories(audio-test-2 PRIVATE kc1fsz-tools-cpp/include)
target_link_libraries(audio-test-2 winmm)
# ------ exception-test-1 ----------------------------------------------------
add_executable(exception-test-1
tests/exception-test-1.cpp
)
if(DEFINED ENV{PICO_BUILD})
pico_enable_stdio_usb(exception-test-1 1)
pico_enable_stdio_uart(exception-test-1 0)
target_compile_definitions(exception-test-1 PUBLIC PICO_BUILD=1)
target_link_libraries(exception-test-1 pico_stdlib hardware_i2c hardware_adc pico_multicore)
endif()
# ------ build-prompts -------------------------------------------------------
add_executable(build-prompts
prompts/build-prompts.cpp
src/common.cpp
kc1fsz-tools-cpp/src/Common.cpp
gsm-0610-codec/src/fixed_math.cpp
gsm-0610-codec/src/wav_util.cpp
gsm-0610-codec/src/Parameters.cpp
gsm-0610-codec/src/Encoder.cpp
gsm-0610-codec/src/Decoder.cpp
)
target_include_directories(build-prompts PRIVATE src)
target_include_directories(build-prompts PRIVATE kc1fsz-tools-cpp/include)
target_include_directories(build-prompts PRIVATE gsm-0610-codec/include)
# ------ audio-test-3 --------------------------------------------------------
add_executable(audio-test-3
tests/audio-test-3.cpp
src/common.cpp
src/Prompts.cpp
src/contexts/W32AudioOutputContext.cpp
kc1fsz-tools-cpp/src/win32/Win32PerfTimer.cpp
kc1fsz-tools-cpp/src/Common.cpp
gsm-0610-codec/src/fixed_math.cpp
gsm-0610-codec/src/wav_util.cpp
gsm-0610-codec/src/Parameters.cpp
gsm-0610-codec/src/Encoder.cpp
gsm-0610-codec/src/Decoder.cpp
)
target_include_directories(audio-test-3 PRIVATE src)
target_include_directories(audio-test-3 PRIVATE kc1fsz-tools-cpp/include)
target_include_directories(audio-test-3 PRIVATE gsm-0610-codec/include)
target_link_libraries(audio-test-3 winmm)
# ------ dtmf-test-1 -------------------------------------------------------
# Target: Host
add_executable(dtmf-test-1
tests/dtmf-test-1.cpp
kc1fsz-tools-cpp/src/DTMFDetector.cpp
kc1fsz-tools-cpp/src/Common.cpp
gsm-0610-codec/src/fixed_math.cpp
)
target_include_directories(dtmf-test-1 PRIVATE src)
target_include_directories(dtmf-test-1 PRIVATE kc1fsz-tools-cpp/include)
target_include_directories(dtmf-test-1 PRIVATE gsm-0610-codec/include)