blob: 1ed00756d01bccf7227b105f6330b380e3cacfa5 [file] [log] [blame]
# Copyright (c) 2021 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/build.gni")
import("//build_overrides/chip.gni")
import("${chip_root}/build/chip/chip_codegen.gni")
import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/src/app/common_flags.gni")
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
if (chip_enable_pw_rpc) {
import("//build_overrides/pigweed.gni")
import("$dir_pw_build/target_types.gni")
}
assert(chip_build_tools)
chip_codegen("chip-bridge-codegen") {
input =
"${chip_root}/examples/dynamic-bridge-app/bridge-common/bridge-app.matter"
generator = "bridge"
outputs = [
"bridge/OnOff.h",
"bridge/LevelControl.h",
"bridge/Descriptor.h",
"bridge/Switch.h",
"bridge/TemperatureMeasurement.h",
"bridge/BridgeClustersImpl.h",
"bridge/BridgeGlobalStructs.h",
]
}
executable("dynamic-chip-bridge-app") {
sources = [
"Backend.cpp",
"Clusters.cpp",
"Device.cpp",
"DynamicDevice.cpp",
"UserInputBackend.cpp",
"bridged-actions-stub.cpp",
"main.cpp",
]
deps = [
":chip-bridge-codegen",
"${chip_root}/examples/dynamic-bridge-app/bridge-common:dynamic-bridge-common",
"${chip_root}/examples/platform/linux:app-main",
"${chip_root}/src/app/tests/suites/credentials:dac_provider",
"${chip_root}/src/lib",
]
include_dirs = [
"include",
target_gen_dir,
]
if (chip_enable_pw_rpc) {
defines = [
"PW_RPC_ENABLED",
"PW_RPC_ATTRIBUTE_SERVICE=1",
"PW_RPC_DESCRIPTOR_SERVICE=1",
"PW_RPC_DEVICE_SERVICE=1",
"PW_RPC_TRACING_SERVICE=1",
]
sources += [
"${chip_root}/examples/platform/linux/Rpc.cpp",
"${chip_root}/examples/platform/linux/system_rpc_server.cc",
"bridge_service.cpp",
]
deps += [
"$dir_pw_hdlc:pw_rpc",
"$dir_pw_hdlc:rpc_channel_output",
"$dir_pw_log",
"$dir_pw_rpc:server",
"$dir_pw_rpc/system_server:facade",
"$dir_pw_stream:socket_stream",
"$dir_pw_stream:sys_io_stream",
"$dir_pw_sync:mutex",
"$dir_pw_trace",
"$dir_pw_trace_tokenized",
"$dir_pw_trace_tokenized:trace_rpc_service",
"${chip_root}/config/linux/lib/pw_rpc:pw_rpc",
"${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc",
"${chip_root}/examples/common/pigweed:button_service.nanopb_rpc",
"${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc",
"${chip_root}/examples/common/pigweed:device_service.nanopb_rpc",
"${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc",
"${chip_root}/examples/common/pigweed:rpc_services",
"${chip_root}/examples/dynamic-bridge-app/bridge-common:bridge_service.nanopb_rpc",
]
deps += pw_build_LINK_DEPS
include_dirs += [ "${chip_root}/examples/common" ]
} else {
# The system_rpc_server.cc file is in pigweed and doesn't compile with
# -Wconversion, remove check for RPC build only.
cflags = [ "-Wconversion" ]
}
output_dir = root_out_dir
}
group("linux") {
deps = [ ":dynamic-chip-bridge-app" ]
}
group("default") {
deps = [ ":linux" ]
}