Apply Upstream code (2021-03-15)
[platform/upstream/connectedhomeip.git] / src / platform / BUILD.gn
1 # 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
15 import("//build_overrides/build.gni")
16 import("//build_overrides/chip.gni")
17 import("//build_overrides/nlio.gni")
18 import("//build_overrides/pigweed.gni")
19
20 import("${build_root}/config/linux/pkg_config.gni")
21 import("${chip_root}/build/chip/buildconfig_header.gni")
22
23 import("device.gni")
24
25 if (chip_enable_openthread) {
26   import("//build_overrides/openthread.gni")
27
28   if (chip_device_platform == "linux" || chip_device_platform == "Darwin") {
29     import("//build_overrides/ot_br_posix.gni")
30   }
31 }
32
33 if (chip_device_platform == "linux" && chip_mdns != "none") {
34   pkg_config("avahi_client_config") {
35     packages = [ "avahi-client" ]
36   }
37 }
38
39 if (chip_device_platform != "none") {
40   declare_args() {
41     # Extra header to include in CHIPDeviceConfig.h for project.
42     chip_device_project_config_include = ""
43
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 = ""
49
50     # By pass provision and secure session
51     chip_bypass_rendezvous = false
52
53     # Enable including the additional data in the advertisement packets
54     chip_enable_additional_data_advertising = true
55
56     # Enable adding rotating device id to the additional data.
57     chip_enable_rotating_device_id = true
58   }
59
60   buildconfig_header("platform_buildconfig") {
61     header = "CHIPDeviceBuildConfig.h"
62     header_dir = "platform"
63
64     chip_with_gio = chip_enable_wifi
65     chip_device_config_enable_wpa = chip_enable_wifi
66
67     defines = [
68       "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
74     if (chip_device_platform == "linux" || chip_device_platform == "darwin") {
75       defines += [ "CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=${chip_enable_ble}" ]
76     }
77
78     if (chip_mdns != "none") {
79       defines += [ "CHIP_DEVICE_CONFIG_ENABLE_MDNS=1" ]
80     }
81
82     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
89     if (chip_device_config_firmware_build_date != "") {
90       defines += [ "CHIP_DEVICE_CONFIG_FIRWMARE_BUILD_DATE=\"${chip_device_config_firmware_build_date}\"" ]
91     }
92     if (chip_device_config_firmware_build_time != "") {
93       defines += [ "CHIP_DEVICE_CONFIG_FIRMWARE_BUILD_TIME=\"${chip_device_config_firmware_build_time}\"" ]
94     }
95
96     if (chip_bypass_rendezvous) {
97       defines += [ "CHIP_BYPASS_RENDEZVOUS=1" ]
98     }
99
100     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
106     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
112     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") {
118       defines += [
119         "CHIP_DEVICE_LAYER_TARGET_DARWIN=1",
120         "CHIP_DEVICE_LAYER_TARGET=Darwin",
121       ]
122     } 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       ]
132     } else if (chip_device_platform == "linux") {
133       defines += [
134         "CHIP_DEVICE_LAYER_TARGET_LINUX=1",
135         "CHIP_DEVICE_LAYER_TARGET=Linux",
136       ]
137     } else if (chip_device_platform == "nrfconnect") {
138       defines += [
139         "CHIP_DEVICE_LAYER_TARGET_NRFCONNECT=1",
140         "CHIP_DEVICE_LAYER_TARGET=nrfconnect",
141       ]
142     } else if (chip_device_platform == "qpg6100") {
143       defines += [
144         "CHIP_DEVICE_LAYER_TARGET_QPG6100=1",
145         "CHIP_DEVICE_LAYER_TARGET=qpg6100",
146       ]
147     } else if (chip_device_platform == "k32w") {
148       defines += [
149         "CHIP_DEVICE_LAYER_TARGET_K32W=1",
150         "CHIP_DEVICE_LAYER_TARGET=K32W",
151       ]
152     }
153   }
154 } 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   }
164 }
165
166 if (chip_device_platform != "none" && chip_device_platform != "external") {
167   config("platform_config") {
168     if (chip_device_platform == "darwin") {
169       frameworks = [
170         "CoreFoundation.framework",
171         "CoreBluetooth.framework",
172         "Foundation.framework",
173       ]
174     }
175   }
176
177   static_library("platform") {
178     output_name = "libDeviceLayer"
179
180     sources = [
181       "../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",
188       "../include/platform/KeyValueStoreManager.h",
189       "../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",
199       "../include/platform/internal/DeviceNetworkProvisioning.h",
200       "../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",
206       "../include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h",
207       "../include/platform/internal/GenericConnectivityManagerImpl_Thread.h",
208       "../include/platform/internal/GenericConnectivityManagerImpl_WiFi.h",
209       "../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",
217       "GeneralUtils.cpp",
218       "Globals.cpp",
219       "PersistedStorage.cpp",
220       "SystemEventSupport.cpp",
221       "SystemTimerSupport.cpp",
222       "TestIdentity.cpp",
223     ]
224
225     cflags = [ "-Wconversion" ]
226
227     public_deps = [
228       ":platform_buildconfig",
229       "${chip_root}/src/ble",
230       "${chip_root}/src/inet",
231       "${chip_root}/src/lib/core",
232       "${chip_root}/src/lib/core:chip_config_header",
233       "${chip_root}/src/lib/support",
234       "${chip_root}/src/platform/logging:headers",
235       "${chip_root}/src/setup_payload",
236       "${nlio_root}:nlio",
237     ]
238
239     public_configs = [
240       ":platform_config",
241       "${chip_root}/src:includes",
242     ]
243
244     if (chip_mdns != "none") {
245       public_deps += [ "${chip_root}/src/lib/mdns:platform_header" ]
246     }
247
248     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",
260         "cc13x2_26x2/DeviceNetworkProvisioningDelegateImpl.cpp",
261         "cc13x2_26x2/DeviceNetworkProvisioningDelegateImpl.h",
262         "cc13x2_26x2/InetPlatformConfig.h",
263         "cc13x2_26x2/KeyValueStoreManagerImpl.cpp",
264         "cc13x2_26x2/KeyValueStoreManagerImpl.h",
265         "cc13x2_26x2/Logging.cpp",
266         "cc13x2_26x2/PlatformManagerImpl.cpp",
267         "cc13x2_26x2/PlatformManagerImpl.h",
268         "cc13x2_26x2/SystemPlatformConfig.h",
269       ]
270
271       if (chip_enable_ble) {
272         sources += [
273           "cc13x2_26x2/BLEManagerImpl.cpp",
274           "cc13x2_26x2/BLEManagerImpl.h",
275         ]
276       }
277
278       if (chip_enable_openthread) {
279         # needed for MTD/FTD
280         import("//build_overrides/ti_simplelink_sdk.gni")
281         import("${ti_simplelink_sdk_build_root}/ti_simplelink_board.gni")
282         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",
286         ]
287
288         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
294         sources += [
295           "OpenThread/OpenThreadUtils.cpp",
296           "cc13x2_26x2/ThreadStackManagerImpl.cpp",
297           "cc13x2_26x2/ThreadStackManagerImpl.h",
298         ]
299       }
300     } else if (chip_device_platform == "darwin") {
301       sources += [
302         "Darwin/BLEManagerImpl.cpp",
303         "Darwin/BLEManagerImpl.h",
304         "Darwin/BlePlatformConfig.h",
305         "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",
313         "Darwin/Logging.cpp",
314         "Darwin/PlatformManagerImpl.cpp",
315         "Darwin/PlatformManagerImpl.h",
316         "Darwin/PosixConfig.cpp",
317         "Darwin/PosixConfig.h",
318         "Darwin/SystemPlatformConfig.h",
319       ]
320
321       sources += [
322         "Darwin/KeyValueStoreManagerImpl.cpp",
323         "Darwin/KeyValueStoreManagerImpl.h",
324       ]
325
326       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",
334           "Darwin/UUIDHelper.h",
335           "Darwin/UUIDHelperImpl.mm",
336         ]
337       }
338     } 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",
350         "EFR32/DeviceNetworkProvisioningDelegateImpl.cpp",
351         "EFR32/DeviceNetworkProvisioningDelegateImpl.h",
352         "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       ]
365
366       # Add pigweed KVS
367       deps = [
368         "$dir_pw_kvs:crc16",
369         "$dir_pw_log",
370       ]
371       public_deps += [
372         "$dir_pw_checksum",
373         "$dir_pw_kvs",
374       ]
375       sources += [
376         "EFR32/KeyValueStoreManagerImpl.cpp",
377         "EFR32/KeyValueStoreManagerImpl.h",
378       ]
379
380       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 += [
391         "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",
398         "ESP32/DeviceNetworkProvisioningDelegateImpl.cpp",
399         "ESP32/DeviceNetworkProvisioningDelegateImpl.h",
400         "ESP32/ESP32Config.cpp",
401         "ESP32/ESP32Config.h",
402         "ESP32/ESP32Utils.cpp",
403         "ESP32/ESP32Utils.h",
404         "ESP32/KeyValueStoreManagerImpl.cpp",
405         "ESP32/KeyValueStoreManagerImpl.h",
406         "ESP32/Logging.cpp",
407         "ESP32/LwIPCoreLock.cpp",
408         "ESP32/MdnsImpl.cpp",
409         "ESP32/NetworkProvisioningServerImpl.h",
410         "ESP32/PlatformManagerImpl.cpp",
411         "ESP32/PlatformManagerImpl.h",
412         "ESP32/ServiceProvisioning.cpp",
413         "ESP32/ServiceProvisioning.h",
414         "ESP32/SoftwareUpdateManagerImpl.h",
415         "ESP32/SystemTimeSupport.cpp",
416         "ESP32/bluedroid/BLEManagerImpl.cpp",
417         "ESP32/nimble/BLEManagerImpl.cpp",
418         "FreeRTOS/SystemTimeSupport.cpp",
419       ]
420
421       public_deps += [ "${chip_root}/src/crypto" ]
422     } 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",
433         "K32W/DeviceNetworkProvisioningDelegateImpl.cpp",
434         "K32W/DeviceNetworkProvisioningDelegateImpl.h",
435         "K32W/K32WConfig.cpp",
436         "K32W/K32WConfig.h",
437         "K32W/KeyValueStoreManagerImpl.cpp",
438         "K32W/KeyValueStoreManagerImpl.h",
439         "K32W/Logging.cpp",
440         "K32W/NetworkProvisioningServerImpl.h",
441         "K32W/PlatformManagerImpl.cpp",
442         "K32W/PlatformManagerImpl.h",
443         "K32W/SoftwareUpdateManagerImpl.h",
444         "K32W/ble_function_mux.c",
445       ]
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       }
456
457       public_deps += [ "${chip_root}/src/crypto" ]
458     } else if (chip_device_platform == "linux") {
459       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",
474         "Linux/DeviceNetworkProvisioningDelegateImpl.cpp",
475         "Linux/DeviceNetworkProvisioningDelegateImpl.h",
476         "Linux/InetPlatformConfig.h",
477         "Linux/KeyValueStoreManagerImpl.cpp",
478         "Linux/KeyValueStoreManagerImpl.h",
479         "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",
486         "Linux/bluez/AdapterIterator.cpp",
487         "Linux/bluez/AdapterIterator.h",
488         "Linux/bluez/ChipDeviceScanner.cpp",
489         "Linux/bluez/ChipDeviceScanner.h",
490         "Linux/bluez/Helper.cpp",
491         "Linux/bluez/Helper.h",
492         "Linux/bluez/MainLoop.cpp",
493         "Linux/bluez/MainLoop.h",
494         "Linux/bluez/Types.h",
495       ]
496
497       if (chip_mdns != "none") {
498         sources += [
499           "Linux/MdnsImpl.cpp",
500           "Linux/MdnsImpl.h",
501         ]
502
503         public_configs += [ ":avahi_client_config" ]
504       }
505
506       if (chip_enable_openthread) {
507         sources += [
508           "Linux/ThreadStackManagerImpl.cpp",
509           "Linux/ThreadStackManagerImpl.h",
510         ]
511         public_deps += [ "${ot_br_posix_root}:ot_br_client" ]
512       }
513
514       if (chip_enable_wifi) {
515         public_deps += [ "Linux/dbus/wpa" ]
516       }
517
518       if (chip_enable_ble) {
519         public_deps += [ "Linux/dbus/bluez" ]
520       }
521
522       public_deps += [ "${chip_root}/third_party/inipp" ]
523     } else if (chip_device_platform == "nrfconnect") {
524       sources += [
525         "Zephyr/BLEManagerImpl.cpp",
526         "Zephyr/ConfigurationManagerImpl.cpp",
527         "Zephyr/KeyValueStoreManagerImpl.cpp",
528         "Zephyr/Logging.cpp",
529         "Zephyr/PlatformManagerImpl.cpp",
530         "Zephyr/SystemTimeSupport.cpp",
531         "Zephyr/ZephyrConfig.cpp",
532         "Zephyr/ZephyrConfig.h",
533         "nrfconnect/BLEManagerImpl.h",
534         "nrfconnect/BlePlatformConfig.h",
535         "nrfconnect/CHIPDevicePlatformConfig.h",
536         "nrfconnect/CHIPDevicePlatformEvent.h",
537         "nrfconnect/CHIPPlatformConfig.h",
538         "nrfconnect/ConfigurationManagerImpl.h",
539         "nrfconnect/ConnectivityManagerImpl.cpp",
540         "nrfconnect/ConnectivityManagerImpl.h",
541         "nrfconnect/DeviceNetworkProvisioningDelegateImpl.cpp",
542         "nrfconnect/DeviceNetworkProvisioningDelegateImpl.h",
543         "nrfconnect/InetPlatformConfig.h",
544         "nrfconnect/KeyValueStoreManagerImpl.h",
545         "nrfconnect/PlatformManagerImpl.h",
546         "nrfconnect/SystemPlatformConfig.h",
547       ]
548
549       if (chip_enable_openthread) {
550         sources += [
551           "OpenThread/OpenThreadUtils.cpp",
552           "Zephyr/ThreadStackManagerImpl.cpp",
553           "nrfconnect/ThreadStackManagerImpl.h",
554         ]
555       }
556     } 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",
569         "qpg6100/DeviceNetworkProvisioningDelegateImpl.cpp",
570         "qpg6100/DeviceNetworkProvisioningDelegateImpl.h",
571         "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
580       sources += [
581         "qpg6100/KeyValueStoreManagerImpl.cpp",
582         "qpg6100/KeyValueStoreManagerImpl.h",
583       ]
584
585       if (chip_enable_openthread) {
586         public_deps += [ "${openthread_root}:libopenthread-ftd" ]
587
588         public_configs += [ "${chip_root}/third_party/openthread/platforms/qpg6100:openthread_qpg6100_config" ]
589
590         sources += [
591           "OpenThread/OpenThreadUtils.cpp",
592           "qpg6100/ThreadStackManagerImpl.cpp",
593           "qpg6100/ThreadStackManagerImpl.h",
594         ]
595       }
596     }
597
598     if (chip_enable_openthread && chip_mdns == "platform" &&
599         chip_device_platform != "linux") {
600       sources += [ "OpenThread/MdnsImpl.cpp" ]
601     }
602
603     allow_circular_includes_from = [ "${chip_root}/src/lib/support" ]
604   }
605 } else if (chip_device_platform == "external") {
606   group("platform") {
607     public_deps = [ "${chip_platform_target}" ]
608   }
609 } else {
610   group("platform") {
611     public_deps = [ ":platform_buildconfig" ]
612   }
613 }