blob: 9237b06ce6ae138417d629a65b634583393fc335 [file] [log] [blame]
# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build_overrides/chip.gni")
declare_args() {
# Device platform layer: darwin, efr32, esp32, external, freertos, linux, nrfconnect, k32w, qpg6100, none.
chip_device_platform = "auto"
chip_platform_target = ""
}
if (chip_device_platform == "auto") {
if (current_os == "mac" || current_os == "ios") {
chip_device_platform = "darwin"
} else if (current_os == "linux") {
chip_device_platform = "linux"
} else {
chip_device_platform = "none"
}
}
declare_args() {
# Enable openthread support.
chip_enable_openthread =
chip_device_platform == "linux" || chip_device_platform == "efr32" ||
chip_device_platform == "k32w"
# Enable wifi support.
chip_enable_wifi = chip_device_platform == "linux"
# Enable ble support.
chip_enable_ble =
chip_device_platform == "linux" || chip_device_platform == "darwin"
chip_enable_mdns =
chip_device_platform == "linux" || chip_device_platform == "esp32"
}
_chip_device_layer = "none"
if (chip_device_platform == "darwin") {
_chip_device_layer = "Darwin"
} else if (chip_device_platform == "efr32") {
_chip_device_layer = "EFR32"
} else if (chip_device_platform == "esp32") {
_chip_device_layer = "ESP32"
} else if (chip_device_platform == "linux") {
_chip_device_layer = "Linux"
} else if (chip_device_platform == "nrfconnect") {
_chip_device_layer = "nrfconnect"
} else if (chip_device_platform == "qpg6100") {
_chip_device_layer = "qpg6100"
} else if (chip_device_platform == "k32w") {
_chip_device_layer = "K32W"
}
if (chip_device_platform != "external") {
chip_ble_platform_config_include = ""
chip_device_platform_config_include = ""
chip_platform_config_include = ""
chip_inet_platform_config_include = ""
chip_system_platform_config_include = ""
} else {
declare_args() {
chip_ble_platform_config_include = ""
chip_device_platform_config_include = ""
chip_platform_config_include = ""
chip_inet_platform_config_include = ""
chip_system_platform_config_include = ""
}
}
if (_chip_device_layer != "none" && chip_device_platform != "external") {
chip_ble_platform_config_include =
"<platform/" + _chip_device_layer + "/BlePlatformConfig.h>"
chip_device_platform_config_include =
"<platform/" + _chip_device_layer + "/CHIPDevicePlatformConfig.h>"
chip_platform_config_include =
"<platform/" + _chip_device_layer + "/CHIPPlatformConfig.h>"
chip_inet_platform_config_include =
"<platform/" + _chip_device_layer + "/InetPlatformConfig.h>"
chip_system_platform_config_include =
"<platform/" + _chip_device_layer + "/SystemPlatformConfig.h>"
}
assert(
(current_os != "freertos" && chip_device_platform == "none") ||
chip_device_platform == "darwin" || chip_device_platform == "efr32" ||
chip_device_platform == "esp32" || chip_device_platform == "external" ||
chip_device_platform == "linux" ||
chip_device_platform == "nrfconnect" ||
chip_device_platform == "k32w" || chip_device_platform == "qpg6100",
"Please select a valid value for chip_device_platform")