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
- Remove explicit dependency on OTATestEventTriggerDelegate.h
  • Loading branch information
ksperling-apple committed May 8, 2023
1 parent 3668631 commit d166080
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 39 deletions.
56 changes: 19 additions & 37 deletions examples/platform/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,15 @@ config("app-main-config") {
include_dirs = [ "." ]
}

source_set("ota-test-event-trigger") {
sources = [
"${chip_root}/src/app/clusters/ota-requestor/OTATestEventTriggerDelegate.h",
]
}

source_set("app-main") {
defines = []
sources = [
"AppMain.cpp",
"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 +43,31 @@ source_set("app-main") {
"testing/CustomCSRResponseOperationalKeyStore.h",
]

defines = []
public_deps = [
"${chip_root}/src/lib",
"${chip_root}/src/platform/logging:force_stdio",
]
deps = [
"${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 +80,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 d166080

Please sign in to comment.