forked from nrfconnect/sdk-nrf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
79 lines (62 loc) · 2 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
#
# Copyright (c) 2022 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
cmake_minimum_required(VERSION 3.20.0)
# Flag which defines whether application is compiled as gateway/dongle or headset
add_compile_definitions(HEADSET=1)
add_compile_definitions(GATEWAY=2)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
# Test a configuration file option has been given
if(NOT DEFINED EXTRA_CONF_FILE)
message(FATAL_ERROR "No configuration file specified, set -- -DEXTRA_CONF_FILE=<configuration file>")
endif()
project(NRF5340_AUDIO)
string(TIMESTAMP NRF5340_AUDIO_CORE_APP_COMP_DATE "%a %b %d %H:%M:%S %Y")
# Generate fw_info_app.c
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/utils/fw_info_app.c.in"
"${CMAKE_BINARY_DIR}/fw_info_app.c"
@ONLY)
# Target sources below are specific to the nRF5340 Audio DK HW
target_sources(app PRIVATE
${CMAKE_BINARY_DIR}/fw_info_app.c
)
if (CONFIG_BT_BAP_BROADCAST_SINK)
add_subdirectory(broadcast_sink)
endif()
if (CONFIG_BT_BAP_BROADCAST_SOURCE)
add_subdirectory(broadcast_source)
endif()
if (CONFIG_BT_BAP_UNICAST_CLIENT)
add_subdirectory(unicast_client)
endif()
if (CONFIG_BT_BAP_UNICAST_SERVER)
add_subdirectory(unicast_server)
endif()
# Include application events and configuration headers
zephyr_library_include_directories(
include
src/audio
src/bluetooth
src/drivers
src/modules
src/utils
src/utils/macros
)
zephyr_library_include_directories(app PRIVATE
${ZEPHYR_NRF_MODULE_DIR}/boards/arm/nrf5340_audio_dk_nrf5340)
# Application sources
add_subdirectory(src/audio)
add_subdirectory(src/bluetooth)
add_subdirectory(src/drivers)
add_subdirectory(src/modules)
add_subdirectory(src/utils)
## Cirrus Logic
if (CONFIG_HW_CODEC_CIRRUS_LOGIC)
if (ZEPHYR_CIRRUS_LOGIC_MODULE_DIR)
add_subdirectory(${ZEPHYR_CIRRUS_LOGIC_MODULE_DIR} cirrus_logic_bin_dir)
else()
message(FATAL_ERROR "Cirrus Logic/sdk-mcu-drivers repository not found\n")
endif()
endif()