| # 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/build.gni") |
| import("//build_overrides/chip.gni") |
| |
| import("${build_root}/config/compiler/compiler.gni") |
| import("${chip_root}/build/chip/tools.gni") |
| import("${chip_root}/src/app/chip_data_model.gni") |
| import("${chip_root}/src/app/common_flags.gni") |
| |
| assert(chip_build_tools) |
| |
| 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") |
| } |
| |
| import("sample.gni") |
| |
| project_dir = "./.." |
| |
| chip_data_model("chef-data-model") { |
| zap_file = "${project_dir}/devices/${sample_zap_file}" |
| is_server = true |
| } |
| |
| executable("${sample_name}") { |
| sources = [ |
| "${project_dir}/common/chef-air-quality.cpp", |
| "${project_dir}/common/chef-concentration-measurement.cpp", |
| "${project_dir}/common/chef-dishwasher-alarm-delegate-impl.cpp", |
| "${project_dir}/common/chef-dishwasher-mode-delegate-impl.cpp", |
| "${project_dir}/common/chef-fan-control-manager.cpp", |
| "${project_dir}/common/chef-laundry-washer-controls-delegate-impl.cpp", |
| "${project_dir}/common/chef-laundry-washer-mode.cpp", |
| "${project_dir}/common/chef-operational-state-delegate-impl.cpp", |
| "${project_dir}/common/chef-rpc-actions-worker.cpp", |
| "${project_dir}/common/chef-rvc-mode-delegate.cpp", |
| "${project_dir}/common/chef-rvc-operational-state-delegate.cpp", |
| "${project_dir}/common/clusters/audio-output/AudioOutputManager.cpp", |
| "${project_dir}/common/clusters/channel/ChannelManager.cpp", |
| "${project_dir}/common/clusters/door-lock/chef-doorlock-stubs.cpp", |
| "${project_dir}/common/clusters/door-lock/chef-lock-endpoint.cpp", |
| "${project_dir}/common/clusters/door-lock/chef-lock-manager.cpp", |
| "${project_dir}/common/clusters/keypad-input/KeypadInputManager.cpp", |
| "${project_dir}/common/clusters/low-power/LowPowerManager.cpp", |
| "${project_dir}/common/clusters/media-input/MediaInputManager.cpp", |
| "${project_dir}/common/clusters/media-playback/MediaPlaybackManager.cpp", |
| "${project_dir}/common/clusters/resource-monitoring/chef-resource-monitoring-delegates.cpp", |
| "${project_dir}/common/clusters/switch/SwitchEventHandler.cpp", |
| "${project_dir}/common/clusters/switch/SwitchManager.cpp", |
| "${project_dir}/common/clusters/target-navigator/TargetNavigatorManager.cpp", |
| "${project_dir}/common/clusters/wake-on-lan/WakeOnLanManager.cpp", |
| "${project_dir}/common/stubs.cpp", |
| "${project_dir}/linux/main.cpp", |
| ] |
| |
| deps = [ |
| ":chef-data-model", |
| "${chip_root}/examples/platform/linux:app-main", |
| "${chip_root}/src/lib", |
| "${project_dir}/shell_common:shell_common", |
| ] |
| |
| include_dirs = [ |
| "include", |
| "${project_dir}/common", |
| "${project_dir}/common/clusters", |
| ] |
| |
| if (chip_enable_pw_rpc) { |
| defines = [ |
| "PW_RPC_ENABLED", |
| "PW_RPC_ACTIONS_SERVICE=1", |
| "PW_RPC_ATTRIBUTE_SERVICE=1", |
| "PW_RPC_BOOLEAN_STATE_SERVICE=1", |
| "PW_RPC_BUTTON_SERVICE=1", |
| "PW_RPC_DESCRIPTOR_SERVICE=1", |
| "PW_RPC_DEVICE_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:actions_service.nanopb_rpc", |
| "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", |
| "${chip_root}/examples/common/pigweed:boolean_state_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", |
| ] |
| |
| deps += pw_build_LINK_DEPS |
| |
| cflags = [] |
| if (is_clang) { |
| cflags += [ "-Wno-gnu-designator" ] |
| } |
| |
| 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("chef") { |
| deps = [ ":${sample_name}" ] |
| } |
| |
| group("default") { |
| deps = [ ":chef" ] |
| } |