1#  Copyright (c) 2020, The OpenThread Authors.
2#  All rights reserved.
3#
4#  Redistribution and use in source and binary forms, with or without
5#  modification, are permitted provided that the following conditions are met:
6#  1. Redistributions of source code must retain the above copyright
7#     notice, this list of conditions and the following disclaimer.
8#  2. Redistributions in binary form must reproduce the above copyright
9#     notice, this list of conditions and the following disclaimer in the
10#     documentation and/or other materials provided with the distribution.
11#  3. Neither the name of the copyright holder nor the
12#     names of its contributors may be used to endorse or promote products
13#     derived from this software without specific prior written permission.
14#
15#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18#  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19#  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20#  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21#  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22#  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23#  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE]
24#  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25#  POSSIBILITY OF SUCH DAMAGE.
26#
27
28_openthread_config_file = ""
29
30declare_args() {
31  # OpenThread config header.
32  openthread_config_file = _openthread_config_file
33
34  # Extra deps for OpenThread configuration.
35  openthread_config_deps = []
36
37  # Include directories for project specific configs.
38  openthread_project_include_dirs = []
39
40  # OpenThread project-specific core config header
41  openthread_project_core_config_file = ""
42
43  # OpenThread platform-specific config check header
44  openthread_core_config_platform_check_file = ""
45
46  # Extra deps for OpenThread core configuration.
47  openthread_core_config_deps = []
48
49  # Use external platform.
50  openthread_external_platform = ""
51
52  # Use external mbedtls. If blank, internal mbedtls will be used.
53  openthread_external_mbedtls = ""
54
55  # Package name for OpenThread.
56  openthread_package_name = "OPENTHREAD"
57
58  # Package version for OpenThread.
59  openthread_package_version = "1.0.0"
60}
61
62declare_args() {
63  # Configure OpenThread via GN arguments.
64  openthread_enable_core_config_args = openthread_project_core_config_file == ""
65}
66
67if (openthread_enable_core_config_args) {
68  declare_args() {
69    # Thread version: 1.1, 1.2
70    openthread_config_thread_version = ""
71
72    # Log output: none, debug_uart, app, platform
73    openthread_config_log_output = ""
74
75    # Enable assertions.
76    openthread_config_assert_enable = true
77
78    # Enable anycast locator functionality
79    openthread_config_anycast_locator_enable = false
80
81    # Enable backbone router functionality
82    openthread_config_backbone_router_enable = false
83
84    # Enable BLE based commissioning functionality
85    openthread_config_ble_tcat_enable = false
86
87    # Enable border agent support
88    openthread_config_border_agent_enable = false
89
90    # Enable border agent ID
91    openthread_config_border_agent_id_enable = false
92
93    # Enable border router support
94    openthread_config_border_router_enable = false
95
96    # Enable border routing support
97    openthread_config_border_routing_enable = false
98
99    # Enable channel manager support
100    openthread_config_channel_manager_enable = false
101
102    # Enable channel monitor support
103    openthread_config_channel_monitor_enable = false
104
105    # Enable child supervision support
106    openthread_config_child_supervision_enable = false
107
108    # Enable coap api support
109    openthread_config_coap_api_enable = false
110
111    # Enable secure coap api support
112    openthread_config_coap_secure_api_enable = false
113
114    # Enable coap observe (RFC7641) api support
115    openthread_config_coap_observe_api_enable = false
116
117    # Enable commissioner support
118    openthread_config_commissioner_enable = false
119
120    # Enable csl receiver
121    openthread_config_mac_csl_receiver_enable = false
122
123    # Enable DHCP6 client support
124    openthread_config_dhcp6_client_enable = false
125
126    # Enable DHCP6 server support
127    openthread_config_dhcp6_server_enable = false
128
129    # Enable diagnostic support
130    openthread_config_diag_enable = false
131
132    # Enable DNS client support
133    openthread_config_dns_client_enable = false
134
135    # Enable DNS-SD server support
136    openthread_config_dnssd_server_enable = false
137
138    # Enable ECDSA support
139    openthread_config_ecdsa_enable = false
140
141    # Enable Domain Unicast Address feature for Thread 1.2
142    openthread_config_dua_enable = false
143
144    # Enable Multicast Listener Registration feature for Thread 1.2
145    openthread_config_mlr_enable = false
146
147    # Enable external heap support
148    openthread_config_heap_external_enable = false
149
150    # Enable ipv6 fragmentation support
151    openthread_config_ip6_fragmentation_enable = false
152
153    # Enable jam detection support
154    openthread_config_jam_detection_enable = false
155
156    # Enable joiner support
157    openthread_config_joiner_enable = false
158
159    # Enable legacy network support
160    openthread_config_legacy_enable = false
161
162    # Enable link metrics initiator
163    openthread_config_link_metrics_initiator_enable = false
164
165    # Enable link metrics subject
166    openthread_config_link_metrics_subject_enable = false
167
168    # Enable link raw service
169    openthread_config_link_raw_enable = false
170
171    # Enable dynamic log level control
172    openthread_config_log_level_dynamic_enable = false
173
174    # Enable mac filter support
175    openthread_config_mac_filter_enable = false
176
177    # Enable use built-in heap for message buffers
178    openthread_config_message_use_heap = false
179
180    # Enable MLE long routes extension (experimental, breaks Thread conformance]
181    openthread_config_mle_long_routes_enable = false
182
183    # Enable TMF network diagnostics client
184    openthread_config_tmf_netdiag_client_enable = false
185
186    # Enable multiple instances
187    openthread_config_multiple_instance_enable = false
188
189    # Enable platform netif support
190    openthread_config_platform_netif_enable = false
191
192    # Enable platform UDP support
193    openthread_config_platform_udp_enable = false
194
195    # Enable Thread Test Harness reference device support
196    openthread_config_reference_device_enable = false
197
198    # Enable support for injecting Service entries into the Thread Network Data
199    openthread_config_tmf_netdata_service_enable = false
200
201    # Enable volatile-only storage of settings
202    openthread_settings_ram = false
203
204    # Enable support for adding of auto-configured SLAAC addresses by OpenThread
205    openthread_config_ip6_slaac_enable = false
206
207    # Enable SNTP Client support
208    openthread_config_sntp_client_enable = false
209
210    # Enable SRP Client support
211    openthread_config_srp_client_enable = false
212
213    # Enable SRP Server support
214    openthread_config_srp_server_enable = false
215
216    # Enable ping sender support
217    openthread_config_ping_sender = false
218
219    # Enable the time synchronization service feature
220    openthread_config_time_sync_enable = false
221
222    # Enable UDP forward support
223    openthread_config_udp_forward_enable = false
224
225    # Enable full logs
226    openthread_config_full_logs = false
227
228    # Enable OTNS support
229    openthread_config_otns_enable = false
230
231    # Enable NCP SPI support
232    openthread_config_ncp_spi_enable = false
233
234    # Enable NCP HDLC support
235    openthread_config_ncp_hdlc_enable = false
236
237    # Enable builtin mbedtls management
238    openthread_config_enable_builtin_mbedtls_management =
239        openthread_external_mbedtls == ""
240
241    # Enable radio coexistence
242    openthread_config_coexistence_enable = false
243  }
244}
245
246if (openthread_external_mbedtls != "") {
247  mbedtls_target = openthread_external_mbedtls
248} else {
249  mbedtls_target = "../../third_party/mbedtls"
250}
251