blob: e5451ade0b54ee98a60f80e28a3eaad3721fe5be [file] [log] [blame]
Michael Spangefa630b2020-07-08 22:23:08 -04001# Copyright (c) 2020 Project CHIP Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Łukasz Duda4e1faf22021-01-27 17:47:25 +010015import("//build_overrides/build.gni")
Michael Spangefa630b2020-07-08 22:23:08 -040016import("//build_overrides/chip.gni")
17import("//build_overrides/nlio.gni")
rgoliverbf60cc22021-01-26 21:15:59 -050018import("//build_overrides/pigweed.gni")
Łukasz Duda4e1faf22021-01-27 17:47:25 +010019
Łukasz Duda4e1faf22021-01-27 17:47:25 +010020import("${build_root}/config/linux/pkg_config.gni")
Michael Spang09611bf2021-03-02 16:31:57 -050021import("${chip_root}/build/chip/buildconfig_header.gni")
Michael Spang1fcb6dd2020-08-24 11:19:04 -040022
Michael Spang8d085b32020-07-10 10:26:23 -040023import("device.gni")
Michael Spangefa630b2020-07-08 22:23:08 -040024
Michael Spangc32dd2f2020-08-13 08:42:21 -040025if (chip_enable_openthread) {
26 import("//build_overrides/openthread.gni")
Łukasz Duda4e1faf22021-01-27 17:47:25 +010027
28 if (chip_device_platform == "linux" || chip_device_platform == "Darwin") {
29 import("//build_overrides/ot_br_posix.gni")
30 }
Michael Spangc32dd2f2020-08-13 08:42:21 -040031}
32
Kamil Kasperczyk44014022021-03-12 21:18:45 +010033if (chip_device_platform == "linux" && chip_mdns != "none") {
Jiacheng Guo5de29292020-10-26 14:41:40 +080034 pkg_config("avahi_client_config") {
35 packages = [ "avahi-client" ]
36 }
37}
38
Jiacheng Guo57945c22020-08-29 03:56:59 +080039if (chip_device_platform != "none") {
Michael Spangefa630b2020-07-08 22:23:08 -040040 declare_args() {
41 # Extra header to include in CHIPDeviceConfig.h for project.
42 chip_device_project_config_include = ""
Michael Spangda4c1252020-08-06 10:40:49 -040043
44 # Date the firmware was built.
45 chip_device_config_firmware_build_date = ""
46
47 # Time the firmware was built.
48 chip_device_config_firmware_build_time = ""
Jiacheng Guoe4ac46a2020-11-11 00:04:34 +080049
50 # By pass provision and secure session
51 chip_bypass_rendezvous = false
hnnajh96613742021-01-06 08:05:28 -080052
53 # Enable including the additional data in the advertisement packets
54 chip_enable_additional_data_advertising = true
hnnajh846f2f12021-02-18 05:45:15 -080055
56 # Enable adding rotating device id to the additional data.
57 chip_enable_rotating_device_id = true
Michael Spangefa630b2020-07-08 22:23:08 -040058 }
59
Michael Spang1fcb6dd2020-08-24 11:19:04 -040060 buildconfig_header("platform_buildconfig") {
61 header = "CHIPDeviceBuildConfig.h"
62 header_dir = "platform"
Michael Spangefa630b2020-07-08 22:23:08 -040063
Michael Spang1fcb6dd2020-08-24 11:19:04 -040064 chip_with_gio = chip_enable_wifi
65 chip_device_config_enable_wpa = chip_enable_wifi
66
67 defines = [
Michael Spang1fcb6dd2020-08-24 11:19:04 -040068 "CHIP_DEVICE_CONFIG_ENABLE_WPA=${chip_device_config_enable_wpa}",
69 "CHIP_ENABLE_OPENTHREAD=${chip_enable_openthread}",
70 "CHIP_WITH_GIO=${chip_with_gio}",
71 "OPENTHREAD_CONFIG_ENABLE_TOBLE=false",
72 ]
73
Michael Spange1aa7b12021-03-09 18:08:38 -050074 if (chip_device_platform == "linux" || chip_device_platform == "darwin") {
75 defines += [ "CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=${chip_enable_ble}" ]
76 }
77
Kamil Kasperczyk44014022021-03-12 21:18:45 +010078 if (chip_mdns != "none") {
Kamil Kasperczyk5f041382021-03-04 20:58:04 +010079 defines += [ "CHIP_DEVICE_CONFIG_ENABLE_MDNS=1" ]
80 }
81
Michael Spangefa630b2020-07-08 22:23:08 -040082 if (chip_device_project_config_include != "") {
83 defines += [ "CHIP_DEVICE_PROJECT_CONFIG_INCLUDE=${chip_device_project_config_include}" ]
84 }
85 if (chip_device_platform_config_include != "") {
86 defines += [ "CHIP_DEVICE_PLATFORM_CONFIG_INCLUDE=${chip_device_platform_config_include}" ]
87 }
88
Michael Spangda4c1252020-08-06 10:40:49 -040089 if (chip_device_config_firmware_build_date != "") {
Michael Spang801349e2020-08-10 09:15:04 -040090 defines += [ "CHIP_DEVICE_CONFIG_FIRWMARE_BUILD_DATE=\"${chip_device_config_firmware_build_date}\"" ]
Michael Spangda4c1252020-08-06 10:40:49 -040091 }
92 if (chip_device_config_firmware_build_time != "") {
Michael Spang801349e2020-08-10 09:15:04 -040093 defines += [ "CHIP_DEVICE_CONFIG_FIRMWARE_BUILD_TIME=\"${chip_device_config_firmware_build_time}\"" ]
Michael Spangda4c1252020-08-06 10:40:49 -040094 }
95
Jiacheng Guoe4ac46a2020-11-11 00:04:34 +080096 if (chip_bypass_rendezvous) {
97 defines += [ "CHIP_BYPASS_RENDEZVOUS=1" ]
98 }
99
hnnajh96613742021-01-06 08:05:28 -0800100 if (chip_enable_additional_data_advertising) {
101 defines += [ "CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING=1" ]
102 } else {
103 defines += [ "CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING=0" ]
104 }
105
hnnajh846f2f12021-02-18 05:45:15 -0800106 if (chip_enable_rotating_device_id) {
107 defines += [ "CHIP_ENABLE_ROTATING_DEVICE_ID=1" ]
108 } else {
109 defines += [ "CHIP_ENABLE_ROTATING_DEVICE_ID=0" ]
110 }
111
Seth Rickard4f0521f2021-01-12 16:06:52 -0600112 if (chip_device_platform == "cc13x2_26x2") {
113 defines += [
114 "CHIP_DEVICE_LAYER_TARGET_CC13X2_26X2=1",
115 "CHIP_DEVICE_LAYER_TARGET=cc13x2_26x2",
116 ]
117 } else if (chip_device_platform == "darwin") {
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400118 defines += [
119 "CHIP_DEVICE_LAYER_TARGET_DARWIN=1",
120 "CHIP_DEVICE_LAYER_TARGET=Darwin",
121 ]
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200122 } else if (chip_device_platform == "efr32") {
123 defines += [
124 "CHIP_DEVICE_LAYER_TARGET_EFR32=1",
125 "CHIP_DEVICE_LAYER_TARGET=EFR32",
126 ]
127 } else if (chip_device_platform == "esp32") {
128 defines += [
129 "CHIP_DEVICE_LAYER_TARGET_ESP32=1",
130 "CHIP_DEVICE_LAYER_TARGET=ESP32",
131 ]
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400132 } else if (chip_device_platform == "linux") {
133 defines += [
134 "CHIP_DEVICE_LAYER_TARGET_LINUX=1",
135 "CHIP_DEVICE_LAYER_TARGET=Linux",
136 ]
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200137 } else if (chip_device_platform == "nrfconnect") {
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400138 defines += [
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200139 "CHIP_DEVICE_LAYER_TARGET_NRFCONNECT=1",
140 "CHIP_DEVICE_LAYER_TARGET=nrfconnect",
Kedar Sovani8617e2a2020-08-30 02:33:21 +0530141 ]
Timothy Maesb5b3d382020-10-05 16:59:21 +0200142 } else if (chip_device_platform == "qpg6100") {
143 defines += [
144 "CHIP_DEVICE_LAYER_TARGET_QPG6100=1",
145 "CHIP_DEVICE_LAYER_TARGET=qpg6100",
146 ]
doru9104ac26b2020-10-13 18:23:28 +0300147 } else if (chip_device_platform == "k32w") {
148 defines += [
149 "CHIP_DEVICE_LAYER_TARGET_K32W=1",
150 "CHIP_DEVICE_LAYER_TARGET=K32W",
151 ]
Kedar Sovani8617e2a2020-08-30 02:33:21 +0530152 }
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400153 }
Jiacheng Guoe4ac46a2020-11-11 00:04:34 +0800154} else {
155 buildconfig_header("platform_buildconfig") {
156 header = "CHIPDeviceBuildConfig.h"
157 header_dir = "platform"
158
159 defines = [
160 "CHIP_DEVICE_LAYER_NONE=1",
161 "CHIP_DEVICE_LAYER_TARGET=NONE",
162 ]
163 }
Jiacheng Guo57945c22020-08-29 03:56:59 +0800164}
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400165
Jiacheng Guo57945c22020-08-29 03:56:59 +0800166if (chip_device_platform != "none" && chip_device_platform != "external") {
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400167 config("platform_config") {
168 if (chip_device_platform == "darwin") {
Michael Spang1b271422020-07-27 12:02:42 -0400169 frameworks = [
170 "CoreFoundation.framework",
171 "CoreBluetooth.framework",
172 "Foundation.framework",
173 ]
jepenven-silabscec75ca2020-08-04 09:38:48 -0400174 }
Michael Spangefa630b2020-07-08 22:23:08 -0400175 }
176
177 static_library("platform") {
178 output_name = "libDeviceLayer"
179
180 sources = [
Michael Spangdb9b8612020-07-13 09:43:13 -0400181 "../include/platform/CHIPDeviceConfig.h",
182 "../include/platform/CHIPDeviceError.h",
183 "../include/platform/CHIPDeviceEvent.h",
184 "../include/platform/CHIPDeviceLayer.h",
185 "../include/platform/ConfigurationManager.h",
186 "../include/platform/ConnectivityManager.h",
187 "../include/platform/GeneralUtils.h",
rgoliverbf60cc22021-01-26 21:15:59 -0500188 "../include/platform/KeyValueStoreManager.h",
Michael Spangdb9b8612020-07-13 09:43:13 -0400189 "../include/platform/PersistedStorage.h",
190 "../include/platform/PlatformManager.h",
191 "../include/platform/SoftwareUpdateManager.h",
192 "../include/platform/SoftwareUpdateManagerImpl.h",
193 "../include/platform/ThreadStackManager.h",
194 "../include/platform/TimeSyncManager.h",
195 "../include/platform/internal/BLEManager.h",
196 "../include/platform/internal/CHIPDeviceLayerInternal.h",
197 "../include/platform/internal/DeviceDescriptionServer.h",
198 "../include/platform/internal/DeviceNetworkInfo.h",
Pankaj Garg4239bcf2020-10-27 08:41:54 -0700199 "../include/platform/internal/DeviceNetworkProvisioning.h",
Michael Spangdb9b8612020-07-13 09:43:13 -0400200 "../include/platform/internal/EventLogging.h",
201 "../include/platform/internal/GenericConfigurationManagerImpl.h",
202 "../include/platform/internal/GenericConnectivityManagerImpl.h",
203 "../include/platform/internal/GenericConnectivityManagerImpl_BLE.h",
204 "../include/platform/internal/GenericConnectivityManagerImpl_NoBLE.h",
205 "../include/platform/internal/GenericConnectivityManagerImpl_NoThread.h",
Michael Spangdb9b8612020-07-13 09:43:13 -0400206 "../include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h",
207 "../include/platform/internal/GenericConnectivityManagerImpl_Thread.h",
Yufeng Wang2a1e8bc2020-09-27 23:27:02 -0700208 "../include/platform/internal/GenericConnectivityManagerImpl_WiFi.h",
Michael Spangdb9b8612020-07-13 09:43:13 -0400209 "../include/platform/internal/GenericNetworkProvisioningServerImpl.h",
210 "../include/platform/internal/GenericPlatformManagerImpl.h",
211 "../include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.h",
212 "../include/platform/internal/GenericPlatformManagerImpl_POSIX.h",
213 "../include/platform/internal/GenericSoftwareUpdateManagerImpl.h",
214 "../include/platform/internal/GenericSoftwareUpdateManagerImpl_BDX.h",
215 "../include/platform/internal/NetworkProvisioningServer.h",
216 "../include/platform/internal/testing/ConfigUnitTest.h",
Michael Spangefa630b2020-07-08 22:23:08 -0400217 "GeneralUtils.cpp",
218 "Globals.cpp",
219 "PersistedStorage.cpp",
220 "SystemEventSupport.cpp",
221 "SystemTimerSupport.cpp",
Jiacheng Guoe4ac46a2020-11-11 00:04:34 +0800222 "TestIdentity.cpp",
Michael Spangefa630b2020-07-08 22:23:08 -0400223 ]
224
Boris Zbarsky444b50b2020-09-23 19:53:06 -0400225 cflags = [ "-Wconversion" ]
226
Michael Spangefa630b2020-07-08 22:23:08 -0400227 public_deps = [
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400228 ":platform_buildconfig",
Michael Spangefa630b2020-07-08 22:23:08 -0400229 "${chip_root}/src/ble",
Vivien Nicolas03209202020-07-21 20:57:37 +0200230 "${chip_root}/src/inet",
Yufeng Wangc22c8992020-09-03 15:34:33 -0700231 "${chip_root}/src/lib/core",
Michael Spangefa630b2020-07-08 22:23:08 -0400232 "${chip_root}/src/lib/core:chip_config_header",
233 "${chip_root}/src/lib/support",
Andrei Litvin56302302021-02-12 15:44:09 -0500234 "${chip_root}/src/platform/logging:headers",
Sagar Dhawan1d812b72020-11-05 08:55:40 -0800235 "${chip_root}/src/setup_payload",
Michael Spangefa630b2020-07-08 22:23:08 -0400236 "${nlio_root}:nlio",
237 ]
238
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400239 public_configs = [
240 ":platform_config",
241 "${chip_root}/src:includes",
242 ]
Michael Spangefa630b2020-07-08 22:23:08 -0400243
Kamil Kasperczyk44014022021-03-12 21:18:45 +0100244 if (chip_mdns != "none") {
Michael Spang247ea282020-11-20 16:58:11 -0500245 public_deps += [ "${chip_root}/src/lib/mdns:platform_header" ]
246 }
247
Seth Rickard4f0521f2021-01-12 16:06:52 -0600248 if (chip_device_platform == "cc13x2_26x2") {
249 sources += [
250 "FreeRTOS/SystemTimeSupport.cpp",
251 "cc13x2_26x2/BlePlatformConfig.h",
252 "cc13x2_26x2/CC13X2_26X2Config.cpp",
253 "cc13x2_26x2/CC13X2_26X2Config.h",
254 "cc13x2_26x2/CHIPDevicePlatformConfig.h",
255 "cc13x2_26x2/CHIPDevicePlatformConfig.h",
256 "cc13x2_26x2/CHIPDevicePlatformEvent.h",
257 "cc13x2_26x2/ConfigurationManagerImpl.cpp",
258 "cc13x2_26x2/ConnectivityManagerImpl.cpp",
259 "cc13x2_26x2/ConnectivityManagerImpl.h",
Seth Rickarde76ed542021-02-17 17:27:21 -0600260 "cc13x2_26x2/DeviceNetworkProvisioningDelegateImpl.cpp",
261 "cc13x2_26x2/DeviceNetworkProvisioningDelegateImpl.h",
Seth Rickard4f0521f2021-01-12 16:06:52 -0600262 "cc13x2_26x2/InetPlatformConfig.h",
Pankaj Garg9a791a82021-02-24 07:48:03 -0800263 "cc13x2_26x2/KeyValueStoreManagerImpl.cpp",
264 "cc13x2_26x2/KeyValueStoreManagerImpl.h",
Seth Rickard4f0521f2021-01-12 16:06:52 -0600265 "cc13x2_26x2/Logging.cpp",
266 "cc13x2_26x2/PlatformManagerImpl.cpp",
267 "cc13x2_26x2/PlatformManagerImpl.h",
268 "cc13x2_26x2/SystemPlatformConfig.h",
269 ]
Andrei Litvin56302302021-02-12 15:44:09 -0500270
Seth Rickarde76ed542021-02-17 17:27:21 -0600271 if (chip_enable_ble) {
272 sources += [
273 "cc13x2_26x2/BLEManagerImpl.cpp",
274 "cc13x2_26x2/BLEManagerImpl.h",
275 ]
276 }
277
Seth Rickard4f0521f2021-01-12 16:06:52 -0600278 if (chip_enable_openthread) {
Seth Rickarde76ed542021-02-17 17:27:21 -0600279 # needed for MTD/FTD
280 import("//build_overrides/ti_simplelink_sdk.gni")
281 import("${ti_simplelink_sdk_build_root}/ti_simplelink_board.gni")
Seth Rickard4f0521f2021-01-12 16:06:52 -0600282 public_deps += [
283 "${chip_root}/third_party/ti_simplelink_sdk:mbedtls",
284 "${chip_root}/third_party/ti_simplelink_sdk:ti_simplelink_sdk",
285 "${chip_root}/third_party/ti_simplelink_sdk:ti_simplelink_sysconfig",
Seth Rickard4f0521f2021-01-12 16:06:52 -0600286 ]
287
Seth Rickarde76ed542021-02-17 17:27:21 -0600288 if (ti_simplelink_device_family == "cc13x2_26x2") {
289 public_deps += [ "${openthread_root}:libopenthread-mtd" ]
290 } else if (ti_simplelink_device_family == "cc13x2x7_26x2x7") {
291 public_deps += [ "${openthread_root}:libopenthread-ftd" ]
292 }
293
Seth Rickard4f0521f2021-01-12 16:06:52 -0600294 sources += [
295 "OpenThread/OpenThreadUtils.cpp",
296 "cc13x2_26x2/ThreadStackManagerImpl.cpp",
297 "cc13x2_26x2/ThreadStackManagerImpl.h",
298 ]
299 }
300 } else if (chip_device_platform == "darwin") {
Michael Spang1b271422020-07-27 12:02:42 -0400301 sources += [
302 "Darwin/BLEManagerImpl.cpp",
303 "Darwin/BLEManagerImpl.h",
Michael Spang1b271422020-07-27 12:02:42 -0400304 "Darwin/BlePlatformConfig.h",
Michael Spang1b271422020-07-27 12:02:42 -0400305 "Darwin/CHIPDevicePlatformConfig.h",
306 "Darwin/CHIPDevicePlatformEvent.h",
307 "Darwin/CHIPPlatformConfig.h",
308 "Darwin/ConfigurationManagerImpl.cpp",
309 "Darwin/ConfigurationManagerImpl.h",
310 "Darwin/ConnectivityManagerImpl.cpp",
311 "Darwin/ConnectivityManagerImpl.h",
312 "Darwin/InetPlatformConfig.h",
Andrei Litvin56302302021-02-12 15:44:09 -0500313 "Darwin/Logging.cpp",
Michael Spang1b271422020-07-27 12:02:42 -0400314 "Darwin/PlatformManagerImpl.cpp",
315 "Darwin/PlatformManagerImpl.h",
316 "Darwin/PosixConfig.cpp",
317 "Darwin/PosixConfig.h",
318 "Darwin/SystemPlatformConfig.h",
319 ]
Vivien Nicolas3b333f02020-10-27 16:17:15 +0100320
Pankaj Garg9a791a82021-02-24 07:48:03 -0800321 sources += [
322 "Darwin/KeyValueStoreManagerImpl.cpp",
323 "Darwin/KeyValueStoreManagerImpl.h",
324 ]
325
Vivien Nicolas3b333f02020-10-27 16:17:15 +0100326 if (chip_enable_ble) {
327 sources += [
328 "Darwin/BleApplicationDelegate.h",
329 "Darwin/BleApplicationDelegateImpl.mm",
330 "Darwin/BleConnectionDelegate.h",
331 "Darwin/BleConnectionDelegateImpl.mm",
332 "Darwin/BlePlatformDelegate.h",
333 "Darwin/BlePlatformDelegateImpl.mm",
Vivien Nicolas49022e42020-12-08 18:06:19 +0100334 "Darwin/UUIDHelper.h",
335 "Darwin/UUIDHelperImpl.mm",
Vivien Nicolas3b333f02020-10-27 16:17:15 +0100336 ]
337 }
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200338 } else if (chip_device_platform == "efr32") {
339 sources += [
340 "EFR32/BLEManagerImpl.cpp",
341 "EFR32/BLEManagerImpl.h",
342 "EFR32/BlePlatformConfig.h",
343 "EFR32/CHIPDevicePlatformConfig.h",
344 "EFR32/CHIPDevicePlatformEvent.h",
345 "EFR32/CHIPPlatformConfig.h",
346 "EFR32/ConfigurationManagerImpl.cpp",
347 "EFR32/ConfigurationManagerImpl.h",
348 "EFR32/ConnectivityManagerImpl.cpp",
349 "EFR32/ConnectivityManagerImpl.h",
jmartinez-silabs122da922020-11-10 11:01:19 -0500350 "EFR32/DeviceNetworkProvisioningDelegateImpl.cpp",
Pankaj Garg4239bcf2020-10-27 08:41:54 -0700351 "EFR32/DeviceNetworkProvisioningDelegateImpl.h",
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200352 "EFR32/EFR32Config.cpp",
353 "EFR32/EFR32Config.h",
354 "EFR32/InetPlatformConfig.h",
355 "EFR32/Logging.cpp",
356 "EFR32/PlatformManagerImpl.cpp",
357 "EFR32/PlatformManagerImpl.h",
358 "EFR32/SystemPlatformConfig.h",
359 "EFR32/freertos_bluetooth.c",
360 "EFR32/freertos_bluetooth.h",
361 "EFR32/gatt_db.c",
362 "EFR32/gatt_db.h",
363 "FreeRTOS/SystemTimeSupport.cpp",
364 ]
rgoliverbf60cc22021-01-26 21:15:59 -0500365
366 # Add pigweed KVS
367 deps = [
368 "$dir_pw_kvs:crc16",
369 "$dir_pw_log",
370 ]
Pankaj Garg9a791a82021-02-24 07:48:03 -0800371 public_deps += [
372 "$dir_pw_checksum",
373 "$dir_pw_kvs",
374 ]
rgoliverbf60cc22021-01-26 21:15:59 -0500375 sources += [
376 "EFR32/KeyValueStoreManagerImpl.cpp",
377 "EFR32/KeyValueStoreManagerImpl.h",
378 ]
379
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200380 if (chip_enable_openthread) {
381 public_deps += [ "${openthread_root}:libopenthread-ftd" ]
382
383 sources += [
384 "EFR32/ThreadStackManagerImpl.cpp",
385 "EFR32/ThreadStackManagerImpl.h",
386 "OpenThread/OpenThreadUtils.cpp",
387 ]
388 }
389 } else if (chip_device_platform == "esp32") {
390 sources += [
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200391 "ESP32/BLEManagerImpl.h",
392 "ESP32/CHIPDevicePlatformConfig.h",
393 "ESP32/CHIPDevicePlatformEvent.h",
394 "ESP32/ConfigurationManagerImpl.cpp",
395 "ESP32/ConfigurationManagerImpl.h",
396 "ESP32/ConnectivityManagerImpl.cpp",
397 "ESP32/ConnectivityManagerImpl.h",
Pankaj Garg4239bcf2020-10-27 08:41:54 -0700398 "ESP32/DeviceNetworkProvisioningDelegateImpl.cpp",
399 "ESP32/DeviceNetworkProvisioningDelegateImpl.h",
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200400 "ESP32/ESP32Config.cpp",
401 "ESP32/ESP32Config.h",
402 "ESP32/ESP32Utils.cpp",
403 "ESP32/ESP32Utils.h",
rgoliver6ce40442021-02-05 15:13:18 -0500404 "ESP32/KeyValueStoreManagerImpl.cpp",
405 "ESP32/KeyValueStoreManagerImpl.h",
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200406 "ESP32/Logging.cpp",
407 "ESP32/LwIPCoreLock.cpp",
Jiacheng Guo5ad65182020-10-30 04:14:16 +0800408 "ESP32/MdnsImpl.cpp",
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200409 "ESP32/NetworkProvisioningServerImpl.h",
410 "ESP32/PlatformManagerImpl.cpp",
411 "ESP32/PlatformManagerImpl.h",
Pankaj Garg4239bcf2020-10-27 08:41:54 -0700412 "ESP32/ServiceProvisioning.cpp",
413 "ESP32/ServiceProvisioning.h",
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200414 "ESP32/SoftwareUpdateManagerImpl.h",
415 "ESP32/SystemTimeSupport.cpp",
Prasad Alatkar6b48d712020-10-02 20:25:00 +0530416 "ESP32/bluedroid/BLEManagerImpl.cpp",
417 "ESP32/nimble/BLEManagerImpl.cpp",
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200418 "FreeRTOS/SystemTimeSupport.cpp",
419 ]
Michael Spang247ea282020-11-20 16:58:11 -0500420
421 public_deps += [ "${chip_root}/src/crypto" ]
doru9104ac26b2020-10-13 18:23:28 +0300422 } else if (chip_device_platform == "k32w") {
423 sources += [
424 "FreeRTOS/SystemTimeSupport.cpp",
425 "K32W/BLEManagerImpl.cpp",
426 "K32W/BLEManagerImpl.h",
427 "K32W/CHIPDevicePlatformConfig.h",
428 "K32W/CHIPDevicePlatformEvent.h",
429 "K32W/ConfigurationManagerImpl.cpp",
430 "K32W/ConfigurationManagerImpl.h",
431 "K32W/ConnectivityManagerImpl.cpp",
432 "K32W/ConnectivityManagerImpl.h",
doru919d0d48f2021-01-28 20:45:01 +0200433 "K32W/DeviceNetworkProvisioningDelegateImpl.cpp",
Pankaj Garg4239bcf2020-10-27 08:41:54 -0700434 "K32W/DeviceNetworkProvisioningDelegateImpl.h",
doru9104ac26b2020-10-13 18:23:28 +0300435 "K32W/K32WConfig.cpp",
436 "K32W/K32WConfig.h",
Pankaj Garg9a791a82021-02-24 07:48:03 -0800437 "K32W/KeyValueStoreManagerImpl.cpp",
438 "K32W/KeyValueStoreManagerImpl.h",
doru9104ac26b2020-10-13 18:23:28 +0300439 "K32W/Logging.cpp",
440 "K32W/NetworkProvisioningServerImpl.h",
441 "K32W/PlatformManagerImpl.cpp",
442 "K32W/PlatformManagerImpl.h",
443 "K32W/SoftwareUpdateManagerImpl.h",
doru919d0d48f2021-01-28 20:45:01 +0200444 "K32W/ble_function_mux.c",
doru9104ac26b2020-10-13 18:23:28 +0300445 ]
446
447 if (chip_enable_openthread) {
448 public_deps += [ "${openthread_root}:libopenthread-ftd" ]
449
450 sources += [
451 "K32W/ThreadStackManagerImpl.cpp",
452 "K32W/ThreadStackManagerImpl.h",
453 "OpenThread/OpenThreadUtils.cpp",
454 ]
455 }
Michael Spang48632482021-01-28 19:11:47 -0500456
457 public_deps += [ "${chip_root}/src/crypto" ]
Michael Spang4314d812020-08-07 10:17:09 -0400458 } else if (chip_device_platform == "linux") {
Michael Spang8d085b32020-07-10 10:26:23 -0400459 sources += [
460 "Linux/BLEManagerImpl.cpp",
461 "Linux/BLEManagerImpl.h",
462 "Linux/BlePlatformConfig.h",
463 "Linux/CHIPDevicePlatformConfig.h",
464 "Linux/CHIPDevicePlatformEvent.h",
465 "Linux/CHIPLinuxStorage.cpp",
466 "Linux/CHIPLinuxStorage.h",
467 "Linux/CHIPLinuxStorageIni.cpp",
468 "Linux/CHIPLinuxStorageIni.h",
469 "Linux/CHIPPlatformConfig.h",
470 "Linux/ConfigurationManagerImpl.cpp",
471 "Linux/ConfigurationManagerImpl.h",
472 "Linux/ConnectivityManagerImpl.cpp",
473 "Linux/ConnectivityManagerImpl.h",
Yufeng Wangfb28e6d2020-11-03 12:47:38 -0800474 "Linux/DeviceNetworkProvisioningDelegateImpl.cpp",
Pankaj Garg4239bcf2020-10-27 08:41:54 -0700475 "Linux/DeviceNetworkProvisioningDelegateImpl.h",
Michael Spang8d085b32020-07-10 10:26:23 -0400476 "Linux/InetPlatformConfig.h",
rgoliverbd881482021-01-28 09:16:27 -0500477 "Linux/KeyValueStoreManagerImpl.cpp",
478 "Linux/KeyValueStoreManagerImpl.h",
Michael Spang8d085b32020-07-10 10:26:23 -0400479 "Linux/Logging.cpp",
480 "Linux/PlatformManagerImpl.cpp",
481 "Linux/PlatformManagerImpl.h",
482 "Linux/PosixConfig.cpp",
483 "Linux/PosixConfig.h",
484 "Linux/SystemPlatformConfig.h",
485 "Linux/SystemTimeSupport.cpp",
Andrei Litvin6d06bee2021-02-19 16:04:04 -0500486 "Linux/bluez/AdapterIterator.cpp",
487 "Linux/bluez/AdapterIterator.h",
Andrei Litvin5ca73082021-02-25 11:53:45 -0500488 "Linux/bluez/ChipDeviceScanner.cpp",
489 "Linux/bluez/ChipDeviceScanner.h",
Andrei Litvin6d06bee2021-02-19 16:04:04 -0500490 "Linux/bluez/Helper.cpp",
491 "Linux/bluez/Helper.h",
Andrei Litvin5ca73082021-02-25 11:53:45 -0500492 "Linux/bluez/MainLoop.cpp",
493 "Linux/bluez/MainLoop.h",
Andrei Litvin6d06bee2021-02-19 16:04:04 -0500494 "Linux/bluez/Types.h",
Michael Spang8d085b32020-07-10 10:26:23 -0400495 ]
496
Kamil Kasperczyk44014022021-03-12 21:18:45 +0100497 if (chip_mdns != "none") {
Jiacheng Guo5de29292020-10-26 14:41:40 +0800498 sources += [
499 "Linux/MdnsImpl.cpp",
500 "Linux/MdnsImpl.h",
501 ]
502
503 public_configs += [ ":avahi_client_config" ]
504 }
505
Michael Spang8d085b32020-07-10 10:26:23 -0400506 if (chip_enable_openthread) {
507 sources += [
508 "Linux/ThreadStackManagerImpl.cpp",
509 "Linux/ThreadStackManagerImpl.h",
510 ]
Jiacheng Guo77817a72020-08-18 00:54:16 +0800511 public_deps += [ "${ot_br_posix_root}:ot_br_client" ]
Michael Spang8d085b32020-07-10 10:26:23 -0400512 }
513
Yufeng Wange78b3a72020-08-12 09:13:26 -0700514 if (chip_enable_wifi) {
yunhanw-google24132422020-09-08 12:33:16 -0700515 public_deps += [ "Linux/dbus/wpa" ]
516 }
517
518 if (chip_enable_ble) {
519 public_deps += [ "Linux/dbus/bluez" ]
Yufeng Wange78b3a72020-08-12 09:13:26 -0700520 }
521
Michael Spang8d085b32020-07-10 10:26:23 -0400522 public_deps += [ "${chip_root}/third_party/inipp" ]
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200523 } else if (chip_device_platform == "nrfconnect") {
Kedar Sovani8617e2a2020-08-30 02:33:21 +0530524 sources += [
Kamil Kasperczyk74c26962021-01-11 15:38:59 +0100525 "Zephyr/BLEManagerImpl.cpp",
526 "Zephyr/ConfigurationManagerImpl.cpp",
Kamil Kasperczykcb845e12021-02-15 21:36:35 +0100527 "Zephyr/KeyValueStoreManagerImpl.cpp",
Kamil Kasperczyk74c26962021-01-11 15:38:59 +0100528 "Zephyr/Logging.cpp",
529 "Zephyr/PlatformManagerImpl.cpp",
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200530 "Zephyr/SystemTimeSupport.cpp",
Kamil Kasperczyk74c26962021-01-11 15:38:59 +0100531 "Zephyr/ZephyrConfig.cpp",
532 "Zephyr/ZephyrConfig.h",
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200533 "nrfconnect/BLEManagerImpl.h",
534 "nrfconnect/BlePlatformConfig.h",
535 "nrfconnect/CHIPDevicePlatformConfig.h",
536 "nrfconnect/CHIPDevicePlatformEvent.h",
537 "nrfconnect/CHIPPlatformConfig.h",
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200538 "nrfconnect/ConfigurationManagerImpl.h",
539 "nrfconnect/ConnectivityManagerImpl.cpp",
540 "nrfconnect/ConnectivityManagerImpl.h",
Pankaj Garg4239bcf2020-10-27 08:41:54 -0700541 "nrfconnect/DeviceNetworkProvisioningDelegateImpl.cpp",
542 "nrfconnect/DeviceNetworkProvisioningDelegateImpl.h",
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200543 "nrfconnect/InetPlatformConfig.h",
Kamil Kasperczykcb845e12021-02-15 21:36:35 +0100544 "nrfconnect/KeyValueStoreManagerImpl.h",
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200545 "nrfconnect/PlatformManagerImpl.h",
546 "nrfconnect/SystemPlatformConfig.h",
Kedar Sovani8617e2a2020-08-30 02:33:21 +0530547 ]
Michael Spang3afd9932020-08-20 14:00:46 -0400548
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200549 if (chip_enable_openthread) {
jepenven-silabscec75ca2020-08-04 09:38:48 -0400550 sources += [
Michael Spang3afd9932020-08-20 14:00:46 -0400551 "OpenThread/OpenThreadUtils.cpp",
Kamil Kasperczyk74c26962021-01-11 15:38:59 +0100552 "Zephyr/ThreadStackManagerImpl.cpp",
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200553 "nrfconnect/ThreadStackManagerImpl.h",
jepenven-silabscec75ca2020-08-04 09:38:48 -0400554 ]
555 }
Timothy Maesb5b3d382020-10-05 16:59:21 +0200556 } else if (chip_device_platform == "qpg6100") {
557 sources += [
558 "FreeRTOS/SystemTimeSupport.cpp",
559 "qpg6100/BLEManagerImpl.cpp",
560 "qpg6100/BLEManagerImpl.h",
561 "qpg6100/BlePlatformConfig.h",
562 "qpg6100/CHIPDevicePlatformConfig.h",
563 "qpg6100/CHIPDevicePlatformEvent.h",
564 "qpg6100/CHIPPlatformConfig.h",
565 "qpg6100/ConfigurationManagerImpl.cpp",
566 "qpg6100/ConfigurationManagerImpl.h",
567 "qpg6100/ConnectivityManagerImpl.cpp",
568 "qpg6100/ConnectivityManagerImpl.h",
Timothy Maes872015b2021-01-13 16:02:14 +0100569 "qpg6100/DeviceNetworkProvisioningDelegateImpl.cpp",
Pankaj Garg4239bcf2020-10-27 08:41:54 -0700570 "qpg6100/DeviceNetworkProvisioningDelegateImpl.h",
Timothy Maesb5b3d382020-10-05 16:59:21 +0200571 "qpg6100/InetPlatformConfig.h",
572 "qpg6100/Logging.cpp",
573 "qpg6100/PlatformManagerImpl.cpp",
574 "qpg6100/PlatformManagerImpl.h",
575 "qpg6100/SystemPlatformConfig.h",
576 "qpg6100/qpg6100Config.cpp",
577 "qpg6100/qpg6100Config.h",
578 ]
579
Pankaj Garg9a791a82021-02-24 07:48:03 -0800580 sources += [
581 "qpg6100/KeyValueStoreManagerImpl.cpp",
582 "qpg6100/KeyValueStoreManagerImpl.h",
583 ]
584
Timothy Maesb5b3d382020-10-05 16:59:21 +0200585 if (chip_enable_openthread) {
Timothy Maes71c50192021-02-18 17:05:50 +0100586 public_deps += [ "${openthread_root}:libopenthread-ftd" ]
587
588 public_configs += [ "${chip_root}/third_party/openthread/platforms/qpg6100:openthread_qpg6100_config" ]
589
Timothy Maesb5b3d382020-10-05 16:59:21 +0200590 sources += [
591 "OpenThread/OpenThreadUtils.cpp",
592 "qpg6100/ThreadStackManagerImpl.cpp",
593 "qpg6100/ThreadStackManagerImpl.h",
594 ]
595 }
Michael Spangefa630b2020-07-08 22:23:08 -0400596 }
Michael Spangdb9b8612020-07-13 09:43:13 -0400597
Kamil Kasperczyk44014022021-03-12 21:18:45 +0100598 if (chip_enable_openthread && chip_mdns == "platform" &&
599 chip_device_platform != "linux") {
600 sources += [ "OpenThread/MdnsImpl.cpp" ]
601 }
602
Michael Spangdb9b8612020-07-13 09:43:13 -0400603 allow_circular_includes_from = [ "${chip_root}/src/lib/support" ]
Michael Spangefa630b2020-07-08 22:23:08 -0400604 }
Jiacheng Guod8f58a02020-08-19 00:23:40 +0800605} else if (chip_device_platform == "external") {
606 group("platform") {
607 public_deps = [ "${chip_platform_target}" ]
608 }
Michael Spangefa630b2020-07-08 22:23:08 -0400609} else {
610 group("platform") {
Jiacheng Guoe4ac46a2020-11-11 00:04:34 +0800611 public_deps = [ ":platform_buildconfig" ]
Michael Spangefa630b2020-07-08 22:23:08 -0400612 }
613}