forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathBUILD.gn
122 lines (102 loc) · 3.65 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
# Copyright (c) 2020 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/chip.gni")
import("//build_overrides/nxp_sdk.gni")
import("//build_overrides/openthread.gni")
import("${chip_root}/src/crypto/crypto.gni")
import("${chip_root}/src/platform/device.gni")
import("${nxp_sdk_build_root}/nxp_sdk.gni")
openthread_nxp_root = "${chip_root}/third_party/openthread/ot-nxp"
config("openthread_k32w1_config") {
include_dirs = [
"${openthread_nxp_root}/src/k32w1",
"${openthread_nxp_root}/src/mcxw71",
]
defines = [
"OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE=1",
"OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1",
"MBEDTLS_ENTROPY_HARDWARE_ALT=1",
"MBEDTLS_THREADING_C=1",
"MBEDTLS_THREADING_ALT=1",
]
if (chip_mdns == "platform") {
defines += [
"OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE=1",
"OPENTHREAD_CONFIG_ECDSA_ENABLE=1",
"OPENTHREAD_CONFIG_DNS_CLIENT_SERVICE_DISCOVERY_ENABLE=1",
"OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1",
]
}
if (nxp_use_smu2_dynamic) {
defines += [
"OPENTHREAD_CONFIG_MESSAGE_USE_HEAP_ENABLE=1",
"OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT=0",
]
}
if (nxp_nvm_component == "littlefs") {
defines += [ "OT_PLAT_SAVE_NVM_DATA_ON_IDLE=0" ]
} else if (nxp_nvm_component == "nvs") {
defines += [ "CONFIG_SETTINGS_RUNTIME=1" ]
}
}
source_set("openthread_core_config_k32w1") {
sources = [
"${openthread_nxp_root}/src/k32w1/openthread-core-k32w1-config-check.h",
"${openthread_nxp_root}/src/k32w1/openthread-core-k32w1-config.h",
]
public_configs = [ ":openthread_k32w1_config" ]
if (!nxp_external_sdk) {
public_deps = [ nxp_sdk_target ]
}
}
source_set("libopenthread-k32w1") {
sources = [
"${openthread_nxp_root}/src/common/crypto.c",
"${openthread_nxp_root}/src/k32w1/alarm.c",
"${openthread_nxp_root}/src/k32w1/diag.c",
"${openthread_nxp_root}/src/k32w1/entropy.c",
"${openthread_nxp_root}/src/k32w1/logging.c",
"${openthread_nxp_root}/src/k32w1/misc.c",
"${openthread_nxp_root}/src/k32w1/radio.c",
"${openthread_nxp_root}/src/k32w1/system.c",
"${openthread_nxp_root}/src/k32w1/uart.c",
]
if (chip_crypto == "platform") {
sources += [ "${openthread_nxp_root}/src/common/crypto/ecdsa_sss.cpp" ]
if (nxp_use_hw_sha256) {
sources += [ "${openthread_nxp_root}/src/common/crypto/sha256_sss.cpp" ]
}
if (nxp_use_hw_aes) {
sources += [ "${openthread_nxp_root}/src/common/crypto/aes_sss.cpp" ]
}
if (nxp_nvm_component == "fwk_nvm") {
sources += [ "${openthread_nxp_root}/src/common/flash_nvm.c" ]
} else if (nxp_nvm_component == "littlefs") {
sources += [ "${openthread_nxp_root}/src/common/flash_fsa.c" ]
} else if (nxp_nvm_component == "nvs") {
sources += [ "${openthread_nxp_root}/src/common/flash_nvs.c" ]
}
}
if (nxp_enable_ot_cli) {
sources += [ "${openthread_root}/examples/apps/cli/cli_uart.cpp" ]
}
public_deps = [
"../..:libopenthread-platform",
"../..:libopenthread-platform-utils",
]
public_deps += [ "${nxp_sdk_build_root}:nxp_mbedtls" ]
if (!nxp_external_sdk) {
public_deps += [ nxp_sdk_target ]
}
}