Fix for x86_64 build fail
[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 # TIZEN_CHIP_MODIFY
16
17 import("//build_overrides/build.gni")
18 import("//build_overrides/chip.gni")
19 import("//build_overrides/nlio.gni")
20 import("//build_overrides/pigweed.gni")
21
22 import("${build_root}/config/linux/pkg_config.gni")
23 import("${chip_root}/build/chip/buildconfig_header.gni")
24
25 import("device.gni")
26
27 if (chip_enable_openthread) {
28   import("//build_overrides/openthread.gni")
29
30   if (chip_device_platform == "linux" || chip_device_platform == "Darwin" || chip_device_platform == "tizen") {
31     import("//build_overrides/ot_br_posix.gni")
32   }
33 }
34
35 if (chip_device_platform == "linux" && chip_mdns != "none") {
36   pkg_config("avahi_client_config") {
37     packages = [ "avahi-client" ]
38   }
39 }
40
41 if (chip_device_platform == "tizen" && chip_mdns != "none") {
42   pkg_config("dns_sd") {
43     packages = [ "dns_sd" ]
44   }
45 }
46
47 if (chip_device_platform != "none") {
48   declare_args() {
49     # Extra header to include in CHIPDeviceConfig.h for project.
50     chip_device_project_config_include = ""
51
52     # Date the firmware was built.
53     chip_device_config_firmware_build_date = ""
54
55     # Time the firmware was built.
56     chip_device_config_firmware_build_time = ""
57
58     # By pass provision and secure session
59     chip_bypass_rendezvous = false
60
61     # Enable including the additional data in the advertisement packets
62     chip_enable_additional_data_advertising = true
63
64     # Enable adding rotating device id to the additional data.
65     chip_enable_rotating_device_id = false
66   }
67
68   buildconfig_header("platform_buildconfig") {
69     header = "CHIPDeviceBuildConfig.h"
70     header_dir = "platform"
71
72     chip_with_gio = chip_enable_wifi
73     chip_device_config_enable_wpa = chip_enable_wifi
74
75     defines = [
76       "CHIP_DEVICE_CONFIG_ENABLE_WPA=${chip_device_config_enable_wpa}",
77       "CHIP_ENABLE_OPENTHREAD=${chip_enable_openthread}",
78       "CHIP_WITH_GIO=${chip_with_gio}",
79       "OPENTHREAD_CONFIG_ENABLE_TOBLE=false",
80     ]
81
82     if (chip_device_platform == "linux" || chip_device_platform == "darwin" || chip_device_platform == "tizen") {
83       defines += [ "CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=${chip_enable_ble}" ]
84     }
85
86     if (chip_mdns != "none") {
87       defines += [ "CHIP_DEVICE_CONFIG_ENABLE_MDNS=1" ]
88     }
89
90     if (chip_device_project_config_include != "") {
91       defines += [ "CHIP_DEVICE_PROJECT_CONFIG_INCLUDE=${chip_device_project_config_include}" ]
92     }
93     if (chip_device_platform_config_include != "") {
94       defines += [ "CHIP_DEVICE_PLATFORM_CONFIG_INCLUDE=${chip_device_platform_config_include}" ]
95     }
96
97     if (chip_device_config_firmware_build_date != "") {
98       defines += [ "CHIP_DEVICE_CONFIG_FIRWMARE_BUILD_DATE=\"${chip_device_config_firmware_build_date}\"" ]
99     }
100     if (chip_device_config_firmware_build_time != "") {
101       defines += [ "CHIP_DEVICE_CONFIG_FIRMWARE_BUILD_TIME=\"${chip_device_config_firmware_build_time}\"" ]
102     }
103
104     if (chip_bypass_rendezvous) {
105       defines += [ "CHIP_BYPASS_RENDEZVOUS=1" ]
106     }
107
108     if (chip_enable_additional_data_advertising) {
109       defines += [ "CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING=1" ]
110     } else {
111       defines += [ "CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING=0" ]
112     }
113
114     if (chip_enable_rotating_device_id) {
115       defines += [ "CHIP_ENABLE_ROTATING_DEVICE_ID=1" ]
116     } else {
117       defines += [ "CHIP_ENABLE_ROTATING_DEVICE_ID=0" ]
118     }
119
120     if (chip_device_platform == "cc13x2_26x2") {
121       defines += [
122         "CHIP_DEVICE_LAYER_TARGET_CC13X2_26X2=1",
123         "CHIP_DEVICE_LAYER_TARGET=cc13x2_26x2",
124       ]
125     } else if (chip_device_platform == "darwin") {
126       defines += [
127         "CHIP_DEVICE_LAYER_TARGET_DARWIN=1",
128         "CHIP_DEVICE_LAYER_TARGET=Darwin",
129       ]
130     } else if (chip_device_platform == "efr32") {
131       defines += [
132         "CHIP_DEVICE_LAYER_TARGET_EFR32=1",
133         "CHIP_DEVICE_LAYER_TARGET=EFR32",
134       ]
135     } else if (chip_device_platform == "esp32") {
136       defines += [
137         "CHIP_DEVICE_LAYER_TARGET_ESP32=1",
138         "CHIP_DEVICE_LAYER_TARGET=ESP32",
139       ]
140     } else if (chip_device_platform == "linux") {
141       defines += [
142         "CHIP_DEVICE_LAYER_TARGET_LINUX=1",
143         "CHIP_DEVICE_LAYER_TARGET=Linux",
144       ]
145     } else if (chip_device_platform == "tizen") {
146       defines += [
147         "CHIP_DEVICE_LAYER_TARGET_TIZEN=1",
148         "CHIP_DEVICE_LAYER_TARGET=Tizen",
149       ]
150     } else if (chip_device_platform == "nrfconnect") {
151       defines += [
152         "CHIP_DEVICE_LAYER_TARGET_NRFCONNECT=1",
153         "CHIP_DEVICE_LAYER_TARGET=nrfconnect",
154       ]
155     } else if (chip_device_platform == "qpg6100") {
156       defines += [
157         "CHIP_DEVICE_LAYER_TARGET_QPG6100=1",
158         "CHIP_DEVICE_LAYER_TARGET=qpg6100",
159       ]
160     } else if (chip_device_platform == "k32w") {
161       defines += [
162         "CHIP_DEVICE_LAYER_TARGET_K32W=1",
163         "CHIP_DEVICE_LAYER_TARGET=K32W",
164       ]
165     }
166   }
167 } else {
168   buildconfig_header("platform_buildconfig") {
169     header = "CHIPDeviceBuildConfig.h"
170     header_dir = "platform"
171
172     defines = [
173       "CHIP_DEVICE_LAYER_NONE=1",
174       "CHIP_DEVICE_LAYER_TARGET=NONE",
175     ]
176   }
177 }
178
179 if (chip_device_platform != "none" && chip_device_platform != "external") {
180   config("platform_config") {
181     if (chip_device_platform == "darwin") {
182       frameworks = [
183         "CoreFoundation.framework",
184         "CoreBluetooth.framework",
185         "Foundation.framework",
186       ]
187     }
188   }
189
190   static_library("platform") {
191     output_name = "libDeviceLayer"
192
193     sources = [
194       "../include/platform/CHIPDeviceConfig.h",
195       "../include/platform/CHIPDeviceError.h",
196       "../include/platform/CHIPDeviceEvent.h",
197       "../include/platform/CHIPDeviceLayer.h",
198       "../include/platform/ConfigurationManager.h",
199       "../include/platform/ConnectivityManager.h",
200       "../include/platform/GeneralUtils.h",
201       "../include/platform/KeyValueStoreManager.h",
202       "../include/platform/PersistedStorage.h",
203       "../include/platform/PlatformManager.h",
204       "../include/platform/SoftwareUpdateManager.h",
205       "../include/platform/SoftwareUpdateManagerImpl.h",
206       "../include/platform/ThreadStackManager.h",
207       "../include/platform/TimeSyncManager.h",
208       "../include/platform/internal/BLEManager.h",
209       "../include/platform/internal/CHIPDeviceLayerInternal.h",
210       "../include/platform/internal/DeviceDescriptionServer.h",
211       "../include/platform/internal/DeviceNetworkInfo.h",
212       "../include/platform/internal/DeviceNetworkProvisioning.h",
213       "../include/platform/internal/EventLogging.h",
214       "../include/platform/internal/GenericConfigurationManagerImpl.h",
215       "../include/platform/internal/GenericConnectivityManagerImpl.h",
216       "../include/platform/internal/GenericConnectivityManagerImpl_BLE.h",
217       "../include/platform/internal/GenericConnectivityManagerImpl_NoBLE.h",
218       "../include/platform/internal/GenericConnectivityManagerImpl_NoThread.h",
219       "../include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h",
220       "../include/platform/internal/GenericConnectivityManagerImpl_Thread.h",
221       "../include/platform/internal/GenericConnectivityManagerImpl_WiFi.h",
222       "../include/platform/internal/GenericPlatformManagerImpl.h",
223       "../include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.h",
224       "../include/platform/internal/GenericPlatformManagerImpl_POSIX.h",
225       "../include/platform/internal/GenericSoftwareUpdateManagerImpl.h",
226       "../include/platform/internal/GenericSoftwareUpdateManagerImpl_BDX.h",
227       "../include/platform/internal/testing/ConfigUnitTest.h",
228       "GeneralUtils.cpp",
229       "Globals.cpp",
230       "PersistedStorage.cpp",
231       "SystemEventSupport.cpp",
232       "SystemTimerSupport.cpp",
233       "TestIdentity.cpp",
234     ]
235
236     cflags = [ "-Wconversion" ]
237
238     public_deps = [
239       ":platform_buildconfig",
240       "${chip_root}/src/ble",
241       "${chip_root}/src/inet",
242       "${chip_root}/src/lib/core",
243       "${chip_root}/src/lib/core:chip_config_header",
244       "${chip_root}/src/lib/support",
245       "${chip_root}/src/platform/logging:headers",
246       "${chip_root}/src/setup_payload",
247       "${nlio_root}:nlio",
248     ]
249
250     public_configs = [
251       ":platform_config",
252       "${chip_root}/src:includes",
253     ]
254
255     if (chip_mdns != "none") {
256       public_deps += [ "${chip_root}/src/lib/mdns:platform_header" ]
257     }
258
259     if (chip_device_platform == "cc13x2_26x2") {
260       sources += [
261         "FreeRTOS/SystemTimeSupport.cpp",
262         "cc13x2_26x2/BlePlatformConfig.h",
263         "cc13x2_26x2/CC13X2_26X2Config.cpp",
264         "cc13x2_26x2/CC13X2_26X2Config.h",
265         "cc13x2_26x2/CHIPDevicePlatformConfig.h",
266         "cc13x2_26x2/CHIPDevicePlatformConfig.h",
267         "cc13x2_26x2/CHIPDevicePlatformEvent.h",
268         "cc13x2_26x2/ConfigurationManagerImpl.cpp",
269         "cc13x2_26x2/ConnectivityManagerImpl.cpp",
270         "cc13x2_26x2/ConnectivityManagerImpl.h",
271         "cc13x2_26x2/DeviceNetworkProvisioningDelegateImpl.cpp",
272         "cc13x2_26x2/DeviceNetworkProvisioningDelegateImpl.h",
273         "cc13x2_26x2/InetPlatformConfig.h",
274         "cc13x2_26x2/KeyValueStoreManagerImpl.cpp",
275         "cc13x2_26x2/KeyValueStoreManagerImpl.h",
276         "cc13x2_26x2/Logging.cpp",
277         "cc13x2_26x2/PlatformManagerImpl.cpp",
278         "cc13x2_26x2/PlatformManagerImpl.h",
279         "cc13x2_26x2/SystemPlatformConfig.h",
280       ]
281
282       if (chip_enable_ble) {
283         sources += [
284           "cc13x2_26x2/BLEManagerImpl.cpp",
285           "cc13x2_26x2/BLEManagerImpl.h",
286         ]
287       }
288
289       if (chip_enable_openthread) {
290         # needed for MTD/FTD
291         import("//build_overrides/ti_simplelink_sdk.gni")
292         import("${ti_simplelink_sdk_build_root}/ti_simplelink_board.gni")
293         public_deps += [
294           "${chip_root}/third_party/ti_simplelink_sdk:mbedtls",
295           "${chip_root}/third_party/ti_simplelink_sdk:ti_simplelink_sdk",
296           "${chip_root}/third_party/ti_simplelink_sdk:ti_simplelink_sysconfig",
297         ]
298
299         if (ti_simplelink_device_family == "cc13x2_26x2") {
300           public_deps += [ "${openthread_root}:libopenthread-mtd" ]
301         } else if (ti_simplelink_device_family == "cc13x2x7_26x2x7") {
302           public_deps += [ "${openthread_root}:libopenthread-ftd" ]
303         }
304
305         sources += [
306           "OpenThread/OpenThreadUtils.cpp",
307           "cc13x2_26x2/ThreadStackManagerImpl.cpp",
308           "cc13x2_26x2/ThreadStackManagerImpl.h",
309         ]
310       }
311     } else if (chip_device_platform == "darwin") {
312       sources += [
313         "Darwin/BLEManagerImpl.cpp",
314         "Darwin/BLEManagerImpl.h",
315         "Darwin/BlePlatformConfig.h",
316         "Darwin/CHIPDevicePlatformConfig.h",
317         "Darwin/CHIPDevicePlatformEvent.h",
318         "Darwin/CHIPPlatformConfig.h",
319         "Darwin/ConfigurationManagerImpl.cpp",
320         "Darwin/ConfigurationManagerImpl.h",
321         "Darwin/ConnectivityManagerImpl.cpp",
322         "Darwin/ConnectivityManagerImpl.h",
323         "Darwin/InetPlatformConfig.h",
324         "Darwin/Logging.cpp",
325         "Darwin/MdnsError.cpp",
326         "Darwin/MdnsError.h",
327         "Darwin/MdnsImpl.cpp",
328         "Darwin/MdnsImpl.h",
329         "Darwin/PlatformManagerImpl.cpp",
330         "Darwin/PlatformManagerImpl.h",
331         "Darwin/PosixConfig.cpp",
332         "Darwin/PosixConfig.h",
333         "Darwin/SystemPlatformConfig.h",
334       ]
335
336       sources += [
337         "Darwin/KeyValueStoreManagerImpl.cpp",
338         "Darwin/KeyValueStoreManagerImpl.h",
339       ]
340
341       if (chip_enable_ble) {
342         sources += [
343           "Darwin/BleApplicationDelegate.h",
344           "Darwin/BleApplicationDelegateImpl.mm",
345           "Darwin/BleConnectionDelegate.h",
346           "Darwin/BleConnectionDelegateImpl.mm",
347           "Darwin/BlePlatformDelegate.h",
348           "Darwin/BlePlatformDelegateImpl.mm",
349           "Darwin/UUIDHelper.h",
350           "Darwin/UUIDHelperImpl.mm",
351         ]
352       }
353     } else if (chip_device_platform == "efr32") {
354       sources += [
355         "EFR32/BLEManagerImpl.cpp",
356         "EFR32/BLEManagerImpl.h",
357         "EFR32/BlePlatformConfig.h",
358         "EFR32/CHIPDevicePlatformConfig.h",
359         "EFR32/CHIPDevicePlatformEvent.h",
360         "EFR32/CHIPPlatformConfig.h",
361         "EFR32/ConfigurationManagerImpl.cpp",
362         "EFR32/ConfigurationManagerImpl.h",
363         "EFR32/ConnectivityManagerImpl.cpp",
364         "EFR32/ConnectivityManagerImpl.h",
365         "EFR32/DeviceNetworkProvisioningDelegateImpl.cpp",
366         "EFR32/DeviceNetworkProvisioningDelegateImpl.h",
367         "EFR32/EFR32Config.cpp",
368         "EFR32/EFR32Config.h",
369         "EFR32/InetPlatformConfig.h",
370         "EFR32/Logging.cpp",
371         "EFR32/PlatformManagerImpl.cpp",
372         "EFR32/PlatformManagerImpl.h",
373         "EFR32/SystemPlatformConfig.h",
374         "EFR32/freertos_bluetooth.c",
375         "EFR32/freertos_bluetooth.h",
376         "EFR32/gatt_db.c",
377         "EFR32/gatt_db.h",
378         "FreeRTOS/SystemTimeSupport.cpp",
379       ]
380
381       # Add pigweed KVS
382       deps = [
383         "$dir_pw_kvs:crc16",
384         "$dir_pw_log",
385       ]
386       public_deps += [
387         "$dir_pw_checksum",
388         "$dir_pw_kvs",
389       ]
390       sources += [
391         "EFR32/KeyValueStoreManagerImpl.cpp",
392         "EFR32/KeyValueStoreManagerImpl.h",
393       ]
394
395       if (chip_enable_openthread) {
396         public_deps += [ "${openthread_root}:libopenthread-ftd" ]
397
398         sources += [
399           "EFR32/ThreadStackManagerImpl.cpp",
400           "EFR32/ThreadStackManagerImpl.h",
401           "OpenThread/OpenThreadUtils.cpp",
402         ]
403       }
404     } else if (chip_device_platform == "esp32") {
405       sources += [
406         "ESP32/BLEManagerImpl.h",
407         "ESP32/CHIPDevicePlatformConfig.h",
408         "ESP32/CHIPDevicePlatformEvent.h",
409         "ESP32/ConfigurationManagerImpl.cpp",
410         "ESP32/ConfigurationManagerImpl.h",
411         "ESP32/ConnectivityManagerImpl.cpp",
412         "ESP32/ConnectivityManagerImpl.h",
413         "ESP32/DeviceNetworkProvisioningDelegateImpl.cpp",
414         "ESP32/DeviceNetworkProvisioningDelegateImpl.h",
415         "ESP32/ESP32Config.cpp",
416         "ESP32/ESP32Config.h",
417         "ESP32/ESP32Utils.cpp",
418         "ESP32/ESP32Utils.h",
419         "ESP32/KeyValueStoreManagerImpl.cpp",
420         "ESP32/KeyValueStoreManagerImpl.h",
421         "ESP32/Logging.cpp",
422         "ESP32/LwIPCoreLock.cpp",
423         "ESP32/MdnsImpl.cpp",
424         "ESP32/PlatformManagerImpl.cpp",
425         "ESP32/PlatformManagerImpl.h",
426         "ESP32/ServiceProvisioning.cpp",
427         "ESP32/ServiceProvisioning.h",
428         "ESP32/SoftwareUpdateManagerImpl.h",
429         "ESP32/SystemTimeSupport.cpp",
430         "ESP32/bluedroid/BLEManagerImpl.cpp",
431         "ESP32/nimble/BLEManagerImpl.cpp",
432         "FreeRTOS/SystemTimeSupport.cpp",
433       ]
434
435       public_deps += [ "${chip_root}/src/crypto" ]
436     } else if (chip_device_platform == "k32w") {
437       sources += [
438         "FreeRTOS/SystemTimeSupport.cpp",
439         "K32W/BLEManagerImpl.cpp",
440         "K32W/BLEManagerImpl.h",
441         "K32W/CHIPDevicePlatformConfig.h",
442         "K32W/CHIPDevicePlatformEvent.h",
443         "K32W/ConfigurationManagerImpl.cpp",
444         "K32W/ConfigurationManagerImpl.h",
445         "K32W/ConnectivityManagerImpl.cpp",
446         "K32W/ConnectivityManagerImpl.h",
447         "K32W/DeviceNetworkProvisioningDelegateImpl.cpp",
448         "K32W/DeviceNetworkProvisioningDelegateImpl.h",
449         "K32W/K32WConfig.cpp",
450         "K32W/K32WConfig.h",
451         "K32W/KeyValueStoreManagerImpl.cpp",
452         "K32W/KeyValueStoreManagerImpl.h",
453         "K32W/Logging.cpp",
454         "K32W/PlatformManagerImpl.cpp",
455         "K32W/PlatformManagerImpl.h",
456         "K32W/SoftwareUpdateManagerImpl.h",
457         "K32W/ble_function_mux.c",
458       ]
459
460       if (chip_enable_openthread) {
461         public_deps += [ "${openthread_root}:libopenthread-ftd" ]
462
463         sources += [
464           "K32W/ThreadStackManagerImpl.cpp",
465           "K32W/ThreadStackManagerImpl.h",
466           "OpenThread/OpenThreadUtils.cpp",
467         ]
468       }
469
470       public_deps += [ "${chip_root}/src/crypto" ]
471     } else if (chip_device_platform == "linux") {
472       sources += [
473         "Linux/BLEManagerImpl.cpp",
474         "Linux/BLEManagerImpl.h",
475         "Linux/BlePlatformConfig.h",
476         "Linux/CHIPDevicePlatformConfig.h",
477         "Linux/CHIPDevicePlatformEvent.h",
478         "Linux/CHIPLinuxStorage.cpp",
479         "Linux/CHIPLinuxStorage.h",
480         "Linux/CHIPLinuxStorageIni.cpp",
481         "Linux/CHIPLinuxStorageIni.h",
482         "Linux/CHIPPlatformConfig.h",
483         "Linux/ConfigurationManagerImpl.cpp",
484         "Linux/ConfigurationManagerImpl.h",
485         "Linux/ConnectivityManagerImpl.cpp",
486         "Linux/ConnectivityManagerImpl.h",
487         "Linux/DeviceNetworkProvisioningDelegateImpl.cpp",
488         "Linux/DeviceNetworkProvisioningDelegateImpl.h",
489         "Linux/InetPlatformConfig.h",
490         "Linux/KeyValueStoreManagerImpl.cpp",
491         "Linux/KeyValueStoreManagerImpl.h",
492         "Linux/Logging.cpp",
493         "Linux/PlatformManagerImpl.cpp",
494         "Linux/PlatformManagerImpl.h",
495         "Linux/PosixConfig.cpp",
496         "Linux/PosixConfig.h",
497         "Linux/SystemPlatformConfig.h",
498         "Linux/SystemTimeSupport.cpp",
499         "Linux/bluez/AdapterIterator.cpp",
500         "Linux/bluez/AdapterIterator.h",
501         "Linux/bluez/ChipDeviceScanner.cpp",
502         "Linux/bluez/ChipDeviceScanner.h",
503         "Linux/bluez/Helper.cpp",
504         "Linux/bluez/Helper.h",
505         "Linux/bluez/MainLoop.cpp",
506         "Linux/bluez/MainLoop.h",
507         "Linux/bluez/Types.h",
508       ]
509
510       if (chip_mdns != "none") {
511         sources += [
512           "Linux/MdnsImpl.cpp",
513           "Linux/MdnsImpl.h",
514         ]
515
516         public_configs += [ ":avahi_client_config" ]
517       }
518
519       if (chip_enable_openthread) {
520         sources += [
521           "Linux/ThreadStackManagerImpl.cpp",
522           "Linux/ThreadStackManagerImpl.h",
523         ]
524         public_deps += [ "${ot_br_posix_root}:ot_br_client" ]
525       }
526
527       if (chip_enable_wifi) {
528         public_deps += [ "Linux/dbus/wpa" ]
529       }
530
531       if (chip_enable_ble) {
532         public_deps += [ "Linux/dbus/bluez" ]
533       }
534
535       public_deps += [ "${chip_root}/third_party/inipp" ]
536     } else if (chip_device_platform == "tizen") {
537       sources += [
538         "Tizen/BLEManagerImpl.cpp",
539         "Tizen/BLEManagerImpl.h",
540         "Tizen/BlePlatformConfig.h",
541         "Tizen/CHIPDevicePlatformConfig.h",
542         "Tizen/CHIPDevicePlatformEvent.h",
543         "Tizen/CHIPLinuxStorage.cpp",
544         "Tizen/CHIPLinuxStorage.h",
545         "Tizen/CHIPLinuxStorageIni.cpp",
546         "Tizen/CHIPLinuxStorageIni.h",
547         "Tizen/CHIPPlatformConfig.h",
548         "Tizen/ConfigurationManagerImpl.cpp",
549         "Tizen/ConfigurationManagerImpl.h",
550         "Tizen/ConnectivityManagerImpl.cpp",
551         "Tizen/ConnectivityManagerImpl.h",
552         "Tizen/DeviceNetworkProvisioningDelegateImpl.cpp",
553         "Tizen/DeviceNetworkProvisioningDelegateImpl.h",
554         "Tizen/InetPlatformConfig.h",
555         "Tizen/KeyValueStoreManagerImpl.cpp",
556         "Tizen/KeyValueStoreManagerImpl.h",
557         "Tizen/Logging.cpp",
558         "Tizen/PlatformManagerImpl.cpp",
559         "Tizen/PlatformManagerImpl.h",
560         "Tizen/PosixConfig.cpp",
561         "Tizen/PosixConfig.h",
562         "Tizen/SystemPlatformConfig.h",
563         "Tizen/SystemTimeSupport.cpp",
564         "Tizen/bluez/AdapterIterator.cpp",
565         "Tizen/bluez/AdapterIterator.h",
566         "Tizen/bluez/ChipDeviceScanner.cpp",
567         "Tizen/bluez/ChipDeviceScanner.h",
568         "Tizen/bluez/Helper.cpp",
569         "Tizen/bluez/Helper.h",
570         "Tizen/bluez/MainLoop.cpp",
571         "Tizen/bluez/MainLoop.h",
572         "Tizen/bluez/Types.h",
573       ]
574
575       if (chip_mdns != "none") {
576         sources += [
577           "Tizen/MdnsImpl.cpp",
578           "Tizen/MdnsImpl.h",
579           "Tizen/MdnsError.cpp",
580           "Tizen/MdnsError.h",
581         ]
582
583         public_configs += [ ":dns_sd" ]
584       }
585
586       if (chip_enable_openthread) {
587         sources += [
588           "Tizen/ThreadStackManagerImpl.cpp",
589           "Tizen/ThreadStackManagerImpl.h",
590         ]
591         public_deps += [ "${ot_br_posix_root}:ot_br_client" ]
592       }
593
594       if (chip_enable_wifi) {
595         public_deps += [ "Tizen/dbus/wpa" ]
596       }
597
598       if (chip_enable_ble) {
599         public_deps += [ "Tizen/dbus/bluez" ]
600       }
601
602       public_deps += [ "${chip_root}/third_party/inipp" ]
603     } else if (chip_device_platform == "nrfconnect") {
604       sources += [
605         "Zephyr/BLEManagerImpl.cpp",
606         "Zephyr/ConfigurationManagerImpl.cpp",
607         "Zephyr/KeyValueStoreManagerImpl.cpp",
608         "Zephyr/Logging.cpp",
609         "Zephyr/PlatformManagerImpl.cpp",
610         "Zephyr/SystemTimeSupport.cpp",
611         "Zephyr/ZephyrConfig.cpp",
612         "Zephyr/ZephyrConfig.h",
613         "nrfconnect/BLEManagerImpl.h",
614         "nrfconnect/BlePlatformConfig.h",
615         "nrfconnect/CHIPDevicePlatformConfig.h",
616         "nrfconnect/CHIPDevicePlatformEvent.h",
617         "nrfconnect/CHIPPlatformConfig.h",
618         "nrfconnect/ConfigurationManagerImpl.h",
619         "nrfconnect/ConnectivityManagerImpl.cpp",
620         "nrfconnect/ConnectivityManagerImpl.h",
621         "nrfconnect/DeviceNetworkProvisioningDelegateImpl.cpp",
622         "nrfconnect/DeviceNetworkProvisioningDelegateImpl.h",
623         "nrfconnect/InetPlatformConfig.h",
624         "nrfconnect/KeyValueStoreManagerImpl.h",
625         "nrfconnect/PlatformManagerImpl.h",
626         "nrfconnect/SystemPlatformConfig.h",
627       ]
628
629       if (chip_enable_openthread) {
630         sources += [
631           "OpenThread/OpenThreadUtils.cpp",
632           "Zephyr/ThreadStackManagerImpl.cpp",
633           "nrfconnect/ThreadStackManagerImpl.h",
634         ]
635       }
636     } else if (chip_device_platform == "qpg6100") {
637       sources += [
638         "FreeRTOS/SystemTimeSupport.cpp",
639         "qpg6100/BLEManagerImpl.cpp",
640         "qpg6100/BLEManagerImpl.h",
641         "qpg6100/BlePlatformConfig.h",
642         "qpg6100/CHIPDevicePlatformConfig.h",
643         "qpg6100/CHIPDevicePlatformEvent.h",
644         "qpg6100/CHIPPlatformConfig.h",
645         "qpg6100/ConfigurationManagerImpl.cpp",
646         "qpg6100/ConfigurationManagerImpl.h",
647         "qpg6100/ConnectivityManagerImpl.cpp",
648         "qpg6100/ConnectivityManagerImpl.h",
649         "qpg6100/DeviceNetworkProvisioningDelegateImpl.cpp",
650         "qpg6100/DeviceNetworkProvisioningDelegateImpl.h",
651         "qpg6100/InetPlatformConfig.h",
652         "qpg6100/Logging.cpp",
653         "qpg6100/PlatformManagerImpl.cpp",
654         "qpg6100/PlatformManagerImpl.h",
655         "qpg6100/SystemPlatformConfig.h",
656         "qpg6100/qpg6100Config.cpp",
657         "qpg6100/qpg6100Config.h",
658       ]
659
660       sources += [
661         "qpg6100/KeyValueStoreManagerImpl.cpp",
662         "qpg6100/KeyValueStoreManagerImpl.h",
663       ]
664
665       if (chip_enable_openthread) {
666         public_deps += [ "${openthread_root}:libopenthread-ftd" ]
667
668         public_configs += [ "${chip_root}/third_party/openthread/platforms/qpg6100:openthread_qpg6100_config" ]
669
670         sources += [
671           "OpenThread/OpenThreadUtils.cpp",
672           "qpg6100/ThreadStackManagerImpl.cpp",
673           "qpg6100/ThreadStackManagerImpl.h",
674         ]
675       }
676     }
677
678     if (chip_enable_openthread && chip_mdns == "platform" &&
679         chip_device_platform != "linux" && chip_device_platform != "tizen") {
680       sources += [ "OpenThread/MdnsImpl.cpp" ]
681     }
682
683     allow_circular_includes_from = [ "${chip_root}/src/lib/support" ]
684   }
685 } else if (chip_device_platform == "external") {
686   group("platform") {
687     public_deps = [ "${chip_platform_target}" ]
688   }
689 } else {
690   group("platform") {
691     public_deps = [ ":platform_buildconfig" ]
692   }
693 }