-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
Copy pathBUILD.gn
181 lines (154 loc) · 6.02 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# Copyright (c) 2020-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_root}/config/compiler/compiler.gni")
import("${chip_root}/build/chip/java/config.gni")
import("${chip_root}/build/chip/tests.gni")
import("${chip_root}/src/ble/ble.gni")
import("${chip_root}/src/platform/device.gni")
import("${chip_root}/src/tracing/tracing_args.gni")
# chip_root relative to root_build_dir for macro-prefix-map.
# "/." avoids trailing "/" in result when chip_root is "//"
build_relative_chip_root = rebase_path("${chip_root}/.", root_build_dir)
config("includes") {
include_dirs = [
"include",
".",
"${root_gen_dir}/include",
]
if (chip_device_platform == "external" &&
chip_external_platform_include_dir != "") {
include_dirs += [ "${chip_external_platform_include_dir}" ]
}
defines = [ "CHIP_HAVE_CONFIG_H=1" ]
# Make __FILE__ and related macros relative to chip_root
cflags = [ "-fmacro-prefix-map=${build_relative_chip_root}/=" ]
}
if (chip_build_tests) {
import("${chip_root}/build/chip/chip_test_group.gni")
chip_test_group("tests") {
deps = []
tests = [
"${chip_root}/src/access/tests",
"${chip_root}/src/app/data-model/tests",
"${chip_root}/src/app/cluster-building-blocks/tests",
"${chip_root}/src/app/data-model-provider/tests",
"${chip_root}/src/app/icd/server/tests",
"${chip_root}/src/crypto/tests",
"${chip_root}/src/inet/tests",
"${chip_root}/src/lib/address_resolve/tests",
"${chip_root}/src/lib/asn1/tests",
"${chip_root}/src/lib/core/tests",
"${chip_root}/src/lib/format/tests",
"${chip_root}/src/messaging/tests",
"${chip_root}/src/protocols/bdx/tests",
"${chip_root}/src/protocols/interaction_model/tests",
"${chip_root}/src/protocols/secure_channel/tests",
"${chip_root}/src/protocols/user_directed_commissioning/tests",
"${chip_root}/src/system/tests",
"${chip_root}/src/transport/retransmit/tests",
"${chip_root}/src/transport/tests",
]
# Skip DNSSD tests for Mbed platform due to flash memory size limitations
if (current_os != "mbed") {
tests += [
"${chip_root}/src/lib/dnssd/minimal_mdns/core/tests",
"${chip_root}/src/lib/dnssd/minimal_mdns/responders/tests",
"${chip_root}/src/lib/dnssd/minimal_mdns/tests",
"${chip_root}/src/lib/dnssd/tests",
]
}
if (current_os != "zephyr" && current_os != "mbed") {
tests += [ "${chip_root}/src/lib/dnssd/minimal_mdns/records/tests" ]
}
if (current_os != "zephyr" && current_os != "mbed") {
# Avoid these items from "one single binary" test executions. Once tests
# are split, we can re-visit this (and likely many others).
#
# In particular: "data-model-providers/codegen/tests" contains
# symbols for ember mocks which are used by other tests.
tests += [
"${chip_root}/src/data-model-providers/codegen/tests",
"${chip_root}/src/setup_payload/tests",
"${chip_root}/src/transport/raw/tests",
]
}
if (chip_device_platform != "efr32") {
tests += [
"${chip_root}/src/app/tests",
# Disabled for EFR32 because _open is not implemented.
# https://github.com/project-chip/connectedhomeip/issues/35624
"${chip_root}/src/credentials/tests",
"${chip_root}/src/lib/support/tests",
]
}
if (matter_enable_tracing_support &&
matter_trace_config == "${chip_root}/src/tracing/multiplexed") {
tests += [ "${chip_root}/src/tracing/tests" ]
}
if (chip_device_platform != "none") {
tests += [ "${chip_root}/src/lib/dnssd/minimal_mdns/tests" ]
}
if (chip_device_platform != "esp32" && chip_device_platform != "ameba") {
tests += [ "${chip_root}/src/platform/tests" ]
}
if (chip_config_network_layer_ble) {
tests += [ "${chip_root}/src/ble/tests" ]
}
# On nrfconnect, the controller tests run into
# https://github.com/project-chip/connectedhomeip/issues/9630
if (chip_device_platform != "nrfconnect") {
tests += [ "${chip_root}/src/controller/tests/data_model" ]
# Skip controller test for Open IoT SDK
# https://github.com/project-chip/connectedhomeip/issues/23747
if (chip_device_platform != "openiotsdk") {
tests += [ "${chip_root}/src/controller/tests" ]
}
}
if (current_os != "zephyr" && current_os != "mbed" &&
chip_device_platform != "esp32" && chip_device_platform != "ameba") {
tests += [ "${chip_root}/src/lib/shell/tests" ]
}
if (chip_monolithic_tests) {
deps += [ "${chip_root}/src/lib/support:pw_tests_wrapper" ]
build_monolithic_library = true
output_name = "libCHIP_tests"
output_dir = "${root_out_dir}/lib"
}
}
chip_test_group("example_tests") {
deps = []
tests = []
if (chip_device_platform != "esp32" && chip_device_platform != "efr32" &&
current_os != "android") {
tests += [ "${chip_root}/examples/energy-management-app/energy-management-common/tests" ]
}
}
chip_test_group("fake_platform_tests") {
tests = [ "${chip_root}/src/lib/dnssd/platform/tests" ]
}
# Tests to run with each Crypto PAL
chip_test_group("crypto_tests") {
tests = [
"${chip_root}/src/credentials/tests",
"${chip_root}/src/crypto/tests",
]
}
if (matter_enable_java_compilation) {
group("java_controller_tests") {
deps = [ "${chip_root}/src/controller/java:unit_tests" ]
}
}
}