Skip to content

Commit c1eefa3

Browse files
committed
Updated SDK target picking
1 parent fe01712 commit c1eefa3

File tree

1 file changed

+41
-36
lines changed

1 file changed

+41
-36
lines changed

src/system/BUILD.gn

+41-36
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ declare_args() {
4444
# see https://clang.llvm.org/docs/ThreadSafetyAnalysis.html
4545
chip_enable_thread_safety_checks = is_clang
4646

47-
chip_external_sdk_target = ""
47+
# SDK target for the platform
48+
# If left blank the SDK target will be determined by the device platform
49+
chip_platform_sdk_target = ""
4850
}
4951

5052
if (chip_project_config_include_dirs == [] &&
@@ -53,6 +55,42 @@ if (chip_project_config_include_dirs == [] &&
5355
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]
5456
}
5557

58+
if(chip_platform_sdk_target == "")
59+
{
60+
if (target_cpu != "esp32") {
61+
if (chip_system_config_use_lwip) {
62+
chip_platform_sdk_target = "${lwip_root}:lwip"
63+
} else {
64+
if (chip_device_platform == "efr32") {
65+
chip_platform_sdk_target = "${efr32_sdk_build_root}:efr32_sdk"
66+
}
67+
if (chip_device_platform == "qpg") {
68+
chip_platform_sdk_target = "${qpg_sdk_build_root}:qpg_sdk"
69+
}
70+
if (chip_device_platform == "nxp") {
71+
chip_platform_sdk_target = "${nxp_sdk_build_root}:nxp_sdk"
72+
}
73+
if (chip_device_platform == "cyw30739") {
74+
chip_platform_sdk_target = "${cyw30739_sdk_build_root}:cyw30739_sdk"
75+
}
76+
if (chip_device_platform == "stm32") {
77+
chip_platform_sdk_target = "${stm32_sdk_build_root}:stm32_sdk"
78+
}
79+
if (chip_device_platform == "bl702") {
80+
chip_platform_sdk_target = "${bouffalolab_iot_sdk_build_root}/bl702:bl_iot_sdk"
81+
}
82+
if (chip_device_platform == "bl702l") {
83+
chip_platform_sdk_target = "${bouffalolab_iot_sdk_build_root}/bl702l:bl_iot_sdk"
84+
}
85+
if (chip_device_platform == "mt793x") {
86+
chip_platform_sdk_target = "${mt793x_sdk_build_root}:mt793x_sdk"
87+
}
88+
89+
# Add platform here as needed.
90+
}
91+
}
92+
}
93+
5694
if (chip_device_platform == "cc13x4_26x4") {
5795
import("//build_overrides/ti_simplelink_sdk.gni")
5896
} else if (chip_device_platform == "efr32") {
@@ -174,41 +212,8 @@ source_set("system_config_header") {
174212

175213
public_deps = []
176214

177-
if (target_cpu != "esp32") {
178-
if (chip_system_config_use_lwip) {
179-
public_deps += [ "${lwip_root}:lwip" ]
180-
} else {
181-
if (chip_device_platform == "efr32") {
182-
public_deps += [ "${efr32_sdk_build_root}:efr32_sdk" ]
183-
}
184-
if (chip_device_platform == "qpg") {
185-
public_deps += [ "${qpg_sdk_build_root}:qpg_sdk" ]
186-
}
187-
if (chip_device_platform == "nxp") {
188-
public_deps += [ "${nxp_sdk_build_root}:nxp_sdk" ]
189-
}
190-
if (chip_device_platform == "cyw30739") {
191-
public_deps += [ "${cyw30739_sdk_build_root}:cyw30739_sdk" ]
192-
}
193-
if (chip_device_platform == "stm32") {
194-
public_deps += [ "${stm32_sdk_build_root}:stm32_sdk" ]
195-
}
196-
if (chip_device_platform == "bl702") {
197-
public_deps += [ "${bouffalolab_iot_sdk_build_root}/bl702:bl_iot_sdk" ]
198-
}
199-
if (chip_device_platform == "bl702l") {
200-
public_deps += [ "${bouffalolab_iot_sdk_build_root}/bl702l:bl_iot_sdk" ]
201-
}
202-
if (chip_external_sdk_target != "") {
203-
public_deps += [ "${chip_external_sdk_target}" ]
204-
}
205-
206-
# Add platform here as needed.
207-
}
208-
}
209-
210-
if (chip_device_platform == "mt793x") {
211-
public_deps += [ "${mt793x_sdk_build_root}:mt793x_sdk" ]
215+
if(chip_platform_sdk_target != "") {
216+
public_deps += [ chip_platform_sdk_target ]
212217
}
213218
}
214219

0 commit comments

Comments
 (0)