blob: 5fd24008e4f859c3aa5beb46ea0054ba12bb0a0b [file] [log] [blame]
# Copyright (c) 2023-2024 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")
import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/src/app/common_flags.gni")
import("${chip_root}/third_party/imgui/imgui.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")
}
config("includes") {
include_dirs = [
".",
"include",
]
}
executable("chip-energy-management-app") {
sources = [
"${chip_root}/examples/energy-management-app/energy-management-common/common/src/EnergyManagementAppCommonMain.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/common/src/EnergyTimeUtils.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/device-energy-management/src/DEMTestEventTriggers.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/device-energy-management/src/device-energy-management-mode.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/ChargingTargetsMemMgr.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/EVSEManufacturerImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseEventTriggers.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseMain.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseTargetsStore.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/energy-evse-mode.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-reporting/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-reporting/src/EnergyReportingEventTriggers.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-reporting/src/FakeReadings.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-reporting/src/PowerTopologyDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/water-heater/src/WhmDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/water-heater/src/WhmInstance.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/water-heater/src/WhmMain.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/water-heater/src/WhmManufacturer.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/water-heater/src/water-heater-mode.cpp",
"include/CHIPProjectAppConfig.h",
"main.cpp",
]
deps = [
"${chip_root}/examples/energy-management-app/energy-management-common",
"${chip_root}/examples/platform/linux:app-main",
"${chip_root}/src/app:attribute-persistence",
"${chip_root}/src/lib",
]
if (chip_examples_enable_imgui_ui) {
deps += [
"${chip_root}/examples/common/imgui_ui",
"${chip_root}/examples/common/imgui_ui/windows:occupancy_sensing",
"${chip_root}/examples/common/imgui_ui/windows:qrcode",
]
}
include_dirs = [
"include",
"${chip_root}/examples/energy-management-app/energy-management-common/common/include",
"${chip_root}/examples/energy-management-app/energy-management-common/device-energy-management/include",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/include",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-reporting/include",
"${chip_root}/examples/energy-management-app/energy-management-common/water-heater/include",
"${chip_root}/examples/all-clusters-app/all-clusters-common/include",
]
if (chip_enable_pw_rpc) {
defines = [
"PW_RPC_ENABLED",
"PW_RPC_ATTRIBUTE_SERVICE=1",
"PW_RPC_BUTTON_SERVICE=1",
"PW_RPC_DESCRIPTOR_SERVICE=1",
"PW_RPC_DEVICE_SERVICE=1",
"PW_RPC_ELEC_SERVICE=1",
"PW_RPC_EVSE_SERVICE=1",
"PW_RPC_LIGHTING_SERVICE=1",
"PW_RPC_TRACING_SERVICE=1",
]
sources += [
"${chip_root}/examples/platform/linux/Rpc.cpp",
"${chip_root}/examples/platform/linux/system_rpc_server.cc",
]
deps += [
"$dir_pw_hdlc:default_addresses",
"$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:elec_service.nanopb_rpc",
"${chip_root}/examples/common/pigweed:evse_service.nanopb_rpc",
"${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc",
"${chip_root}/examples/common/pigweed:rpc_services",
]
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
}
source_set("test-evse-targets-store") {
sources = [
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/ChargingTargetsMemMgr.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseTargetsStore.cpp",
]
include_dirs = [
"include",
"${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/include",
]
deps = [
"${chip_root}/examples/energy-management-app/energy-management-common",
"${chip_root}/src/lib",
]
}
group("linux") {
deps = [ ":chip-energy-management-app" ]
}
group("default") {
deps = [ ":linux" ]
}