| # Copyright (c) 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/build.gni") |
| import("//build_overrides/chip.gni") |
| |
| import("//build_overrides/editline.gni") |
| import("${chip_root}/build/chip/tools.gni") |
| import("${chip_root}/examples/fabric-admin/fabric-admin.gni") |
| import("${chip_root}/src/lib/core/core.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") |
| } |
| |
| config("config") { |
| include_dirs = [ |
| ".", |
| "${chip_root}/examples/common", |
| "${chip_root}/examples/platform/linux", |
| "${chip_root}/zzz_generated/app-common/app-common", |
| "${chip_root}/zzz_generated/chip-tool", |
| "${chip_root}/src/lib", |
| ] |
| |
| defines = [ "CONFIG_USE_SEPARATE_EVENTLOOP=${config_use_separate_eventloop}" ] |
| |
| # Note: CONFIG_USE_LOCAL_STORAGE is tested for via #ifdef, not #if. |
| if (config_use_local_storage) { |
| defines += [ "CONFIG_USE_LOCAL_STORAGE" ] |
| } |
| |
| if (chip_enable_pw_rpc) { |
| defines += [ "PW_RPC_ENABLED" ] |
| } |
| } |
| |
| static_library("fabric-admin-utils") { |
| sources = [ |
| "${chip_root}/src/controller/ExamplePersistentStorage.cpp", |
| "${chip_root}/src/controller/ExamplePersistentStorage.h", |
| "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp", |
| "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp", |
| "commands/clusters/ModelCommand.cpp", |
| "commands/clusters/ModelCommand.h", |
| "commands/clusters/ReportCommand.cpp", |
| "commands/clusters/ReportCommand.h", |
| "commands/common/CHIPCommand.cpp", |
| "commands/common/CHIPCommand.h", |
| "commands/common/Command.cpp", |
| "commands/common/Command.h", |
| "commands/common/Commands.cpp", |
| "commands/common/Commands.h", |
| "commands/common/CredentialIssuerCommands.h", |
| "commands/common/HexConversion.h", |
| "commands/common/RemoteDataModelLogger.cpp", |
| "commands/common/RemoteDataModelLogger.h", |
| "commands/fabric-sync/FabricSyncCommand.cpp", |
| "commands/pairing/OpenCommissioningWindowCommand.cpp", |
| "commands/pairing/OpenCommissioningWindowCommand.h", |
| "commands/pairing/PairingCommand.cpp", |
| "commands/pairing/ToTLVCert.cpp", |
| "device_manager/DeviceManager.cpp", |
| "device_manager/DeviceManager.h", |
| ] |
| |
| deps = [ "${chip_root}/src/app:events" ] |
| |
| sources += [ "commands/interactive/InteractiveCommands.cpp" ] |
| deps += [ |
| "${chip_root}/src/platform/logging:headers", |
| "${editline_root}:editline", |
| ] |
| |
| if (chip_device_platform == "darwin") { |
| sources += [ "commands/common/DeviceScanner.cpp" ] |
| } |
| |
| public_deps = [ |
| "${chip_root}/examples/common/tracing:commandline", |
| "${chip_root}/src/app/icd/client:handler", |
| "${chip_root}/src/app/icd/client:manager", |
| "${chip_root}/src/app/server", |
| "${chip_root}/src/app/tests/suites/commands/interaction_model", |
| "${chip_root}/src/controller/data_model", |
| "${chip_root}/src/credentials:file_attestation_trust_store", |
| "${chip_root}/src/lib", |
| "${chip_root}/src/lib/core:types", |
| "${chip_root}/src/lib/support/jsontlv", |
| "${chip_root}/src/platform", |
| "${chip_root}/third_party/inipp", |
| "${chip_root}/third_party/jsoncpp", |
| ] |
| |
| public_configs = [ ":config" ] |
| |
| if (chip_enable_pw_rpc) { |
| defines = [ |
| "PW_RPC_FABRIC_ADMIN_SERVICE=1", |
| "PW_RPC_FABRIC_BRIDGE_SERVICE=1", |
| ] |
| |
| sources += [ |
| "${chip_root}/examples/platform/linux/RpcClientProcessor.cpp", |
| "${chip_root}/examples/platform/linux/RpcClientProcessor.h", |
| "${chip_root}/examples/platform/linux/system_rpc_server.cc", |
| "rpc/RpcClient.cpp", |
| "rpc/RpcClient.h", |
| "rpc/RpcServer.cpp", |
| "rpc/RpcServer.h", |
| ] |
| |
| 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_rpc/system_server:socket", |
| "$dir_pw_stream:socket_stream", |
| "$dir_pw_sync:mutex", |
| "${chip_root}/config/linux/lib/pw_rpc:pw_rpc", |
| "${chip_root}/examples/common/pigweed:fabric_admin_service.nanopb_rpc", |
| "${chip_root}/examples/common/pigweed:fabric_bridge_service.nanopb_rpc", |
| "${chip_root}/examples/common/pigweed:rpc_services", |
| ] |
| |
| deps += pw_build_LINK_DEPS |
| } else { |
| # The system_rpc_server.cc file is in pigweed and doesn't compile with |
| # -Wconversion, remove check for RPC build only. |
| cflags = [ "-Wconversion" ] |
| } |
| |
| if (chip_enable_transport_trace) { |
| public_deps += |
| [ "${chip_root}/examples/common/tracing:trace_handlers_decoder" ] |
| } |
| |
| output_dir = root_out_dir |
| } |
| |
| executable("fabric-admin") { |
| sources = [ "main.cpp" ] |
| |
| deps = [ |
| ":fabric-admin-utils", |
| "${chip_root}/src/platform/logging:stdio", |
| ] |
| |
| output_dir = root_out_dir |
| } |
| |
| group("default") { |
| deps = [ ":fabric-admin" ] |
| } |