Skip to content

Commit

Permalink
Add support for out of tree LayerImpl implementation (#14452)
Browse files Browse the repository at this point in the history
Co-authored-by: Sundarajan Srinivasan <sundarsrini@google.com>
  • Loading branch information
2 people authored and pull[bot] committed Sep 5, 2023
1 parent 4ffffe9 commit 1766596
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/platform/device.gni
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,15 @@ if (chip_device_platform != "external") {
chip_platform_config_include = ""
chip_inet_platform_config_include = ""
chip_system_platform_config_include = ""
chip_system_layer_impl_config_file = ""
} else {
declare_args() {
chip_ble_platform_config_include = ""
chip_device_platform_config_include = ""
chip_platform_config_include = ""
chip_inet_platform_config_include = ""
chip_system_platform_config_include = ""
chip_system_layer_impl_config_file = ""
}
}

Expand Down
15 changes: 12 additions & 3 deletions src/system/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ buildconfig_header("system_buildconfig") {
]
}

defines += [ "CHIP_SYSTEM_LAYER_IMPL_CONFIG_FILE=<system/SystemLayerImpl${chip_system_config_event_loop}.h>" ]
if (chip_system_layer_impl_config_file != "") {
defines += [ "CHIP_SYSTEM_LAYER_IMPL_CONFIG_FILE=${chip_system_layer_impl_config_file}" ]
} else {
defines += [ "CHIP_SYSTEM_LAYER_IMPL_CONFIG_FILE=<system/SystemLayerImpl${chip_system_config_event_loop}.h>" ]
}
}

config("system_config") {
Expand Down Expand Up @@ -135,8 +139,6 @@ static_library("system") {
"SystemFaultInjection.h",
"SystemLayer.cpp",
"SystemLayer.h",
"SystemLayerImpl${chip_system_config_event_loop}.cpp",
"SystemLayerImpl${chip_system_config_event_loop}.h",
"SystemLayerImpl.h",
"SystemMutex.cpp",
"SystemMutex.h",
Expand All @@ -154,6 +156,13 @@ static_library("system") {
"WakeEvent.h",
]

if (chip_system_layer_impl_config_file == "") {
sources += [
"SystemLayerImpl${chip_system_config_event_loop}.cpp",
"SystemLayerImpl${chip_system_config_event_loop}.h",
]
}

cflags = [ "-Wconversion" ]

public_deps = [
Expand Down

0 comments on commit 1766596

Please sign in to comment.