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/border_agent_api.cpp 37 api/border_router_api.cpp 38 api/border_routing_api.cpp 39 api/channel_manager_api.cpp 40 api/channel_monitor_api.cpp 41 api/child_supervision_api.cpp 42 api/coap_api.cpp 43 api/coap_secure_api.cpp 44 api/commissioner_api.cpp 45 api/crypto_api.cpp 46 api/dataset_api.cpp 47 api/dataset_ftd_api.cpp 48 api/dataset_updater_api.cpp 49 api/diags_api.cpp 50 api/dns_api.cpp 51 api/dns_server_api.cpp 52 api/error_api.cpp 53 api/heap_api.cpp 54 api/history_tracker_api.cpp 55 api/icmp6_api.cpp 56 api/instance_api.cpp 57 api/ip6_api.cpp 58 api/jam_detection_api.cpp 59 api/joiner_api.cpp 60 api/link_api.cpp 61 api/link_metrics_api.cpp 62 api/link_raw_api.cpp 63 api/logging_api.cpp 64 api/mesh_diag_api.cpp 65 api/message_api.cpp 66 api/multi_radio_api.cpp 67 api/nat64_api.cpp 68 api/netdata_api.cpp 69 api/netdata_publisher_api.cpp 70 api/netdiag_api.cpp 71 api/network_time_api.cpp 72 api/ping_sender_api.cpp 73 api/radio_stats_api.cpp 74 api/random_crypto_api.cpp 75 api/random_noncrypto_api.cpp 76 api/server_api.cpp 77 api/sntp_api.cpp 78 api/srp_client_api.cpp 79 api/srp_client_buffers_api.cpp 80 api/srp_server_api.cpp 81 api/tasklet_api.cpp 82 api/tcp_api.cpp 83 api/tcp_ext_api.cpp 84 api/thread_api.cpp 85 api/thread_ftd_api.cpp 86 api/trel_api.cpp 87 api/udp_api.cpp 88 backbone_router/backbone_tmf.cpp 89 backbone_router/bbr_leader.cpp 90 backbone_router/bbr_local.cpp 91 backbone_router/bbr_manager.cpp 92 backbone_router/multicast_listeners_table.cpp 93 backbone_router/ndproxy_table.cpp 94 border_router/infra_if.cpp 95 border_router/routing_manager.cpp 96 coap/coap.cpp 97 coap/coap_message.cpp 98 coap/coap_secure.cpp 99 common/appender.cpp 100 common/binary_search.cpp 101 common/crc16.cpp 102 common/data.cpp 103 common/error.cpp 104 common/frame_builder.cpp 105 common/frame_data.cpp 106 common/heap.cpp 107 common/heap_data.cpp 108 common/heap_string.cpp 109 common/instance.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 mac/channel_mask.cpp 133 mac/data_poll_handler.cpp 134 mac/data_poll_sender.cpp 135 mac/link_raw.cpp 136 mac/mac.cpp 137 mac/mac_filter.cpp 138 mac/mac_frame.cpp 139 mac/mac_links.cpp 140 mac/mac_types.cpp 141 mac/sub_mac.cpp 142 mac/sub_mac_callbacks.cpp 143 meshcop/announce_begin_client.cpp 144 meshcop/border_agent.cpp 145 meshcop/commissioner.cpp 146 meshcop/dataset.cpp 147 meshcop/dataset_local.cpp 148 meshcop/dataset_manager.cpp 149 meshcop/dataset_manager_ftd.cpp 150 meshcop/dataset_updater.cpp 151 meshcop/dtls.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/timestamp.cpp 162 net/checksum.cpp 163 net/dhcp6_client.cpp 164 net/dhcp6_server.cpp 165 net/dns_client.cpp 166 net/dns_dso.cpp 167 net/dns_platform.cpp 168 net/dns_types.cpp 169 net/dnssd_server.cpp 170 net/icmp6.cpp 171 net/ip4_types.cpp 172 net/ip6.cpp 173 net/ip6_address.cpp 174 net/ip6_filter.cpp 175 net/ip6_headers.cpp 176 net/ip6_mpl.cpp 177 net/nat64_translator.cpp 178 net/nd6.cpp 179 net/nd_agent.cpp 180 net/netif.cpp 181 net/sntp_client.cpp 182 net/socket.cpp 183 net/srp_client.cpp 184 net/srp_server.cpp 185 net/tcp6.cpp 186 net/tcp6_ext.cpp 187 net/udp6.cpp 188 radio/radio.cpp 189 radio/radio_callbacks.cpp 190 radio/radio_platform.cpp 191 radio/trel_interface.cpp 192 radio/trel_link.cpp 193 radio/trel_packet.cpp 194 thread/address_resolver.cpp 195 thread/announce_begin_server.cpp 196 thread/announce_sender.cpp 197 thread/anycast_locator.cpp 198 thread/child.cpp 199 thread/child_supervision.cpp 200 thread/child_table.cpp 201 thread/csl_tx_scheduler.cpp 202 thread/discover_scanner.cpp 203 thread/dua_manager.cpp 204 thread/energy_scan_server.cpp 205 thread/indirect_sender.cpp 206 thread/key_manager.cpp 207 thread/link_metrics.cpp 208 thread/link_metrics_types.cpp 209 thread/link_quality.cpp 210 thread/lowpan.cpp 211 thread/mesh_forwarder.cpp 212 thread/mesh_forwarder_ftd.cpp 213 thread/mesh_forwarder_mtd.cpp 214 thread/mle.cpp 215 thread/mle_router.cpp 216 thread/mle_tlvs.cpp 217 thread/mle_types.cpp 218 thread/mlr_manager.cpp 219 thread/neighbor.cpp 220 thread/neighbor_table.cpp 221 thread/network_data.cpp 222 thread/network_data_leader.cpp 223 thread/network_data_leader_ftd.cpp 224 thread/network_data_local.cpp 225 thread/network_data_notifier.cpp 226 thread/network_data_publisher.cpp 227 thread/network_data_service.cpp 228 thread/network_data_tlvs.cpp 229 thread/network_data_types.cpp 230 thread/network_diagnostic.cpp 231 thread/network_diagnostic_tlvs.cpp 232 thread/panid_query_server.cpp 233 thread/radio_selector.cpp 234 thread/router.cpp 235 thread/router_table.cpp 236 thread/src_match_controller.cpp 237 thread/thread_netif.cpp 238 thread/time_sync_service.cpp 239 thread/tmf.cpp 240 thread/uri_paths.cpp 241 utils/channel_manager.cpp 242 utils/channel_monitor.cpp 243 utils/flash.cpp 244 utils/heap.cpp 245 utils/history_tracker.cpp 246 utils/jam_detector.cpp 247 utils/link_metrics_manager.cpp 248 utils/mesh_diag.cpp 249 utils/otns.cpp 250 utils/parse_cmdline.cpp 251 utils/ping_sender.cpp 252 utils/power_calibration.cpp 253 utils/slaac_address.cpp 254 utils/srp_client_buffers.cpp 255) 256 257set(RADIO_COMMON_SOURCES 258 api/diags_api.cpp 259 api/error_api.cpp 260 api/instance_api.cpp 261 api/link_raw_api.cpp 262 api/logging_api.cpp 263 api/random_noncrypto_api.cpp 264 api/tasklet_api.cpp 265 common/binary_search.cpp 266 common/error.cpp 267 common/frame_builder.cpp 268 common/instance.cpp 269 common/log.cpp 270 common/random.cpp 271 common/string.cpp 272 common/tasklet.cpp 273 common/timer.cpp 274 common/uptime.cpp 275 crypto/aes_ccm.cpp 276 crypto/aes_ecb.cpp 277 crypto/crypto_platform.cpp 278 crypto/storage.cpp 279 diags/factory_diags.cpp 280 mac/link_raw.cpp 281 mac/mac_frame.cpp 282 mac/mac_types.cpp 283 mac/sub_mac.cpp 284 mac/sub_mac_callbacks.cpp 285 radio/radio.cpp 286 radio/radio_callbacks.cpp 287 radio/radio_platform.cpp 288 thread/link_quality.cpp 289 utils/parse_cmdline.cpp 290 utils/power_calibration.cpp 291) 292 293set(OT_VENDOR_EXTENSION "" CACHE STRING "specify a C++ source file built as part of OpenThread core library") 294if(OT_VENDOR_EXTENSION) 295 target_compile_definitions(ot-config INTERFACE "OPENTHREAD_ENABLE_VENDOR_EXTENSION=1") 296 list(APPEND COMMON_SOURCES ${OT_VENDOR_EXTENSION}) 297endif() 298 299if(OT_FTD) 300 include(ftd.cmake) 301endif() 302 303if(OT_MTD) 304 include(mtd.cmake) 305endif() 306 307if(OT_RCP) 308 include(radio.cmake) 309 if (OT_APP_CLI) 310 include(radio_cli.cmake) 311 endif() 312endif() 313 314set_property(SOURCE api/instance_api.cpp 315 APPEND PROPERTY COMPILE_DEFINITIONS "PACKAGE_VERSION=\"${OT_PACKAGE_VERSION}\"" 316) 317