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 = ""
29if (current_os == "fuchsia") {
30  _openthread_config_file = "<openthread-config-android.h>"
31}
32
33declare_args() {
34  # OpenThread config header.
35  openthread_config_file = _openthread_config_file
36
37  # Extra deps for OpenThread configuration.
38  openthread_config_deps = []
39
40  # Include directories for project specific configs.
41  openthread_project_include_dirs = []
42
43  # OpenThread project-specific core config header
44  openthread_project_core_config_file = ""
45
46  # OpenThread platform-specific config check header
47  openthread_core_config_platform_check_file = ""
48
49  # Extra deps for OpenThread core configuration.
50  openthread_core_config_deps = []
51
52  # Use external platform.
53  openthread_external_platform = ""
54
55  # Use external mbedtls. If blank, internal mbedtls will be used.
56  openthread_external_mbedtls = ""
57
58  # Package name for OpenThread.
59  openthread_package_name = "OPENTHREAD"
60
61  # Package version for OpenThread.
62  openthread_package_version = "1.0.0"
63}
64
65declare_args() {
66  # Configure OpenThread via GN arguments.
67  openthread_enable_core_config_args = openthread_project_core_config_file == ""
68}
69
70if (openthread_enable_core_config_args) {
71  declare_args() {
72    # Thread version: 1.1, 1.2
73    openthread_config_thread_version = ""
74
75    # Log output: none, debug_uart, app, platform
76    openthread_config_log_output = ""
77
78    # Enable assertions.
79    openthread_config_assert_enable = true
80
81    # Enable backbone router functionality
82    openthread_config_backbone_router_enable = false
83
84    # Enable border agent support
85    openthread_config_border_agent_enable = false
86
87    # Enable border router support
88    openthread_config_border_router_enable = false
89
90    # Enable border routing support
91    openthread_config_border_routing_enable = false
92
93    # Enable channel manager support
94    openthread_config_channel_manager_enable = false
95
96    # Enable channel monitor support
97    openthread_config_channel_monitor_enable = false
98
99    # Enable child supervision support
100    openthread_config_child_supervision_enable = false
101
102    # Enable coap api support
103    openthread_config_coap_api_enable = false
104
105    # Enable secure coap api support
106    openthread_config_coap_secure_api_enable = false
107
108    # Enable coap observe (RFC7641) api support
109    openthread_config_coap_observe_api_enable = false
110
111    # Enable commissioner support
112    openthread_config_commissioner_enable = false
113
114    # Enable csl receiver
115    openthread_config_mac_csl_receiver_enable = false
116
117    # Enable DHCP6 client support
118    openthread_config_dhcp6_client_enable = false
119
120    # Enable DHCP6 server support
121    openthread_config_dhcp6_server_enable = false
122
123    # Enable diagnostic support
124    openthread_config_diag_enable = false
125
126    # Enable DNS client support
127    openthread_config_dns_client_enable = false
128
129    # Enable DNS-SD server support
130    openthread_config_dnssd_server_enable = false
131
132    # Enable ECDSA support
133    openthread_config_ecdsa_enable = false
134
135    # Enable Domain Unicast Address feature for Thread 1.2
136    openthread_config_dua_enable = false
137
138    # Enable Multicast Listener Registration feature for Thread 1.2
139    openthread_config_mlr_enable = false
140
141    # Enable external heap support
142    openthread_config_heap_external_enable = false
143
144    # Enable ipv6 fragmentation support
145    openthread_config_ip6_fragmentation_enable = false
146
147    # Enable jam detection support
148    openthread_config_jam_detection_enable = false
149
150    # Enable joiner support
151    openthread_config_joiner_enable = false
152
153    # Enable legacy network support
154    openthread_config_legacy_enable = false
155
156    # Enable link metrics initiator
157    openthread_config_link_metrics_initiator_enable = false
158
159    # Enable link metrics subject
160    openthread_config_link_metrics_subject_enable = false
161
162    # Enable link raw service
163    openthread_config_link_raw_enable = false
164
165    # Enable dynamic log level control
166    openthread_config_log_level_dynamic_enable = false
167
168    # Enable mac filter support
169    openthread_config_mac_filter_enable = false
170
171    # Enable use built-in heap for message buffers
172    openthread_config_message_use_heap = false
173
174    # Enable MLE long routes extension (experimental, breaks Thread conformance]
175    openthread_config_mle_long_routes_enable = false
176
177    # Enable TMF network diagnostics on MTDs
178    openthread_config_tmf_network_diag_mtd_enable = false
179
180    # Enable multiple instances
181    openthread_config_multiple_instance_enable = false
182
183    # Enable platform netif support
184    openthread_config_platform_netif_enable = false
185
186    # Enable platform UDP support
187    openthread_config_platform_udp_enable = false
188
189    # Enable Thread Test Harness reference device support
190    openthread_config_reference_device_enable = false
191
192    # Enable support for injecting Service entries into the Thread Network Data
193    openthread_config_tmf_netdata_service_enable = false
194
195    # Enable volatile-only storage of settings
196    openthread_settings_ram = false
197
198    # Enable support for adding of auto-configured SLAAC addresses by OpenThread
199    openthread_config_ip6_slaac_enable = false
200
201    # Enable SNTP Client support
202    openthread_config_sntp_client_enable = false
203
204    # Enable SRP Client support
205    openthread_config_srp_client_enable = false
206
207    # Enable SRP Server support
208    openthread_config_srp_server_enable = false
209
210    # Enable ping sender support
211    openthread_config_ping_sender = false
212
213    # Enable the time synchronization service feature
214    openthread_config_time_sync_enable = false
215
216    # Enable UDP forward support
217    openthread_config_udp_forward_enable = false
218
219    # Enable full logs
220    openthread_config_full_logs = false
221
222    # Enable OTNS support
223    openthread_config_otns_enable = false
224
225    # Enable NCP SPI support
226    openthread_config_ncp_spi_enable = false
227
228    # Enable NCP HDLC support
229    openthread_config_ncp_hdlc_enable = false
230
231    # Enable builtin mbedtls management
232    openthread_config_enable_builtin_mbedtls_management =
233        openthread_external_mbedtls == ""
234  }
235}
236
237if (openthread_external_mbedtls != "") {
238  mbedtls_target = openthread_external_mbedtls
239} else {
240  mbedtls_target = "../../third_party/mbedtls"
241}
242