From c6879d17e42a9476d8c1de5f8dc9f8972683099c Mon Sep 17 00:00:00 2001 From: Karsten Sperling Date: Mon, 8 May 2023 12:06:43 +1200 Subject: [PATCH] Tidy up dependencies of //examples/platform/linux:app-main - Use deps instead of public_deps where possible - Only build shell commands if chip_build_libshell is true - Remove explicit //src/lib/shell dependencies, it's already pulled in by //src/lib --- .../src/binding-handler.cpp | 18 +++---- examples/platform/linux/AppMain.cpp | 3 +- examples/platform/linux/BUILD.gn | 51 ++++++++----------- examples/platform/nxp/se05x/linux/BUILD.gn | 2 - 4 files changed, 30 insertions(+), 44 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp b/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp index 8aff2a6f268bd3..cd16efd4a3f054 100644 --- a/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp @@ -17,17 +17,17 @@ #include "binding-handler.h" -#include "app-common/zap-generated/ids/Clusters.h" -#include "app-common/zap-generated/ids/Commands.h" -#include "app/CommandSender.h" -#include "app/clusters/bindings/BindingManager.h" -#include "app/server/Server.h" -#include "controller/InvokeInteraction.h" -#include "lib/core/CHIPError.h" -#include "platform/CHIPDeviceLayer.h" +#include +#include +#include +#include +#include +#include +#include +#include #if defined(ENABLE_CHIP_SHELL) -#include "lib/shell/Engine.h" +#include // nogncheck using chip::Shell::Engine; using chip::Shell::shell_command_t; diff --git a/examples/platform/linux/AppMain.cpp b/examples/platform/linux/AppMain.cpp index 26dd7d557d83b0..bdfa8eba2f428e 100644 --- a/examples/platform/linux/AppMain.cpp +++ b/examples/platform/linux/AppMain.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -53,7 +52,7 @@ #if defined(ENABLE_CHIP_SHELL) #include -#include +#include // nogncheck #include #endif diff --git a/examples/platform/linux/BUILD.gn b/examples/platform/linux/BUILD.gn index 08580aad33c1f5..284a6c6116c579 100644 --- a/examples/platform/linux/BUILD.gn +++ b/examples/platform/linux/BUILD.gn @@ -35,12 +35,8 @@ source_set("app-main") { "AppMain.h", "CommissionableInit.cpp", "CommissionableInit.h", - "CommissioneeShellCommands.cpp", - "CommissioneeShellCommands.h", "CommissionerMain.cpp", "CommissionerMain.h", - "ControllerShellCommands.cpp", - "ControllerShellCommands.h", "LinuxCommissionableDataProvider.cpp", "LinuxCommissionableDataProvider.h", "NamedPipeCommands.cpp", @@ -53,29 +49,32 @@ source_set("app-main") { "testing/CustomCSRResponseOperationalKeyStore.h", ] - defines = [] + public_deps = [ + "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:force_stdio", + ] + deps = [ + ":ota-test-event-trigger", + "${chip_root}/examples/providers:device_info_provider", + "${chip_root}/src/app/server", + ] if (chip_enable_pw_rpc) { defines += [ "PW_RPC_ENABLED" ] } + if (chip_build_libshell) { defines += [ "ENABLE_CHIP_SHELL" ] + sources += [ + "CommissioneeShellCommands.cpp", + "CommissioneeShellCommands.h", + "ControllerShellCommands.cpp", + "ControllerShellCommands.h", + ] } - public_deps = [ - ":ota-test-event-trigger", - "${chip_root}/examples/providers:device_info_provider", - "${chip_root}/src/app/server", - "${chip_root}/src/credentials:default_attestation_verifier", - "${chip_root}/src/lib", - "${chip_root}/src/lib/shell", - "${chip_root}/src/lib/shell:shell_core", - "${chip_root}/src/platform/logging:force_stdio", - ] - if (chip_enable_transport_trace) { - public_deps += - [ "${chip_root}/examples/common/tracing:trace_handlers_decoder" ] + deps += [ "${chip_root}/examples/common/tracing:trace_handlers_decoder" ] } public_configs = [ ":app-main-config" ] @@ -88,25 +87,15 @@ source_set("commissioner-main") { "CommissionerMain.h", ] - defines = [] - - if (chip_enable_pw_rpc) { - defines += [ "PW_RPC_ENABLED" ] - } if (chip_build_libshell) { defines += [ "ENABLE_CHIP_SHELL" ] } - public_deps = [ - "${chip_root}/src/app/server", - "${chip_root}/src/credentials:default_attestation_verifier", - "${chip_root}/src/lib", - "${chip_root}/src/lib/shell", - "${chip_root}/src/lib/shell:shell_core", - ] + public_deps = [ "${chip_root}/src/lib" ] + deps = [ "${chip_root}/src/app/server" ] if (chip_enable_transport_trace) { - public_deps += [ "${chip_root}/examples/common/tracing:trace_handlers" ] + deps += [ "${chip_root}/examples/common/tracing:trace_handlers" ] } public_configs = [ ":app-main-config" ] diff --git a/examples/platform/nxp/se05x/linux/BUILD.gn b/examples/platform/nxp/se05x/linux/BUILD.gn index 4956883bcec584..52ce3d417617e5 100644 --- a/examples/platform/nxp/se05x/linux/BUILD.gn +++ b/examples/platform/nxp/se05x/linux/BUILD.gn @@ -108,8 +108,6 @@ source_set("commissioner-main") { "${chip_root}/src/app/server", "${chip_root}/src/credentials:default_attestation_verifier", "${chip_root}/src/lib", - "${chip_root}/src/lib/shell", - "${chip_root}/src/lib/shell:shell_core", ] if (chip_enable_transport_trace) {