1# 2# Copyright (c) 2019, The OpenThread Authors. 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are met: 7# 1. Redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer. 9# 2. Redistributions in binary form must reproduce the above copyright 10# notice, this list of conditions and the following disclaimer in the 11# documentation and/or other materials provided with the distribution. 12# 3. Neither the name of the copyright holder nor the 13# names of its contributors may be used to endorse or promote products 14# derived from this software without specific prior written permission. 15# 16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26# POSSIBILITY OF SUCH DAMAGE. 27# 28 29set(COMMON_INCLUDES 30 ${PROJECT_SOURCE_DIR}/src/core 31) 32 33set(COMMON_SOURCES 34 api/backbone_router_api.cpp 35 api/backbone_router_ftd_api.cpp 36 api/ble_secure_api.cpp 37 api/border_agent_api.cpp 38 api/border_router_api.cpp 39 api/border_routing_api.cpp 40 api/channel_manager_api.cpp 41 api/channel_monitor_api.cpp 42 api/child_supervision_api.cpp 43 api/coap_api.cpp 44 api/coap_secure_api.cpp 45 api/commissioner_api.cpp 46 api/crypto_api.cpp 47 api/dataset_api.cpp 48 api/dataset_ftd_api.cpp 49 api/dataset_updater_api.cpp 50 api/diags_api.cpp 51 api/dns_api.cpp 52 api/dns_server_api.cpp 53 api/error_api.cpp 54 api/heap_api.cpp 55 api/history_tracker_api.cpp 56 api/icmp6_api.cpp 57 api/instance_api.cpp 58 api/ip6_api.cpp 59 api/jam_detection_api.cpp 60 api/joiner_api.cpp 61 api/link_api.cpp 62 api/link_metrics_api.cpp 63 api/link_raw_api.cpp 64 api/logging_api.cpp 65 api/mesh_diag_api.cpp 66 api/message_api.cpp 67 api/multi_radio_api.cpp 68 api/nat64_api.cpp 69 api/netdata_api.cpp 70 api/netdata_publisher_api.cpp 71 api/netdiag_api.cpp 72 api/network_time_api.cpp 73 api/ping_sender_api.cpp 74 api/radio_stats_api.cpp 75 api/random_crypto_api.cpp 76 api/random_noncrypto_api.cpp 77 api/server_api.cpp 78 api/sntp_api.cpp 79 api/srp_client_api.cpp 80 api/srp_client_buffers_api.cpp 81 api/srp_server_api.cpp 82 api/tasklet_api.cpp 83 api/tcp_api.cpp 84 api/tcp_ext_api.cpp 85 api/thread_api.cpp 86 api/thread_ftd_api.cpp 87 api/trel_api.cpp 88 api/udp_api.cpp 89 backbone_router/backbone_tmf.cpp 90 backbone_router/bbr_leader.cpp 91 backbone_router/bbr_local.cpp 92 backbone_router/bbr_manager.cpp 93 backbone_router/multicast_listeners_table.cpp 94 backbone_router/ndproxy_table.cpp 95 border_router/infra_if.cpp 96 border_router/routing_manager.cpp 97 coap/coap.cpp 98 coap/coap_message.cpp 99 coap/coap_secure.cpp 100 common/appender.cpp 101 common/binary_search.cpp 102 common/crc16.cpp 103 common/data.cpp 104 common/error.cpp 105 common/frame_builder.cpp 106 common/frame_data.cpp 107 common/heap.cpp 108 common/heap_data.cpp 109 common/heap_string.cpp 110 common/log.cpp 111 common/message.cpp 112 common/notifier.cpp 113 common/preference.cpp 114 common/random.cpp 115 common/settings.cpp 116 common/string.cpp 117 common/tasklet.cpp 118 common/time_ticker.cpp 119 common/timer.cpp 120 common/tlvs.cpp 121 common/trickle_timer.cpp 122 common/uptime.cpp 123 crypto/aes_ccm.cpp 124 crypto/aes_ecb.cpp 125 crypto/crypto_platform.cpp 126 crypto/hkdf_sha256.cpp 127 crypto/hmac_sha256.cpp 128 crypto/mbedtls.cpp 129 crypto/sha256.cpp 130 crypto/storage.cpp 131 diags/factory_diags.cpp 132 instance/instance.cpp 133 mac/channel_mask.cpp 134 mac/data_poll_handler.cpp 135 mac/data_poll_sender.cpp 136 mac/link_raw.cpp 137 mac/mac.cpp 138 mac/mac_filter.cpp 139 mac/mac_frame.cpp 140 mac/mac_links.cpp 141 mac/mac_types.cpp 142 mac/sub_mac.cpp 143 mac/sub_mac_callbacks.cpp 144 meshcop/announce_begin_client.cpp 145 meshcop/border_agent.cpp 146 meshcop/commissioner.cpp 147 meshcop/dataset.cpp 148 meshcop/dataset_local.cpp 149 meshcop/dataset_manager.cpp 150 meshcop/dataset_manager_ftd.cpp 151 meshcop/dataset_updater.cpp 152 meshcop/energy_scan_client.cpp 153 meshcop/extended_panid.cpp 154 meshcop/joiner.cpp 155 meshcop/joiner_router.cpp 156 meshcop/meshcop.cpp 157 meshcop/meshcop_leader.cpp 158 meshcop/meshcop_tlvs.cpp 159 meshcop/network_name.cpp 160 meshcop/panid_query_client.cpp 161 meshcop/secure_transport.cpp 162 meshcop/tcat_agent.cpp 163 meshcop/timestamp.cpp 164 net/checksum.cpp 165 net/dhcp6_client.cpp 166 net/dhcp6_server.cpp 167 net/dns_client.cpp 168 net/dns_dso.cpp 169 net/dns_platform.cpp 170 net/dns_types.cpp 171 net/dnssd_server.cpp 172 net/icmp6.cpp 173 net/ip4_types.cpp 174 net/ip6.cpp 175 net/ip6_address.cpp 176 net/ip6_filter.cpp 177 net/ip6_headers.cpp 178 net/ip6_mpl.cpp 179 net/nat64_translator.cpp 180 net/nd6.cpp 181 net/nd_agent.cpp 182 net/netif.cpp 183 net/sntp_client.cpp 184 net/socket.cpp 185 net/srp_client.cpp 186 net/srp_server.cpp 187 net/tcp6.cpp 188 net/tcp6_ext.cpp 189 net/udp6.cpp 190 radio/ble_secure.cpp 191 radio/radio.cpp 192 radio/radio_callbacks.cpp 193 radio/radio_platform.cpp 194 radio/trel_interface.cpp 195 radio/trel_link.cpp 196 radio/trel_packet.cpp 197 thread/address_resolver.cpp 198 thread/announce_begin_server.cpp 199 thread/announce_sender.cpp 200 thread/anycast_locator.cpp 201 thread/child.cpp 202 thread/child_supervision.cpp 203 thread/child_table.cpp 204 thread/csl_tx_scheduler.cpp 205 thread/discover_scanner.cpp 206 thread/dua_manager.cpp 207 thread/energy_scan_server.cpp 208 thread/indirect_sender.cpp 209 thread/key_manager.cpp 210 thread/link_metrics.cpp 211 thread/link_metrics_types.cpp 212 thread/link_quality.cpp 213 thread/lowpan.cpp 214 thread/mesh_forwarder.cpp 215 thread/mesh_forwarder_ftd.cpp 216 thread/mesh_forwarder_mtd.cpp 217 thread/mle.cpp 218 thread/mle_router.cpp 219 thread/mle_tlvs.cpp 220 thread/mle_types.cpp 221 thread/mlr_manager.cpp 222 thread/neighbor.cpp 223 thread/neighbor_table.cpp 224 thread/network_data.cpp 225 thread/network_data_leader.cpp 226 thread/network_data_leader_ftd.cpp 227 thread/network_data_local.cpp 228 thread/network_data_notifier.cpp 229 thread/network_data_publisher.cpp 230 thread/network_data_service.cpp 231 thread/network_data_tlvs.cpp 232 thread/network_data_types.cpp 233 thread/network_diagnostic.cpp 234 thread/network_diagnostic_tlvs.cpp 235 thread/panid_query_server.cpp 236 thread/radio_selector.cpp 237 thread/router.cpp 238 thread/router_table.cpp 239 thread/src_match_controller.cpp 240 thread/thread_netif.cpp 241 thread/time_sync_service.cpp 242 thread/tmf.cpp 243 thread/uri_paths.cpp 244 utils/channel_manager.cpp 245 utils/channel_monitor.cpp 246 utils/flash.cpp 247 utils/heap.cpp 248 utils/history_tracker.cpp 249 utils/jam_detector.cpp 250 utils/link_metrics_manager.cpp 251 utils/mesh_diag.cpp 252 utils/otns.cpp 253 utils/parse_cmdline.cpp 254 utils/ping_sender.cpp 255 utils/power_calibration.cpp 256 utils/slaac_address.cpp 257 utils/srp_client_buffers.cpp 258) 259 260set(RADIO_COMMON_SOURCES 261 api/diags_api.cpp 262 api/error_api.cpp 263 api/instance_api.cpp 264 api/link_raw_api.cpp 265 api/logging_api.cpp 266 api/random_noncrypto_api.cpp 267 api/tasklet_api.cpp 268 common/binary_search.cpp 269 common/error.cpp 270 common/frame_builder.cpp 271 common/log.cpp 272 common/random.cpp 273 common/string.cpp 274 common/tasklet.cpp 275 common/timer.cpp 276 common/uptime.cpp 277 crypto/aes_ccm.cpp 278 crypto/aes_ecb.cpp 279 crypto/crypto_platform.cpp 280 crypto/storage.cpp 281 diags/factory_diags.cpp 282 instance/instance.cpp 283 mac/link_raw.cpp 284 mac/mac_frame.cpp 285 mac/mac_types.cpp 286 mac/sub_mac.cpp 287 mac/sub_mac_callbacks.cpp 288 radio/radio.cpp 289 radio/radio_callbacks.cpp 290 radio/radio_platform.cpp 291 thread/link_quality.cpp 292 utils/parse_cmdline.cpp 293 utils/power_calibration.cpp 294) 295 296set(OT_VENDOR_EXTENSION "" CACHE STRING "specify a C++ source file built as part of OpenThread core library") 297if(OT_VENDOR_EXTENSION) 298 target_compile_definitions(ot-config INTERFACE "OPENTHREAD_ENABLE_VENDOR_EXTENSION=1") 299 list(APPEND COMMON_SOURCES ${OT_VENDOR_EXTENSION}) 300endif() 301 302if(OT_FTD) 303 include(ftd.cmake) 304endif() 305 306if(OT_MTD) 307 include(mtd.cmake) 308endif() 309 310if(OT_RCP) 311 include(radio.cmake) 312 if (OT_APP_CLI) 313 include(radio_cli.cmake) 314 endif() 315endif() 316 317set_property(SOURCE api/instance_api.cpp 318 APPEND PROPERTY COMPILE_DEFINITIONS "PACKAGE_VERSION=\"${OT_PACKAGE_VERSION}\"" 319) 320