1 # Copyright (c) 2020 Project CHIP Authors
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 import("//build_overrides/chip.gni")
16 import("${chip_root}/src/ble/ble.gni")
19 # Device platform layer: cc13x2_26x2, darwin, efr32, esp32, external, freertos, linux, nrfconnect, k32w, qpg6100, none.
20 chip_device_platform = "auto"
21 chip_platform_target = ""
24 if (chip_device_platform == "auto") {
25 if (current_os == "mac" || current_os == "ios") {
26 chip_device_platform = "darwin"
27 } else if (current_os == "linux") {
28 chip_device_platform = "linux"
30 chip_device_platform = "none"
35 # Enable openthread support.
36 chip_enable_openthread =
37 chip_device_platform == "linux" || chip_device_platform == "qpg6100" ||
38 chip_device_platform == "cc13x2_26x2" || chip_device_platform == "k32w"
40 # Enable wifi support.
41 chip_enable_wifi = chip_device_platform == "linux"
45 chip_config_network_layer_ble &&
46 (chip_device_platform == "linux" || chip_device_platform == "darwin" ||
47 chip_device_platform == "cc13x2_26x2")
49 if (chip_device_platform == "linux" || chip_device_platform == "esp32") {
56 _chip_device_layer = "none"
57 if (chip_device_platform == "cc13x2_26x2") {
58 _chip_device_layer = "cc13x2_26x2"
59 } else if (chip_device_platform == "darwin") {
60 _chip_device_layer = "Darwin"
61 } else if (chip_device_platform == "efr32") {
62 _chip_device_layer = "EFR32"
63 } else if (chip_device_platform == "esp32") {
64 _chip_device_layer = "ESP32"
65 } else if (chip_device_platform == "linux") {
66 _chip_device_layer = "Linux"
67 } else if (chip_device_platform == "nrfconnect") {
68 _chip_device_layer = "nrfconnect"
69 } else if (chip_device_platform == "qpg6100") {
70 _chip_device_layer = "qpg6100"
71 } else if (chip_device_platform == "k32w") {
72 _chip_device_layer = "K32W"
75 if (chip_device_platform != "external") {
76 chip_ble_platform_config_include = ""
77 chip_device_platform_config_include = ""
78 chip_platform_config_include = ""
79 chip_inet_platform_config_include = ""
80 chip_system_platform_config_include = ""
83 chip_ble_platform_config_include = ""
84 chip_device_platform_config_include = ""
85 chip_platform_config_include = ""
86 chip_inet_platform_config_include = ""
87 chip_system_platform_config_include = ""
91 if (_chip_device_layer != "none" && chip_device_platform != "external") {
92 chip_ble_platform_config_include =
93 "<platform/" + _chip_device_layer + "/BlePlatformConfig.h>"
94 chip_device_platform_config_include =
95 "<platform/" + _chip_device_layer + "/CHIPDevicePlatformConfig.h>"
96 chip_platform_config_include =
97 "<platform/" + _chip_device_layer + "/CHIPPlatformConfig.h>"
98 chip_inet_platform_config_include =
99 "<platform/" + _chip_device_layer + "/InetPlatformConfig.h>"
100 chip_system_platform_config_include =
101 "<platform/" + _chip_device_layer + "/SystemPlatformConfig.h>"
105 (current_os != "freertos" && chip_device_platform == "none") ||
106 chip_device_platform == "cc13x2_26x2" ||
107 chip_device_platform == "darwin" || chip_device_platform == "efr32" ||
108 chip_device_platform == "esp32" || chip_device_platform == "external" ||
109 chip_device_platform == "linux" ||
110 chip_device_platform == "nrfconnect" ||
111 chip_device_platform == "k32w" || chip_device_platform == "qpg6100",
112 "Please select a valid value for chip_device_platform")