Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 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 | |
Łukasz Duda | 4e1faf2 | 2021-01-27 17:47:25 +0100 | [diff] [blame] | 15 | import("//build_overrides/build.gni") |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 16 | import("//build_overrides/chip.gni") |
| 17 | import("//build_overrides/nlio.gni") |
rgoliver | bf60cc2 | 2021-01-26 21:15:59 -0500 | [diff] [blame] | 18 | import("//build_overrides/pigweed.gni") |
Łukasz Duda | 4e1faf2 | 2021-01-27 17:47:25 +0100 | [diff] [blame] | 19 | |
Łukasz Duda | 4e1faf2 | 2021-01-27 17:47:25 +0100 | [diff] [blame] | 20 | import("${build_root}/config/linux/pkg_config.gni") |
Michael Spang | 09611bf | 2021-03-02 16:31:57 -0500 | [diff] [blame] | 21 | import("${chip_root}/build/chip/buildconfig_header.gni") |
Michael Spang | 1fcb6dd | 2020-08-24 11:19:04 -0400 | [diff] [blame] | 22 | |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 23 | import("device.gni") |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 24 | |
Michael Spang | c32dd2f | 2020-08-13 08:42:21 -0400 | [diff] [blame] | 25 | if (chip_enable_openthread) { |
| 26 | import("//build_overrides/openthread.gni") |
Łukasz Duda | 4e1faf2 | 2021-01-27 17:47:25 +0100 | [diff] [blame] | 27 | |
Boris Zbarsky | ec71346 | 2022-01-06 15:53:22 -0500 | [diff] [blame] | 28 | if (chip_device_platform == "linux" || chip_device_platform == "darwin") { |
Łukasz Duda | 4e1faf2 | 2021-01-27 17:47:25 +0100 | [diff] [blame] | 29 | import("//build_overrides/ot_br_posix.gni") |
| 30 | } |
Michael Spang | c32dd2f | 2020-08-13 08:42:21 -0400 | [diff] [blame] | 31 | } |
| 32 | |
Kamil Kasperczyk | 4401402 | 2021-03-12 21:18:45 +0100 | [diff] [blame] | 33 | if (chip_device_platform == "linux" && chip_mdns != "none") { |
Jiacheng Guo | 5de2929 | 2020-10-26 14:41:40 +0800 | [diff] [blame] | 34 | pkg_config("avahi_client_config") { |
| 35 | packages = [ "avahi-client" ] |
| 36 | } |
| 37 | } |
| 38 | |
Jiacheng Guo | 57945c2 | 2020-08-29 03:56:59 +0800 | [diff] [blame] | 39 | if (chip_device_platform != "none") { |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 40 | declare_args() { |
| 41 | # Extra header to include in CHIPDeviceConfig.h for project. |
| 42 | chip_device_project_config_include = "" |
Michael Spang | da4c125 | 2020-08-06 10:40:49 -0400 | [diff] [blame] | 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 = "" |
Jiacheng Guo | e4ac46a | 2020-11-11 00:04:34 +0800 | [diff] [blame] | 49 | |
Jiacheng Guo | b7598a0 | 2021-12-09 23:44:38 +0800 | [diff] [blame] | 50 | # Use OpenThread ftd or mtd library |
| 51 | chip_device_config_thread_ftd = chip_openthread_ftd |
| 52 | |
Jiacheng Guo | e4ac46a | 2020-11-11 00:04:34 +0800 | [diff] [blame] | 53 | # By pass provision and secure session |
| 54 | chip_bypass_rendezvous = false |
hnnajh | 9661374 | 2021-01-06 08:05:28 -0800 | [diff] [blame] | 55 | |
| 56 | # Enable including the additional data in the advertisement packets |
Shubham Patil | 175218b | 2022-01-04 21:31:30 +0530 | [diff] [blame] | 57 | chip_enable_additional_data_advertising = false |
hnnajh | 846f2f1 | 2021-02-18 05:45:15 -0800 | [diff] [blame] | 58 | |
Tennessee Carmel-Veilleux | 8f86c43 | 2022-03-11 15:49:56 -0500 | [diff] [blame] | 59 | # 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 Litvin | 4ae09b3 | 2021-05-11 09:14:27 -0400 | [diff] [blame] | 65 | # lock tracking: none/log/fatal or auto for a platform-dependent choice |
| 66 | chip_stack_lock_tracking = "auto" |
Hui.Li-TCL | 924f36e | 2021-09-30 20:51:41 +0800 | [diff] [blame] | 67 | |
| 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 Tynecki | b4921fc | 2022-02-21 17:44:34 +0100 | [diff] [blame] | 71 | |
| 72 | # Indication that the CHIP data model is included |
| 73 | chip_enable_data_model = false |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 74 | } |
| 75 | |
Michael Spang | 732e1c0 | 2021-06-14 10:21:18 -0400 | [diff] [blame] | 76 | if (chip_stack_lock_tracking == "auto") { |
Hui.Li-TCL | 924f36e | 2021-09-30 20:51:41 +0800 | [diff] [blame] | 77 | if (chip_device_platform == "linux" || chip_device_platform == "tizen" || |
sungmok shin | b3c3799 | 2022-03-02 02:55:12 +0900 | [diff] [blame] | 78 | chip_device_platform == "android" || current_os == "freertos" || |
| 79 | chip_device_platform == "webos") { |
Michael Spang | 732e1c0 | 2021-06-14 10:21:18 -0400 | [diff] [blame] | 80 | # TODO: should be fatal for development. Change once bugs are fixed |
Boris Zbarsky | 17dc4b0 | 2022-02-15 08:58:13 -0500 | [diff] [blame] | 81 | chip_stack_lock_tracking = "fatal" |
Michael Spang | 732e1c0 | 2021-06-14 10:21:18 -0400 | [diff] [blame] | 82 | } 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 Spang | 1fcb6dd | 2020-08-24 11:19:04 -0400 | [diff] [blame] | 96 | buildconfig_header("platform_buildconfig") { |
| 97 | header = "CHIPDeviceBuildConfig.h" |
| 98 | header_dir = "platform" |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 99 | |
Michael Spang | 1fcb6dd | 2020-08-24 11:19:04 -0400 | [diff] [blame] | 100 | chip_with_gio = chip_enable_wifi |
| 101 | chip_device_config_enable_wpa = chip_enable_wifi |
Michael Spang | 732e1c0 | 2021-06-14 10:21:18 -0400 | [diff] [blame] | 102 | chip_stack_lock_tracking_log = chip_stack_lock_tracking != "none" |
| 103 | chip_stack_lock_tracking_fatal = chip_stack_lock_tracking == "fatal" |
Michael Spang | 1fcb6dd | 2020-08-24 11:19:04 -0400 | [diff] [blame] | 104 | defines = [ |
Michael Spang | 1fcb6dd | 2020-08-24 11:19:04 -0400 | [diff] [blame] | 105 | "CHIP_DEVICE_CONFIG_ENABLE_WPA=${chip_device_config_enable_wpa}", |
| 106 | "CHIP_ENABLE_OPENTHREAD=${chip_enable_openthread}", |
Jiacheng Guo | b7598a0 | 2021-12-09 23:44:38 +0800 | [diff] [blame] | 107 | "CHIP_DEVICE_CONFIG_THREAD_FTD=${chip_device_config_thread_ftd}", |
Michael Spang | 1fcb6dd | 2020-08-24 11:19:04 -0400 | [diff] [blame] | 108 | "CHIP_WITH_GIO=${chip_with_gio}", |
| 109 | "OPENTHREAD_CONFIG_ENABLE_TOBLE=false", |
Michael Spang | 732e1c0 | 2021-06-14 10:21:18 -0400 | [diff] [blame] | 110 | "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-TCL | 924f36e | 2021-09-30 20:51:41 +0800 | [diff] [blame] | 114 | "CHIP_DEVICE_CONFIG_RUN_AS_ROOT=${chip_device_config_run_as_root}", |
Michael Spang | 1fcb6dd | 2020-08-24 11:19:04 -0400 | [diff] [blame] | 115 | ] |
| 116 | |
Wootak Jung | e945d16 | 2021-09-13 10:39:32 +0900 | [diff] [blame] | 117 | if (chip_device_platform == "linux" || chip_device_platform == "darwin" || |
Hui.Li-TCL | 924f36e | 2021-09-30 20:51:41 +0800 | [diff] [blame] | 118 | chip_device_platform == "tizen" || chip_device_platform == "android") { |
Michael Spang | e1aa7b1 | 2021-03-09 18:08:38 -0500 | [diff] [blame] | 119 | defines += [ "CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=${chip_enable_ble}" ] |
| 120 | } |
| 121 | |
Damian Królik | 5d00d1c | 2021-04-07 03:31:43 +0200 | [diff] [blame] | 122 | if (chip_enable_nfc) { |
| 123 | defines += [ "CHIP_DEVICE_CONFIG_ENABLE_NFC=1" ] |
| 124 | } |
| 125 | |
Damian Królik | 79fe72a | 2021-11-23 10:26:03 +0100 | [diff] [blame] | 126 | if (chip_enable_ota_requestor) { |
| 127 | defines += [ "CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR=1" ] |
| 128 | } |
| 129 | |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 130 | 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 Spang | da4c125 | 2020-08-06 10:40:49 -0400 | [diff] [blame] | 137 | if (chip_device_config_firmware_build_date != "") { |
Michael Spang | 801349e | 2020-08-10 09:15:04 -0400 | [diff] [blame] | 138 | defines += [ "CHIP_DEVICE_CONFIG_FIRWMARE_BUILD_DATE=\"${chip_device_config_firmware_build_date}\"" ] |
Michael Spang | da4c125 | 2020-08-06 10:40:49 -0400 | [diff] [blame] | 139 | } |
| 140 | if (chip_device_config_firmware_build_time != "") { |
Michael Spang | 801349e | 2020-08-10 09:15:04 -0400 | [diff] [blame] | 141 | defines += [ "CHIP_DEVICE_CONFIG_FIRMWARE_BUILD_TIME=\"${chip_device_config_firmware_build_time}\"" ] |
Michael Spang | da4c125 | 2020-08-06 10:40:49 -0400 | [diff] [blame] | 142 | } |
| 143 | |
Tennessee Carmel-Veilleux | 8f86c43 | 2022-03-11 15:49:56 -0500 | [diff] [blame] | 144 | 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 Rickard | 4f0521f | 2021-01-12 16:06:52 -0600 | [diff] [blame] | 150 | 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 Spang | 1fcb6dd | 2020-08-24 11:19:04 -0400 | [diff] [blame] | 156 | defines += [ |
| 157 | "CHIP_DEVICE_LAYER_TARGET_DARWIN=1", |
| 158 | "CHIP_DEVICE_LAYER_TARGET=Darwin", |
| 159 | ] |
Rafał Kuźnia | 90bc94c | 2020-08-31 19:54:04 +0200 | [diff] [blame] | 160 | } 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 Chandran | 080ae57 | 2021-08-12 07:58:27 -0700 | [diff] [blame] | 170 | } else if (chip_device_platform == "p6") { |
| 171 | defines += [ |
| 172 | "CHIP_DEVICE_LAYER_TARGET_P6=1", |
| 173 | "CHIP_DEVICE_LAYER_TARGET=P6", |
| 174 | ] |
Michael Spang | 1fcb6dd | 2020-08-24 11:19:04 -0400 | [diff] [blame] | 175 | } else if (chip_device_platform == "linux") { |
| 176 | defines += [ |
| 177 | "CHIP_DEVICE_LAYER_TARGET_LINUX=1", |
| 178 | "CHIP_DEVICE_LAYER_TARGET=Linux", |
Yufeng Wang | c23becb | 2021-09-30 11:18:04 -0700 | [diff] [blame] | 179 | "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}", |
Michael Spang | 1fcb6dd | 2020-08-24 11:19:04 -0400 | [diff] [blame] | 180 | ] |
Wootak Jung | e945d16 | 2021-09-13 10:39:32 +0900 | [diff] [blame] | 181 | } 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źnia | 90bc94c | 2020-08-31 19:54:04 +0200 | [diff] [blame] | 189 | } else if (chip_device_platform == "nrfconnect") { |
Michael Spang | 1fcb6dd | 2020-08-24 11:19:04 -0400 | [diff] [blame] | 190 | defines += [ |
Rafał Kuźnia | 90bc94c | 2020-08-31 19:54:04 +0200 | [diff] [blame] | 191 | "CHIP_DEVICE_LAYER_TARGET_NRFCONNECT=1", |
| 192 | "CHIP_DEVICE_LAYER_TARGET=nrfconnect", |
Kedar Sovani | 8617e2a | 2020-08-30 02:33:21 +0530 | [diff] [blame] | 193 | ] |
Timothy Maes | 2478e02 | 2021-07-02 04:03:46 +0200 | [diff] [blame] | 194 | } else if (chip_device_platform == "qpg") { |
Timothy Maes | b5b3d38 | 2020-10-05 16:59:21 +0200 | [diff] [blame] | 195 | defines += [ |
Timothy Maes | 2478e02 | 2021-07-02 04:03:46 +0200 | [diff] [blame] | 196 | "CHIP_DEVICE_LAYER_TARGET_QPG=1", |
| 197 | "CHIP_DEVICE_LAYER_TARGET=qpg", |
Timothy Maes | b5b3d38 | 2020-10-05 16:59:21 +0200 | [diff] [blame] | 198 | ] |
PetruSicoe | 0aac8fd | 2021-10-07 15:52:08 +0300 | [diff] [blame] | 199 | } else if (chip_device_platform == "k32w0") { |
doru91 | 04ac26b | 2020-10-13 18:23:28 +0300 | [diff] [blame] | 200 | defines += [ |
| 201 | "CHIP_DEVICE_LAYER_TARGET_K32W=1", |
PetruSicoe | 0aac8fd | 2021-10-07 15:52:08 +0300 | [diff] [blame] | 202 | "CHIP_DEVICE_LAYER_TARGET=nxp/k32w/k32w0", |
doru91 | 04ac26b | 2020-10-13 18:23:28 +0300 | [diff] [blame] | 203 | ] |
Alexandr Kolosov | fc7146c | 2021-06-09 20:57:36 +0300 | [diff] [blame] | 204 | } else if (chip_device_platform == "telink") { |
| 205 | defines += [ |
| 206 | "CHIP_DEVICE_LAYER_TARGET_TELINK=1", |
| 207 | "CHIP_DEVICE_LAYER_TARGET=telink", |
| 208 | ] |
Vincent Coubard | cc13560 | 2021-06-29 16:58:47 +0100 | [diff] [blame] | 209 | } else if (chip_device_platform == "mbed") { |
| 210 | defines += [ |
| 211 | "CHIP_DEVICE_LAYER_TARGET_MBED=1", |
| 212 | "CHIP_DEVICE_LAYER_TARGET=mbed", |
Artur Tynecki | b4921fc | 2022-02-21 17:44:34 +0100 | [diff] [blame] | 213 | "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}", |
| 214 | "CHIP_DEVICE_ENABLE_DATA_MODEL=${chip_enable_data_model}", |
Vincent Coubard | cc13560 | 2021-06-29 16:58:47 +0100 | [diff] [blame] | 215 | ] |
C Freeman | 79c9315 | 2021-08-18 00:20:05 -0400 | [diff] [blame] | 216 | } else if (chip_device_platform == "fake") { |
| 217 | defines += [ |
| 218 | "CHIP_DEVICE_LAYER_TARGET_FAKE=1", |
| 219 | "CHIP_DEVICE_LAYER_TARGET=fake", |
| 220 | ] |
Hui.Li-TCL | 924f36e | 2021-09-30 20:51:41 +0800 | [diff] [blame] | 221 | } else if (chip_device_platform == "android") { |
| 222 | defines += [ |
| 223 | "CHIP_DEVICE_LAYER_TARGET_ANDROID=1", |
| 224 | "CHIP_DEVICE_LAYER_TARGET=android", |
| 225 | ] |
pankore | 544da73c | 2021-10-19 02:51:16 +0800 | [diff] [blame] | 226 | } else if (chip_device_platform == "ameba") { |
| 227 | defines += [ |
| 228 | "CHIP_DEVICE_LAYER_TARGET_AMEBA=1", |
| 229 | "CHIP_DEVICE_LAYER_TARGET=Ameba", |
pankore | e6dab371 | 2021-11-10 01:52:01 +0800 | [diff] [blame] | 230 | "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}", |
pankore | 544da73c | 2021-10-19 02:51:16 +0800 | [diff] [blame] | 231 | ] |
Todd Chou | 1af90eb | 2022-01-21 12:29:29 +0800 | [diff] [blame] | 232 | } else if (chip_device_platform == "cyw30739") { |
| 233 | defines += [ |
| 234 | "CHIP_DEVICE_LAYER_TARGET_CYW30739=1", |
| 235 | "CHIP_DEVICE_LAYER_TARGET=CYW30739", |
| 236 | ] |
sungmok shin | b3c3799 | 2022-03-02 02:55:12 +0900 | [diff] [blame] | 237 | } 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 Sovani | 8617e2a | 2020-08-30 02:33:21 +0530 | [diff] [blame] | 245 | } |
Michael Spang | 1fcb6dd | 2020-08-24 11:19:04 -0400 | [diff] [blame] | 246 | } |
Jiacheng Guo | e4ac46a | 2020-11-11 00:04:34 +0800 | [diff] [blame] | 247 | } 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 Litvin | 1274bcf | 2021-04-09 14:13:37 -0400 | [diff] [blame] | 256 | |
| 257 | if (current_os == "android") { |
Andrei Litvin | b792463 | 2022-03-03 15:29:54 -0500 | [diff] [blame] | 258 | defines += [ "EXTERNAL_KEYVALUESTOREMANAGERIMPL_HEADER=\"controller/java/AndroidKeyValueStoreManagerImpl.h\"" ] |
Andrei Litvin | 1274bcf | 2021-04-09 14:13:37 -0400 | [diff] [blame] | 259 | } |
Jiacheng Guo | e4ac46a | 2020-11-11 00:04:34 +0800 | [diff] [blame] | 260 | } |
Jiacheng Guo | 57945c2 | 2020-08-29 03:56:59 +0800 | [diff] [blame] | 261 | } |
Michael Spang | 1fcb6dd | 2020-08-24 11:19:04 -0400 | [diff] [blame] | 262 | |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 263 | if (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 Kasperczyk | 838e489 | 2022-02-25 15:43:35 +0100 | [diff] [blame] | 271 | "${chip_root}/src/setup_payload:additional_data_payload", |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 272 | "${chip_root}/src/system", |
| 273 | ] |
| 274 | |
| 275 | public_configs = [ "${chip_root}/src:includes" ] |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 276 | } |
| 277 | |
| 278 | static_library("platform") { |
| 279 | output_name = "libDeviceLayer" |
| 280 | |
| 281 | sources = [ |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 282 | "../include/platform/CHIPDeviceConfig.h", |
| 283 | "../include/platform/CHIPDeviceError.h", |
| 284 | "../include/platform/CHIPDeviceEvent.h", |
| 285 | "../include/platform/CHIPDeviceLayer.h", |
Tennessee Carmel-Veilleux | 8f86c43 | 2022-03-11 15:49:56 -0500 | [diff] [blame] | 286 | "../include/platform/CommissionableDataProvider.h", |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 287 | "../include/platform/ConfigurationManager.h", |
| 288 | "../include/platform/ConnectivityManager.h", |
Yufeng Wang | 89aff25 | 2021-12-15 11:28:14 -0800 | [diff] [blame] | 289 | "../include/platform/DeviceControlServer.h", |
Yufeng Wang | bb6bb37 | 2022-02-25 10:04:29 -0800 | [diff] [blame] | 290 | "../include/platform/FailSafeContext.h", |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 291 | "../include/platform/GeneralUtils.h", |
rgoliver | bf60cc2 | 2021-01-26 21:15:59 -0500 | [diff] [blame] | 292 | "../include/platform/KeyValueStoreManager.h", |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 293 | "../include/platform/PersistedStorage.h", |
| 294 | "../include/platform/PlatformManager.h", |
Tennessee Carmel-Veilleux | 8f86c43 | 2022-03-11 15:49:56 -0500 | [diff] [blame] | 295 | "../include/platform/TestOnlyCommissionableDataProvider.h", |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 296 | "../include/platform/ThreadStackManager.h", |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 297 | "../include/platform/internal/BLEManager.h", |
| 298 | "../include/platform/internal/CHIPDeviceLayerInternal.h", |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 299 | "../include/platform/internal/DeviceNetworkInfo.h", |
Pankaj Garg | 4239bcf | 2020-10-27 08:41:54 -0700 | [diff] [blame] | 300 | "../include/platform/internal/DeviceNetworkProvisioning.h", |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 301 | "../include/platform/internal/EventLogging.h", |
| 302 | "../include/platform/internal/GenericConfigurationManagerImpl.h", |
Michael Spang | feb81b6 | 2022-03-22 14:34:32 -0400 | [diff] [blame^] | 303 | "../include/platform/internal/GenericConfigurationManagerImpl.ipp", |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 304 | "../include/platform/internal/GenericConnectivityManagerImpl.h", |
| 305 | "../include/platform/internal/GenericConnectivityManagerImpl_BLE.h", |
Michael Spang | feb81b6 | 2022-03-22 14:34:32 -0400 | [diff] [blame^] | 306 | "../include/platform/internal/GenericConnectivityManagerImpl_BLE.ipp", |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 307 | "../include/platform/internal/GenericConnectivityManagerImpl_NoBLE.h", |
| 308 | "../include/platform/internal/GenericConnectivityManagerImpl_NoThread.h", |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 309 | "../include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h", |
| 310 | "../include/platform/internal/GenericConnectivityManagerImpl_Thread.h", |
Michael Spang | feb81b6 | 2022-03-22 14:34:32 -0400 | [diff] [blame^] | 311 | "../include/platform/internal/GenericConnectivityManagerImpl_Thread.ipp", |
Yufeng Wang | 2a1e8bc | 2020-09-27 23:27:02 -0700 | [diff] [blame] | 312 | "../include/platform/internal/GenericConnectivityManagerImpl_WiFi.h", |
Michael Spang | feb81b6 | 2022-03-22 14:34:32 -0400 | [diff] [blame^] | 313 | "../include/platform/internal/GenericConnectivityManagerImpl_WiFi.ipp", |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 314 | "../include/platform/internal/GenericPlatformManagerImpl.h", |
Michael Spang | feb81b6 | 2022-03-22 14:34:32 -0400 | [diff] [blame^] | 315 | "../include/platform/internal/GenericPlatformManagerImpl.ipp", |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 316 | "../include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.h", |
Michael Spang | feb81b6 | 2022-03-22 14:34:32 -0400 | [diff] [blame^] | 317 | "../include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.ipp", |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 318 | "../include/platform/internal/GenericPlatformManagerImpl_POSIX.h", |
Michael Spang | feb81b6 | 2022-03-22 14:34:32 -0400 | [diff] [blame^] | 319 | "../include/platform/internal/GenericPlatformManagerImpl_POSIX.ipp", |
| 320 | "../include/platform/internal/GenericPlatformManagerImpl_Zephyr.ipp", |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 321 | "../include/platform/internal/testing/ConfigUnitTest.h", |
Tennessee Carmel-Veilleux | 8f86c43 | 2022-03-11 15:49:56 -0500 | [diff] [blame] | 322 | "CommissionableDataProvider.cpp", |
Yufeng Wang | 17be4af | 2021-05-03 21:46:33 -0700 | [diff] [blame] | 323 | "DeviceControlServer.cpp", |
Yufeng Wang | 3e863a9 | 2021-11-22 11:41:21 -0800 | [diff] [blame] | 324 | "DiagnosticDataProvider.cpp", |
Zang MingJie | 659848c | 2021-09-03 23:13:45 +0800 | [diff] [blame] | 325 | "Entropy.cpp", |
Yufeng Wang | bb6bb37 | 2022-02-25 10:04:29 -0800 | [diff] [blame] | 326 | "FailSafeContext.cpp", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 327 | "GeneralUtils.cpp", |
| 328 | "Globals.cpp", |
Andrei Litvin | 4ae09b3 | 2021-05-11 09:14:27 -0400 | [diff] [blame] | 329 | "LockTracker.cpp", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 330 | "PersistedStorage.cpp", |
Zang MingJie | 39ff9bf | 2021-11-05 12:29:08 +0800 | [diff] [blame] | 331 | "PlatformEventSupport.cpp", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 332 | ] |
| 333 | |
jmartinez-silabs | a92d1a8 | 2022-02-07 12:50:17 -0500 | [diff] [blame] | 334 | # 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 Zbarsky | 444b50b | 2020-09-23 19:53:06 -0400 | [diff] [blame] | 342 | cflags = [ "-Wconversion" ] |
| 343 | |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 344 | public_deps = [ |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 345 | ":platform_base", |
Andrei Litvin | f04c428 | 2021-10-20 12:58:43 -0400 | [diff] [blame] | 346 | "${chip_root}/src/app:app_buildconfig", |
Yufeng Wang | 551e53f | 2021-10-26 13:41:18 -0700 | [diff] [blame] | 347 | "${chip_root}/src/app/common:cluster-objects", |
Zang MingJie | 659848c | 2021-09-03 23:13:45 +0800 | [diff] [blame] | 348 | "${chip_root}/src/crypto", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 349 | "${chip_root}/src/lib/support", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 350 | ] |
| 351 | |
Seth Rickard | 4f0521f | 2021-01-12 16:06:52 -0600 | [diff] [blame] | 352 | if (chip_device_platform == "cc13x2_26x2") { |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 353 | _platform_target = "cc13x2_26x2" |
Seth Rickard | 4f0521f | 2021-01-12 16:06:52 -0600 | [diff] [blame] | 354 | } else if (chip_device_platform == "darwin") { |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 355 | _platform_target = "Darwin" |
Rafał Kuźnia | 90bc94c | 2020-08-31 19:54:04 +0200 | [diff] [blame] | 356 | } else if (chip_device_platform == "efr32") { |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 357 | _platform_target = "EFR32" |
Rafał Kuźnia | 90bc94c | 2020-08-31 19:54:04 +0200 | [diff] [blame] | 358 | } else if (chip_device_platform == "esp32") { |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 359 | _platform_target = "ESP32" |
PetruSicoe | 0aac8fd | 2021-10-07 15:52:08 +0300 | [diff] [blame] | 360 | } else if (chip_device_platform == "k32w0") { |
| 361 | _platform_target = "nxp/k32w/k32w0" |
Michael Spang | 4314d81 | 2020-08-07 10:17:09 -0400 | [diff] [blame] | 362 | } else if (chip_device_platform == "linux") { |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 363 | _platform_target = "Linux" |
Rafał Kuźnia | 90bc94c | 2020-08-31 19:54:04 +0200 | [diff] [blame] | 364 | } else if (chip_device_platform == "nrfconnect") { |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 365 | _platform_target = "nrfconnect" |
Timothy Maes | 2478e02 | 2021-07-02 04:03:46 +0200 | [diff] [blame] | 366 | } else if (chip_device_platform == "qpg") { |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 367 | _platform_target = "qpg" |
Alexandr Kolosov | fc7146c | 2021-06-09 20:57:36 +0300 | [diff] [blame] | 368 | } else if (chip_device_platform == "telink") { |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 369 | _platform_target = "telink" |
Vincent Coubard | cc13560 | 2021-06-29 16:58:47 +0100 | [diff] [blame] | 370 | } else if (chip_device_platform == "mbed") { |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 371 | _platform_target = "mbed" |
Wootak Jung | e945d16 | 2021-09-13 10:39:32 +0900 | [diff] [blame] | 372 | } else if (chip_device_platform == "tizen") { |
| 373 | _platform_target = "Tizen" |
Hui.Li-TCL | 924f36e | 2021-09-30 20:51:41 +0800 | [diff] [blame] | 374 | } else if (chip_device_platform == "android") { |
| 375 | _platform_target = "android" |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 376 | } else if (chip_device_platform == "external") { |
| 377 | _platform_target = chip_platform_target |
Praveen Chandran | 080ae57 | 2021-08-12 07:58:27 -0700 | [diff] [blame] | 378 | } else if (chip_device_platform == "p6") { |
| 379 | _platform_target = "P6" |
pankore | 544da73c | 2021-10-19 02:51:16 +0800 | [diff] [blame] | 380 | } else if (chip_device_platform == "ameba") { |
| 381 | _platform_target = "Ameba" |
sungmok shin | b3c3799 | 2022-03-02 02:55:12 +0900 | [diff] [blame] | 382 | } else if (chip_device_platform == "webos") { |
| 383 | _platform_target = "webos" |
C Freeman | 79c9315 | 2021-08-18 00:20:05 -0400 | [diff] [blame] | 384 | } else if (chip_device_platform == "fake") { |
| 385 | _platform_target = "fake" |
Todd Chou | 1af90eb | 2022-01-21 12:29:29 +0800 | [diff] [blame] | 386 | } else if (chip_device_platform == "cyw30739") { |
| 387 | _platform_target = "CYW30739" |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 388 | } else { |
| 389 | assert(false, "Unknown chip_device_platform: ${chip_device_platform}") |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 390 | } |
Michael Spang | db9b861 | 2020-07-13 09:43:13 -0400 | [diff] [blame] | 391 | |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 392 | public_deps += [ _platform_target ] |
Kamil Kasperczyk | 4401402 | 2021-03-12 21:18:45 +0100 | [diff] [blame] | 393 | |
Michael Spang | 68fcef6 | 2021-07-05 21:50:23 -0400 | [diff] [blame] | 394 | # 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 Guo | d8f58a0 | 2020-08-19 00:23:40 +0800 | [diff] [blame] | 400 | } |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 401 | } else { |
| 402 | group("platform") { |
Jiacheng Guo | e4ac46a | 2020-11-11 00:04:34 +0800 | [diff] [blame] | 403 | public_deps = [ ":platform_buildconfig" ] |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 404 | } |
| 405 | } |