blob: f3d466068053ea362cb08ad2ed212b1a318e0f72 [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
Boris Zbarskyec713462022-01-06 15:53:22 -050028 if (chip_device_platform == "linux" || chip_device_platform == "darwin") {
Łukasz Duda4e1faf22021-01-27 17:47:25 +010029 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
Jiacheng Guob7598a02021-12-09 23:44:38 +080050 # Use OpenThread ftd or mtd library
51 chip_device_config_thread_ftd = chip_openthread_ftd
52
Jiacheng Guoe4ac46a2020-11-11 00:04:34 +080053 # By pass provision and secure session
54 chip_bypass_rendezvous = false
hnnajh96613742021-01-06 08:05:28 -080055
56 # Enable including the additional data in the advertisement packets
Shubham Patil175218b2022-01-04 21:31:30 +053057 chip_enable_additional_data_advertising = false
hnnajh846f2f12021-02-18 05:45:15 -080058
Tennessee Carmel-Veilleux8f86c432022-03-11 15:49:56 -050059 # Enable default/generic test-mode CommissionableDataProvider in GenericConfigurationManagerImpl
60 # === FOR TRANSITION UNTIL ALL EXAMPLES PROVIDE THEIR OWN ===
61 # Linux platform has already transitioned.
62 chip_use_transitional_commissionable_data_provider =
63 chip_device_platform != "linux"
64
Andrei Litvin4ae09b32021-05-11 09:14:27 -040065 # lock tracking: none/log/fatal or auto for a platform-dependent choice
66 chip_stack_lock_tracking = "auto"
Hui.Li-TCL924f36e2021-09-30 20:51:41 +080067
68 # todo: below operates are not work without root permission
69 # pthread_attr_setschedpolicy in GenericPlatformManagerImpl_POSIX.cpp
70 chip_device_config_run_as_root = current_os != "android"
Artur Tyneckib4921fc2022-02-21 17:44:34 +010071
72 # Indication that the CHIP data model is included
73 chip_enable_data_model = false
Michael Spangefa630b2020-07-08 22:23:08 -040074 }
75
Michael Spang732e1c02021-06-14 10:21:18 -040076 if (chip_stack_lock_tracking == "auto") {
Hui.Li-TCL924f36e2021-09-30 20:51:41 +080077 if (chip_device_platform == "linux" || chip_device_platform == "tizen" ||
sungmok shinb3c37992022-03-02 02:55:12 +090078 chip_device_platform == "android" || current_os == "freertos" ||
79 chip_device_platform == "webos") {
Michael Spang732e1c02021-06-14 10:21:18 -040080 # TODO: should be fatal for development. Change once bugs are fixed
Boris Zbarsky17dc4b02022-02-15 08:58:13 -050081 chip_stack_lock_tracking = "fatal"
Michael Spang732e1c02021-06-14 10:21:18 -040082 } else {
83 # TODO: may want to enable at least logging for embedded to find bugs
84 # this needs tuning depending on how many resources various platforms have
85 # available (mainly flash size)
86 chip_stack_lock_tracking = "none"
87 }
88 } else {
89 assert(
90 chip_stack_lock_tracking == "none" ||
91 chip_stack_lock_tracking == "log" ||
92 chip_stack_lock_tracking == "fatal",
93 "Please select a valid value for chip_stack_lock_tracking: auto, none, log, fatal")
94 }
95
Michael Spang1fcb6dd2020-08-24 11:19:04 -040096 buildconfig_header("platform_buildconfig") {
97 header = "CHIPDeviceBuildConfig.h"
98 header_dir = "platform"
Michael Spangefa630b2020-07-08 22:23:08 -040099
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400100 chip_with_gio = chip_enable_wifi
101 chip_device_config_enable_wpa = chip_enable_wifi
Michael Spang732e1c02021-06-14 10:21:18 -0400102 chip_stack_lock_tracking_log = chip_stack_lock_tracking != "none"
103 chip_stack_lock_tracking_fatal = chip_stack_lock_tracking == "fatal"
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400104 defines = [
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400105 "CHIP_DEVICE_CONFIG_ENABLE_WPA=${chip_device_config_enable_wpa}",
106 "CHIP_ENABLE_OPENTHREAD=${chip_enable_openthread}",
Jiacheng Guob7598a02021-12-09 23:44:38 +0800107 "CHIP_DEVICE_CONFIG_THREAD_FTD=${chip_device_config_thread_ftd}",
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400108 "CHIP_WITH_GIO=${chip_with_gio}",
109 "OPENTHREAD_CONFIG_ENABLE_TOBLE=false",
Michael Spang732e1c02021-06-14 10:21:18 -0400110 "CHIP_BYPASS_RENDEZVOUS=${chip_bypass_rendezvous}",
111 "CHIP_STACK_LOCK_TRACKING_ENABLED=${chip_stack_lock_tracking_log}",
112 "CHIP_STACK_LOCK_TRACKING_ERROR_FATAL=${chip_stack_lock_tracking_fatal}",
113 "CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING=${chip_enable_additional_data_advertising}",
Hui.Li-TCL924f36e2021-09-30 20:51:41 +0800114 "CHIP_DEVICE_CONFIG_RUN_AS_ROOT=${chip_device_config_run_as_root}",
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400115 ]
116
Wootak Junge945d162021-09-13 10:39:32 +0900117 if (chip_device_platform == "linux" || chip_device_platform == "darwin" ||
Hui.Li-TCL924f36e2021-09-30 20:51:41 +0800118 chip_device_platform == "tizen" || chip_device_platform == "android") {
Michael Spange1aa7b12021-03-09 18:08:38 -0500119 defines += [ "CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=${chip_enable_ble}" ]
120 }
121
Damian Królik5d00d1c2021-04-07 03:31:43 +0200122 if (chip_enable_nfc) {
123 defines += [ "CHIP_DEVICE_CONFIG_ENABLE_NFC=1" ]
124 }
125
Damian Królik79fe72a2021-11-23 10:26:03 +0100126 if (chip_enable_ota_requestor) {
127 defines += [ "CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR=1" ]
128 }
129
Michael Spangefa630b2020-07-08 22:23:08 -0400130 if (chip_device_project_config_include != "") {
131 defines += [ "CHIP_DEVICE_PROJECT_CONFIG_INCLUDE=${chip_device_project_config_include}" ]
132 }
133 if (chip_device_platform_config_include != "") {
134 defines += [ "CHIP_DEVICE_PLATFORM_CONFIG_INCLUDE=${chip_device_platform_config_include}" ]
135 }
136
Michael Spangda4c1252020-08-06 10:40:49 -0400137 if (chip_device_config_firmware_build_date != "") {
Michael Spang801349e2020-08-10 09:15:04 -0400138 defines += [ "CHIP_DEVICE_CONFIG_FIRWMARE_BUILD_DATE=\"${chip_device_config_firmware_build_date}\"" ]
Michael Spangda4c1252020-08-06 10:40:49 -0400139 }
140 if (chip_device_config_firmware_build_time != "") {
Michael Spang801349e2020-08-10 09:15:04 -0400141 defines += [ "CHIP_DEVICE_CONFIG_FIRMWARE_BUILD_TIME=\"${chip_device_config_firmware_build_time}\"" ]
Michael Spangda4c1252020-08-06 10:40:49 -0400142 }
143
Tennessee Carmel-Veilleux8f86c432022-03-11 15:49:56 -0500144 if (chip_use_transitional_commissionable_data_provider) {
145 defines += [ "CHIP_USE_TRANSITIONAL_COMMISSIONABLE_DATA_PROVIDER=1" ]
146 } else {
147 defines += [ "CHIP_USE_TRANSITIONAL_COMMISSIONABLE_DATA_PROVIDER=0" ]
148 }
149
Seth Rickard4f0521f2021-01-12 16:06:52 -0600150 if (chip_device_platform == "cc13x2_26x2") {
151 defines += [
152 "CHIP_DEVICE_LAYER_TARGET_CC13X2_26X2=1",
153 "CHIP_DEVICE_LAYER_TARGET=cc13x2_26x2",
154 ]
155 } else if (chip_device_platform == "darwin") {
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400156 defines += [
157 "CHIP_DEVICE_LAYER_TARGET_DARWIN=1",
158 "CHIP_DEVICE_LAYER_TARGET=Darwin",
159 ]
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200160 } else if (chip_device_platform == "efr32") {
161 defines += [
162 "CHIP_DEVICE_LAYER_TARGET_EFR32=1",
163 "CHIP_DEVICE_LAYER_TARGET=EFR32",
164 ]
165 } else if (chip_device_platform == "esp32") {
166 defines += [
167 "CHIP_DEVICE_LAYER_TARGET_ESP32=1",
168 "CHIP_DEVICE_LAYER_TARGET=ESP32",
169 ]
Praveen Chandran080ae572021-08-12 07:58:27 -0700170 } else if (chip_device_platform == "p6") {
171 defines += [
172 "CHIP_DEVICE_LAYER_TARGET_P6=1",
173 "CHIP_DEVICE_LAYER_TARGET=P6",
174 ]
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400175 } else if (chip_device_platform == "linux") {
176 defines += [
177 "CHIP_DEVICE_LAYER_TARGET_LINUX=1",
178 "CHIP_DEVICE_LAYER_TARGET=Linux",
Yufeng Wangc23becb2021-09-30 11:18:04 -0700179 "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}",
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400180 ]
Wootak Junge945d162021-09-13 10:39:32 +0900181 } else if (chip_device_platform == "tizen") {
182 defines += [
183 "CHIP_DEVICE_LAYER_TARGET_TIZEN=1",
184 "CHIP_DEVICE_LAYER_TARGET=Tizen",
185 "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}",
186 ]
187 defines -=
188 [ "CHIP_DEVICE_CONFIG_ENABLE_WPA=${chip_device_config_enable_wpa}" ]
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200189 } else if (chip_device_platform == "nrfconnect") {
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400190 defines += [
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200191 "CHIP_DEVICE_LAYER_TARGET_NRFCONNECT=1",
192 "CHIP_DEVICE_LAYER_TARGET=nrfconnect",
Kedar Sovani8617e2a2020-08-30 02:33:21 +0530193 ]
Timothy Maes2478e022021-07-02 04:03:46 +0200194 } else if (chip_device_platform == "qpg") {
Timothy Maesb5b3d382020-10-05 16:59:21 +0200195 defines += [
Timothy Maes2478e022021-07-02 04:03:46 +0200196 "CHIP_DEVICE_LAYER_TARGET_QPG=1",
197 "CHIP_DEVICE_LAYER_TARGET=qpg",
Timothy Maesb5b3d382020-10-05 16:59:21 +0200198 ]
PetruSicoe0aac8fd2021-10-07 15:52:08 +0300199 } else if (chip_device_platform == "k32w0") {
doru9104ac26b2020-10-13 18:23:28 +0300200 defines += [
201 "CHIP_DEVICE_LAYER_TARGET_K32W=1",
PetruSicoe0aac8fd2021-10-07 15:52:08 +0300202 "CHIP_DEVICE_LAYER_TARGET=nxp/k32w/k32w0",
doru9104ac26b2020-10-13 18:23:28 +0300203 ]
Alexandr Kolosovfc7146c2021-06-09 20:57:36 +0300204 } else if (chip_device_platform == "telink") {
205 defines += [
206 "CHIP_DEVICE_LAYER_TARGET_TELINK=1",
207 "CHIP_DEVICE_LAYER_TARGET=telink",
208 ]
Vincent Coubardcc135602021-06-29 16:58:47 +0100209 } else if (chip_device_platform == "mbed") {
210 defines += [
211 "CHIP_DEVICE_LAYER_TARGET_MBED=1",
212 "CHIP_DEVICE_LAYER_TARGET=mbed",
Artur Tyneckib4921fc2022-02-21 17:44:34 +0100213 "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}",
214 "CHIP_DEVICE_ENABLE_DATA_MODEL=${chip_enable_data_model}",
Vincent Coubardcc135602021-06-29 16:58:47 +0100215 ]
C Freeman79c93152021-08-18 00:20:05 -0400216 } else if (chip_device_platform == "fake") {
217 defines += [
218 "CHIP_DEVICE_LAYER_TARGET_FAKE=1",
219 "CHIP_DEVICE_LAYER_TARGET=fake",
220 ]
Hui.Li-TCL924f36e2021-09-30 20:51:41 +0800221 } else if (chip_device_platform == "android") {
222 defines += [
223 "CHIP_DEVICE_LAYER_TARGET_ANDROID=1",
224 "CHIP_DEVICE_LAYER_TARGET=android",
225 ]
pankore544da73c2021-10-19 02:51:16 +0800226 } else if (chip_device_platform == "ameba") {
227 defines += [
228 "CHIP_DEVICE_LAYER_TARGET_AMEBA=1",
229 "CHIP_DEVICE_LAYER_TARGET=Ameba",
pankoree6dab3712021-11-10 01:52:01 +0800230 "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}",
pankore544da73c2021-10-19 02:51:16 +0800231 ]
Todd Chou1af90eb2022-01-21 12:29:29 +0800232 } else if (chip_device_platform == "cyw30739") {
233 defines += [
234 "CHIP_DEVICE_LAYER_TARGET_CYW30739=1",
235 "CHIP_DEVICE_LAYER_TARGET=CYW30739",
236 ]
sungmok shinb3c37992022-03-02 02:55:12 +0900237 } else if (chip_device_platform == "webos") {
238 defines += [
239 "CHIP_DEVICE_LAYER_TARGET_WEBOS=1",
240 "CHIP_DEVICE_LAYER_TARGET=Linux",
241 "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}",
242 ]
243 defines -=
244 [ "CHIP_DEVICE_CONFIG_ENABLE_WPA=${chip_device_config_enable_wpa}" ]
Kedar Sovani8617e2a2020-08-30 02:33:21 +0530245 }
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400246 }
Jiacheng Guoe4ac46a2020-11-11 00:04:34 +0800247} else {
248 buildconfig_header("platform_buildconfig") {
249 header = "CHIPDeviceBuildConfig.h"
250 header_dir = "platform"
251
252 defines = [
253 "CHIP_DEVICE_LAYER_NONE=1",
254 "CHIP_DEVICE_LAYER_TARGET=NONE",
255 ]
Andrei Litvin1274bcf2021-04-09 14:13:37 -0400256
257 if (current_os == "android") {
Andrei Litvinb7924632022-03-03 15:29:54 -0500258 defines += [ "EXTERNAL_KEYVALUESTOREMANAGERIMPL_HEADER=\"controller/java/AndroidKeyValueStoreManagerImpl.h\"" ]
Andrei Litvin1274bcf2021-04-09 14:13:37 -0400259 }
Jiacheng Guoe4ac46a2020-11-11 00:04:34 +0800260 }
Jiacheng Guo57945c22020-08-29 03:56:59 +0800261}
Michael Spang1fcb6dd2020-08-24 11:19:04 -0400262
Michael Spang68fcef62021-07-05 21:50:23 -0400263if (chip_device_platform != "none") {
264 group("platform_base") {
265 public_deps = [
266 ":platform_buildconfig",
267 "${chip_root}/src/ble",
268 "${chip_root}/src/inet",
269 "${chip_root}/src/lib/core",
270 "${chip_root}/src/lib/support",
Kamil Kasperczyk838e4892022-02-25 15:43:35 +0100271 "${chip_root}/src/setup_payload:additional_data_payload",
Michael Spang68fcef62021-07-05 21:50:23 -0400272 "${chip_root}/src/system",
273 ]
274
275 public_configs = [ "${chip_root}/src:includes" ]
Michael Spangefa630b2020-07-08 22:23:08 -0400276 }
277
278 static_library("platform") {
279 output_name = "libDeviceLayer"
280
281 sources = [
Michael Spangdb9b8612020-07-13 09:43:13 -0400282 "../include/platform/CHIPDeviceConfig.h",
283 "../include/platform/CHIPDeviceError.h",
284 "../include/platform/CHIPDeviceEvent.h",
285 "../include/platform/CHIPDeviceLayer.h",
Tennessee Carmel-Veilleux8f86c432022-03-11 15:49:56 -0500286 "../include/platform/CommissionableDataProvider.h",
Michael Spangdb9b8612020-07-13 09:43:13 -0400287 "../include/platform/ConfigurationManager.h",
288 "../include/platform/ConnectivityManager.h",
Yufeng Wang89aff252021-12-15 11:28:14 -0800289 "../include/platform/DeviceControlServer.h",
Yufeng Wangbb6bb372022-02-25 10:04:29 -0800290 "../include/platform/FailSafeContext.h",
Michael Spangdb9b8612020-07-13 09:43:13 -0400291 "../include/platform/GeneralUtils.h",
rgoliverbf60cc22021-01-26 21:15:59 -0500292 "../include/platform/KeyValueStoreManager.h",
Michael Spangdb9b8612020-07-13 09:43:13 -0400293 "../include/platform/PersistedStorage.h",
294 "../include/platform/PlatformManager.h",
Tennessee Carmel-Veilleux8f86c432022-03-11 15:49:56 -0500295 "../include/platform/TestOnlyCommissionableDataProvider.h",
Michael Spangdb9b8612020-07-13 09:43:13 -0400296 "../include/platform/ThreadStackManager.h",
Michael Spangdb9b8612020-07-13 09:43:13 -0400297 "../include/platform/internal/BLEManager.h",
298 "../include/platform/internal/CHIPDeviceLayerInternal.h",
Michael Spangdb9b8612020-07-13 09:43:13 -0400299 "../include/platform/internal/DeviceNetworkInfo.h",
Pankaj Garg4239bcf2020-10-27 08:41:54 -0700300 "../include/platform/internal/DeviceNetworkProvisioning.h",
Michael Spangdb9b8612020-07-13 09:43:13 -0400301 "../include/platform/internal/EventLogging.h",
302 "../include/platform/internal/GenericConfigurationManagerImpl.h",
Michael Spangfeb81b62022-03-22 14:34:32 -0400303 "../include/platform/internal/GenericConfigurationManagerImpl.ipp",
Michael Spangdb9b8612020-07-13 09:43:13 -0400304 "../include/platform/internal/GenericConnectivityManagerImpl.h",
305 "../include/platform/internal/GenericConnectivityManagerImpl_BLE.h",
Michael Spangfeb81b62022-03-22 14:34:32 -0400306 "../include/platform/internal/GenericConnectivityManagerImpl_BLE.ipp",
Michael Spangdb9b8612020-07-13 09:43:13 -0400307 "../include/platform/internal/GenericConnectivityManagerImpl_NoBLE.h",
308 "../include/platform/internal/GenericConnectivityManagerImpl_NoThread.h",
Michael Spangdb9b8612020-07-13 09:43:13 -0400309 "../include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h",
310 "../include/platform/internal/GenericConnectivityManagerImpl_Thread.h",
Michael Spangfeb81b62022-03-22 14:34:32 -0400311 "../include/platform/internal/GenericConnectivityManagerImpl_Thread.ipp",
Yufeng Wang2a1e8bc2020-09-27 23:27:02 -0700312 "../include/platform/internal/GenericConnectivityManagerImpl_WiFi.h",
Michael Spangfeb81b62022-03-22 14:34:32 -0400313 "../include/platform/internal/GenericConnectivityManagerImpl_WiFi.ipp",
Michael Spangdb9b8612020-07-13 09:43:13 -0400314 "../include/platform/internal/GenericPlatformManagerImpl.h",
Michael Spangfeb81b62022-03-22 14:34:32 -0400315 "../include/platform/internal/GenericPlatformManagerImpl.ipp",
Michael Spangdb9b8612020-07-13 09:43:13 -0400316 "../include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.h",
Michael Spangfeb81b62022-03-22 14:34:32 -0400317 "../include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.ipp",
Michael Spangdb9b8612020-07-13 09:43:13 -0400318 "../include/platform/internal/GenericPlatformManagerImpl_POSIX.h",
Michael Spangfeb81b62022-03-22 14:34:32 -0400319 "../include/platform/internal/GenericPlatformManagerImpl_POSIX.ipp",
320 "../include/platform/internal/GenericPlatformManagerImpl_Zephyr.ipp",
Michael Spangdb9b8612020-07-13 09:43:13 -0400321 "../include/platform/internal/testing/ConfigUnitTest.h",
Tennessee Carmel-Veilleux8f86c432022-03-11 15:49:56 -0500322 "CommissionableDataProvider.cpp",
Yufeng Wang17be4af2021-05-03 21:46:33 -0700323 "DeviceControlServer.cpp",
Yufeng Wang3e863a92021-11-22 11:41:21 -0800324 "DiagnosticDataProvider.cpp",
Zang MingJie659848c2021-09-03 23:13:45 +0800325 "Entropy.cpp",
Yufeng Wangbb6bb372022-02-25 10:04:29 -0800326 "FailSafeContext.cpp",
Michael Spangefa630b2020-07-08 22:23:08 -0400327 "GeneralUtils.cpp",
328 "Globals.cpp",
Andrei Litvin4ae09b32021-05-11 09:14:27 -0400329 "LockTracker.cpp",
Michael Spangefa630b2020-07-08 22:23:08 -0400330 "PersistedStorage.cpp",
Zang MingJie39ff9bf2021-11-05 12:29:08 +0800331 "PlatformEventSupport.cpp",
Michael Spangefa630b2020-07-08 22:23:08 -0400332 ]
333
jmartinez-silabsa92d1a82022-02-07 12:50:17 -0500334 # Linux has its own NetworkCommissioningThreadDriver
335 if (chip_enable_openthread && chip_device_platform != "linux") {
336 sources += [
337 "OpenThread/GenericNetworkCommissioningThreadDriver.cpp",
338 "OpenThread/GenericNetworkCommissioningThreadDriver.h",
339 ]
340 }
341
Boris Zbarsky444b50b2020-09-23 19:53:06 -0400342 cflags = [ "-Wconversion" ]
343
Michael Spangefa630b2020-07-08 22:23:08 -0400344 public_deps = [
Michael Spang68fcef62021-07-05 21:50:23 -0400345 ":platform_base",
Andrei Litvinf04c4282021-10-20 12:58:43 -0400346 "${chip_root}/src/app:app_buildconfig",
Yufeng Wang551e53f2021-10-26 13:41:18 -0700347 "${chip_root}/src/app/common:cluster-objects",
Zang MingJie659848c2021-09-03 23:13:45 +0800348 "${chip_root}/src/crypto",
Michael Spangefa630b2020-07-08 22:23:08 -0400349 "${chip_root}/src/lib/support",
Michael Spangefa630b2020-07-08 22:23:08 -0400350 ]
351
Seth Rickard4f0521f2021-01-12 16:06:52 -0600352 if (chip_device_platform == "cc13x2_26x2") {
Michael Spang68fcef62021-07-05 21:50:23 -0400353 _platform_target = "cc13x2_26x2"
Seth Rickard4f0521f2021-01-12 16:06:52 -0600354 } else if (chip_device_platform == "darwin") {
Michael Spang68fcef62021-07-05 21:50:23 -0400355 _platform_target = "Darwin"
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200356 } else if (chip_device_platform == "efr32") {
Michael Spang68fcef62021-07-05 21:50:23 -0400357 _platform_target = "EFR32"
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200358 } else if (chip_device_platform == "esp32") {
Michael Spang68fcef62021-07-05 21:50:23 -0400359 _platform_target = "ESP32"
PetruSicoe0aac8fd2021-10-07 15:52:08 +0300360 } else if (chip_device_platform == "k32w0") {
361 _platform_target = "nxp/k32w/k32w0"
Michael Spang4314d812020-08-07 10:17:09 -0400362 } else if (chip_device_platform == "linux") {
Michael Spang68fcef62021-07-05 21:50:23 -0400363 _platform_target = "Linux"
Rafał Kuźnia90bc94c2020-08-31 19:54:04 +0200364 } else if (chip_device_platform == "nrfconnect") {
Michael Spang68fcef62021-07-05 21:50:23 -0400365 _platform_target = "nrfconnect"
Timothy Maes2478e022021-07-02 04:03:46 +0200366 } else if (chip_device_platform == "qpg") {
Michael Spang68fcef62021-07-05 21:50:23 -0400367 _platform_target = "qpg"
Alexandr Kolosovfc7146c2021-06-09 20:57:36 +0300368 } else if (chip_device_platform == "telink") {
Michael Spang68fcef62021-07-05 21:50:23 -0400369 _platform_target = "telink"
Vincent Coubardcc135602021-06-29 16:58:47 +0100370 } else if (chip_device_platform == "mbed") {
Michael Spang68fcef62021-07-05 21:50:23 -0400371 _platform_target = "mbed"
Wootak Junge945d162021-09-13 10:39:32 +0900372 } else if (chip_device_platform == "tizen") {
373 _platform_target = "Tizen"
Hui.Li-TCL924f36e2021-09-30 20:51:41 +0800374 } else if (chip_device_platform == "android") {
375 _platform_target = "android"
Michael Spang68fcef62021-07-05 21:50:23 -0400376 } else if (chip_device_platform == "external") {
377 _platform_target = chip_platform_target
Praveen Chandran080ae572021-08-12 07:58:27 -0700378 } else if (chip_device_platform == "p6") {
379 _platform_target = "P6"
pankore544da73c2021-10-19 02:51:16 +0800380 } else if (chip_device_platform == "ameba") {
381 _platform_target = "Ameba"
sungmok shinb3c37992022-03-02 02:55:12 +0900382 } else if (chip_device_platform == "webos") {
383 _platform_target = "webos"
C Freeman79c93152021-08-18 00:20:05 -0400384 } else if (chip_device_platform == "fake") {
385 _platform_target = "fake"
Todd Chou1af90eb2022-01-21 12:29:29 +0800386 } else if (chip_device_platform == "cyw30739") {
387 _platform_target = "CYW30739"
Michael Spang68fcef62021-07-05 21:50:23 -0400388 } else {
389 assert(false, "Unknown chip_device_platform: ${chip_device_platform}")
Michael Spangefa630b2020-07-08 22:23:08 -0400390 }
Michael Spangdb9b8612020-07-13 09:43:13 -0400391
Michael Spang68fcef62021-07-05 21:50:23 -0400392 public_deps += [ _platform_target ]
Kamil Kasperczyk44014022021-03-12 21:18:45 +0100393
Michael Spang68fcef62021-07-05 21:50:23 -0400394 # The platform target needs to include the headers, so allow that here.
395 # It should be considered logically part of this target.
396 allow_circular_includes_from = [
397 _platform_target,
398 "${chip_root}/src/lib/support",
399 ]
Jiacheng Guod8f58a02020-08-19 00:23:40 +0800400 }
Michael Spangefa630b2020-07-08 22:23:08 -0400401} else {
402 group("platform") {
Jiacheng Guoe4ac46a2020-11-11 00:04:34 +0800403 public_deps = [ ":platform_buildconfig" ]
Michael Spangefa630b2020-07-08 22:23:08 -0400404 }
405}