Skip to content

Commit

Permalink
Tidy up dependencies of //examples/platform/linux:app-main
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
ksperling-apple committed May 9, 2023
1 parent 064a68d commit c6879d1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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>

#if defined(ENABLE_CHIP_SHELL)
#include "lib/shell/Engine.h"
#include <lib/shell/Engine.h> // nogncheck

using chip::Shell::Engine;
using chip::Shell::shell_command_t;
Expand Down
3 changes: 1 addition & 2 deletions examples/platform/linux/AppMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <platform/CHIPDeviceLayer.h>
#include <platform/PlatformManager.h>

#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <crypto/CHIPCryptoPAL.h>
Expand Down Expand Up @@ -53,7 +52,7 @@

#if defined(ENABLE_CHIP_SHELL)
#include <CommissioneeShellCommands.h>
#include <lib/shell/Engine.h>
#include <lib/shell/Engine.h> // nogncheck
#include <thread>
#endif

Expand Down
51 changes: 20 additions & 31 deletions examples/platform/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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" ]
Expand All @@ -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" ]
Expand Down
2 changes: 0 additions & 2 deletions examples/platform/nxp/se05x/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c6879d1

Please sign in to comment.