forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.gn
134 lines (112 loc) · 4.31 KB
/
BUILD.gn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/efr32_sdk.gni")
import("//build_overrides/pigweed.gni")
import("${build_root}/config/defaults.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")
import("$dir_pw_build/python.gni")
import("$dir_pw_protobuf_compiler/proto.gni")
assert(current_os == "freertos")
efr32_project_dir = "${chip_root}/src/test_driver/efr32"
examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32"
examples_common_plat_dir = "${chip_root}/examples/platform/silabs"
pw_proto_library("nl_test_service") {
sources = [ "${efr32_project_dir}/proto/nl_test.proto" ]
inputs = [ "${efr32_project_dir}/proto/nl_test.options" ]
deps = [ "$dir_pw_protobuf:common_protos" ]
strip_prefix = "${efr32_project_dir}/proto"
prefix = "nl_test_service"
}
efr32_sdk("sdk") {
sources = [
"${efr32_project_dir}/include/CHIPProjectConfig.h",
"${examples_common_plat_dir}/FreeRTOSConfig.h",
]
include_dirs = [
"${chip_root}/src/platform/silabs/efr32",
"${efr32_project_dir}/include",
"${examples_plat_dir}",
"${examples_common_plat_dir}",
]
defines = [
"PW_RPC_ENABLED",
# Thread is built but test driver do not have the NETWORK_COMMISSIONING cluster or zap config.
"_NO_GENERIC_THREAD_NETWORK_COMMISSIONING_DRIVER_",
]
}
config("efr32_ldflags") {
_ldscript =
"${chip_root}/examples/platform/silabs/ldscripts/${silabs_family}.ld"
ldflags = [
"-T" + rebase_path(_ldscript, root_build_dir),
"-Wl,--no-warn-rwx-segment",
]
}
# This is the test runner. `pw_test` will dep this for each `silabs_executable` target.
source_set("efr32_test_main") {
defines = [ "PW_RPC_ENABLED" ]
sources = [
"${chip_root}/examples/common/pigweed/RpcService.cpp",
"${chip_root}/examples/common/pigweed/efr32/PigweedLoggerMutex.cpp",
"${examples_common_plat_dir}/PigweedLogger.cpp",
"${examples_common_plat_dir}/provision/ProvisionStorageCustom.cpp",
"${examples_common_plat_dir}/provision/ProvisionStorageDefault.cpp",
"${examples_common_plat_dir}/syscalls_stubs.cpp",
"${examples_common_plat_dir}/uart.cpp",
"src/main.cpp",
]
deps = [
":nl_test_service.nanopb_rpc",
":sdk",
"$dir_pw_unit_test:rpc_service",
"${chip_root}/config/efr32/lib/pw_rpc:pw_rpc",
"${chip_root}/examples/common/pigweed:system_rpc_server",
"${chip_root}/src/lib",
"${chip_root}/src/lib/support:pw_tests_wrapper",
"${chip_root}/src/platform/silabs/provision:provision-headers",
"${examples_common_plat_dir}/pw_sys_io:pw_sys_io_silabs",
]
# OpenThread Settings
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread-platform",
"${examples_plat_dir}:efr-matter-shell",
]
}
deps += pw_build_LINK_DEPS
libs = [
"${sdk_support_root}/matter/provision/lib/libProvision_${silabs_family}.a",
]
include_dirs = [ "${chip_root}/examples/common/pigweed/efr32" ]
public_configs = [ ":efr32_ldflags" ]
}
# This target is referred to by BuildRoot in scripts/build/builders/efr32.py, as well as the example in README.md.
# It builds the root target "src:tests", which builds the chip_test_suite target in each test directory, which builds a pw_test target for each test source file, which builds a silabs_executable, which includes the "efr32_test_main" target defined above.
group("efr32") {
deps = [ "${chip_root}/src:tests" ]
}
group("runner") {
deps = [
"${efr32_project_dir}/py:pw_test_runner.install",
"${efr32_project_dir}/py:pw_test_runner_wheel",
]
}
group("default") {
deps = [ ":efr32" ]
}