Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EFR32] Provide a way to build matter examples using a openthread library #21836

Merged
merged 18 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
restyle
  • Loading branch information
jmartinez-silabs committed Aug 15, 2022
commit 38b32c91ce5c07750eae878d0d0c738d5d1b2e5f
4 changes: 3 additions & 1 deletion examples/chef/efr32/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

# The location of the build configuration file.
buildconfig = "${build_root}/config/BUILDCONFIG.gn"

Expand All @@ -24,6 +25,7 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"
chip_openthread_ftd = true
openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
openthread_external_platform =
"${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
import("//args.gni")
}
16 changes: 5 additions & 11 deletions examples/chef/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import("${chip_root}/src/platform/device.gni")
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
import("${chip_root}/src/app/chip_data_model.gni")

if(chip_enable_openthread){
if (chip_enable_openthread) {
import("//build_overrides/openthread.gni")
}

Expand Down Expand Up @@ -209,28 +209,22 @@ efr32_executable("chef_app") {

# OpenThread Settings
if (chip_enable_openthread) {
deps += [
deps += [
"${chip_root}/src/platform:ot_device_deps",
"${examples_plat_dir}:efr-matter-shell",
]

if (chip_use_ot_lib) {
deps += [
"${efr32_sdk_build_root}:openthread_system",
]
deps += [ "${efr32_sdk_build_root}:openthread_system" ]
} else {
deps += [
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
]
if (chip_openthread_ftd) {
deps += [
"${openthread_root}:libopenthread-cli-ftd",
]
deps += [ "${openthread_root}:libopenthread-cli-ftd" ]
} else {
deps += [
"${openthread_root}:libopenthread-cli-mtd",
]
deps += [ "${openthread_root}:libopenthread-cli-mtd" ]
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion examples/light-switch-app/efr32/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"
chip_openthread_ftd = true
openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
openthread_external_platform =
"${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
import("//args.gni")
}
16 changes: 5 additions & 11 deletions examples/light-switch-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import("${efr32_sdk_build_root}/efr32_sdk.gni")
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
import("${chip_root}/src/platform/device.gni")

if(chip_enable_openthread){
if (chip_enable_openthread) {
import("//build_overrides/openthread.gni")
}

Expand Down Expand Up @@ -202,28 +202,22 @@ efr32_executable("light_switch_app") {

# OpenThread Settings
if (chip_enable_openthread) {
deps += [
deps += [
"${chip_root}/src/platform:ot_device_deps",
"${examples_plat_dir}:efr-matter-shell",
]

if (chip_use_ot_lib) {
deps += [
"${efr32_sdk_build_root}:openthread_system",
]
deps += [ "${efr32_sdk_build_root}:openthread_system" ]
} else {
deps += [
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
]
if (chip_openthread_ftd) {
deps += [
"${openthread_root}:libopenthread-cli-ftd",
]
deps += [ "${openthread_root}:libopenthread-cli-ftd" ]
} else {
deps += [
"$${openthread_root}:libopenthread-cli-mtd",
]
deps += [ "$${openthread_root}:libopenthread-cli-mtd" ]
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion examples/lighting-app/efr32/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"
chip_openthread_ftd = true
openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
openthread_external_platform =
"${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
import("//args.gni")
}
18 changes: 6 additions & 12 deletions examples/lighting-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import("//build_overrides/efr32_sdk.gni")
import("//build_overrides/pigweed.gni")

import("${build_root}/config/defaults.gni")
import("${efr32_sdk_build_root}/efr32_executable.gni")
import("${efr32_sdk_build_root}/efr32_board.gni")
import("${efr32_sdk_build_root}/efr32_executable.gni")
import("${efr32_sdk_build_root}/efr32_sdk.gni")

import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
import("${chip_root}/src/platform/device.gni")

if(chip_enable_openthread){
if (chip_enable_openthread) {
import("//build_overrides/openthread.gni")
}

Expand Down Expand Up @@ -208,28 +208,22 @@ efr32_executable("lighting_app") {

# OpenThread Settings
if (chip_enable_openthread) {
deps += [
deps += [
"${chip_root}/src/platform:ot_device_deps",
"${examples_plat_dir}:efr-matter-shell",
]

if (chip_use_ot_lib) {
deps += [
"${efr32_sdk_build_root}:openthread_system",
]
deps += [ "${efr32_sdk_build_root}:openthread_system" ]
} else {
deps += [
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
]
if (chip_openthread_ftd) {
deps += [
"${openthread_root}:libopenthread-cli-ftd",
]
deps += [ "${openthread_root}:libopenthread-cli-ftd" ]
} else {
deps += [
"${openthread_root}:libopenthread-cli-mtd",
]
deps += [ "${openthread_root}:libopenthread-cli-mtd" ]
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion examples/lock-app/efr32/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"
chip_openthread_ftd = true
openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
openthread_external_platform =
"${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
import("//args.gni")
}
16 changes: 5 additions & 11 deletions examples/lock-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import("${efr32_sdk_build_root}/efr32_sdk.gni")
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
import("${chip_root}/src/platform/device.gni")

if(chip_enable_openthread){
if (chip_enable_openthread) {
import("//build_overrides/openthread.gni")
}

Expand Down Expand Up @@ -204,28 +204,22 @@ efr32_executable("lock_app") {

# OpenThread Settings
if (chip_enable_openthread) {
deps += [
deps += [
"${chip_root}/src/platform:ot_device_deps",
"${examples_plat_dir}:efr-matter-shell",
]

if (chip_use_ot_lib) {
deps += [
"${efr32_sdk_build_root}:openthread_system",
]
deps += [ "${efr32_sdk_build_root}:openthread_system" ]
} else {
deps += [
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
]
if (chip_openthread_ftd) {
deps += [
"${openthread_root}:libopenthread-cli-ftd",
]
deps += [ "${openthread_root}:libopenthread-cli-ftd" ]
} else {
deps += [
"${openthread_root}:libopenthread-cli-mtd",
]
deps += [ "${openthread_root}:libopenthread-cli-mtd" ]
}
}
}
Expand Down
16 changes: 5 additions & 11 deletions examples/platform/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,11 @@ source_set("openthread_core_config_efr32_chip_examples") {

public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ]

if (chip_use_ot_lib == true)
{
public_deps += [
"${chip_root}/third_party/silabs:openthread_core_config_efr32",
]
}
else
{
public_deps += [
"${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32",
]
if (chip_use_ot_lib == true) {
public_deps +=
[ "${chip_root}/third_party/silabs:openthread_core_config_efr32" ]
} else {
public_deps += [ "${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32" ]
}

public_configs = [ ":chip_examples_project_config" ]
Expand Down
3 changes: 2 additions & 1 deletion examples/window-app/efr32/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"
chip_openthread_ftd = true
openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
openthread_external_platform =
"${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
import("//args.gni")
}
16 changes: 5 additions & 11 deletions examples/window-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import("${efr32_sdk_build_root}/efr32_sdk.gni")

assert(current_os == "freertos")

if(chip_enable_openthread){
if (chip_enable_openthread) {
import("//build_overrides/openthread.gni")
}

Expand Down Expand Up @@ -190,28 +190,22 @@ efr32_executable("window_app") {

# OpenThread Settings
if (chip_enable_openthread) {
deps += [
deps += [
"${chip_root}/src/platform:ot_device_deps",
"${examples_plat_dir}:efr-matter-shell",
]

if (chip_use_ot_lib) {
deps += [
"${efr32_sdk_build_root}:openthread_system",
]
deps += [ "${efr32_sdk_build_root}:openthread_system" ]
} else {
deps += [
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
]
if (chip_openthread_ftd) {
deps += [
"${openthread_root}:libopenthread-cli-ftd",
]
deps += [ "${openthread_root}:libopenthread-cli-ftd" ]
} else {
deps += [
"$${openthread_root}:libopenthread-cli-mtd",
]
deps += [ "$${openthread_root}:libopenthread-cli-mtd" ]
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/inet/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ static_library("inet") {
}

if (chip_system_config_use_open_thread_inet_endpoints) {
public_deps += [
"${chip_root}/src/platform:ot_device_deps",
]
public_deps += [ "${chip_root}/src/platform:ot_device_deps" ]
}

if (chip_inet_config_enable_tcp_endpoint) {
Expand Down
22 changes: 10 additions & 12 deletions src/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -458,21 +458,19 @@ if (chip_device_platform != "none") {
}
}

if (chip_enable_openthread)
{
group("ot_device_deps")
{
if (chip_use_ot_lib){
assert(chip_ot_lib_source_set != "", "Provide the location of your ot lib source set using the arg chip_ot_lib_source_set")
public_deps = chip_ot_lib_source_set
if (chip_enable_openthread) {
group("ot_device_deps") {
if (chip_use_ot_lib) {
assert(
chip_ot_lib_source_set != "",
"Provide the location of your ot lib source set using the arg chip_ot_lib_source_set")
public_deps = chip_ot_lib_source_set
} else {
if (chip_openthread_ftd) {
public_deps =
[ "${openthread_root}:libopenthread-ftd" ]
public_deps = [ "${openthread_root}:libopenthread-ftd" ]
} else {
public_deps =
[ "${openthread_root}:libopenthread-mtd" ]
public_deps = [ "${openthread_root}:libopenthread-mtd" ]
}
}
}
}
}
13 changes: 6 additions & 7 deletions src/platform/EFR32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")
import("//build_overrides/efr32_sdk.gni")
import("//build_overrides/pigweed.gni")

import("${chip_root}/src/platform/device.gni")

Expand Down Expand Up @@ -99,12 +99,11 @@ static_library("EFR32") {
"$dir_pw_kvs",
]
if (chip_enable_openthread) {
public_deps += [
"${chip_root}/src/platform:ot_device_deps",
]

if (chip_use_ot_lib == false){
public_deps += [ "${chip_root}/third_party/openthread/platforms:openthread_system"]
public_deps += [ "${chip_root}/src/platform:ot_device_deps" ]

if (chip_use_ot_lib == false) {
public_deps +=
[ "${chip_root}/third_party/openthread/platforms:openthread_system" ]
}

sources += [
Expand Down
3 changes: 2 additions & 1 deletion src/platform/EFR32/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ chip_with_lwip = false
chip_build_tests = false

openthread_root = "${chip_root}/third_party/openthread/ot-efr32/openthread"
openthread_core_config_platform_check_file = "openthread-core-efr32-config-check.h"
openthread_core_config_platform_check_file =
"openthread-core-efr32-config-check.h"
openthread_project_core_config_file = "OpenThreadConfig.h"
openthread_core_config_deps = [ "${chip_root}/examples/platform/efr32:openthread_core_config_efr32_chip_examples" ]

Expand Down
3 changes: 2 additions & 1 deletion src/test_driver/efr32/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ check_system_includes = true
default_args = {
target_cpu = "arm"
target_os = "freertos"
openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
openthread_external_platform =
jmartinez-silabs marked this conversation as resolved.
Show resolved Hide resolved
"${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
import("//args.gni")
}
Loading