Skip to content

Commit 18a5a40

Browse files
authored
K32W: Fix header paths breaking --check builds (project-chip#7620)
Some header paths are specified incorrectly. This is only an error when generating the build with the --check option: ERROR at //third_party/k32w_sdk/k32w_sdk.gni:218:3: Source file not found. source_set(sdk_target_name) { ^---------------------------- The target: //examples/lock-app/k32w:sdk has a source file: //examples/platform/k32w/OpenThreadConfig.h which was not found. Fix the paths and enable --check. Tested by: (cd ./examples/lock-app/k32w; gn gen --check out/debug --args='k32w_sdk_root="/home/spang/sdk/k32w_sdk"'; ninja -C out/debug)
1 parent 5f79529 commit 18a5a40

File tree

8 files changed

+42
-9
lines changed

8 files changed

+42
-9
lines changed

BUILD.gn

+24
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,14 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
226226
# Build the efr32 window app example.
227227
enable_efr32_window_app_build = enable_efr32_builds
228228

229+
# Build the k32w lighting app example.
230+
enable_k32w_lighting_app_build = enable_k32w_builds
231+
229232
# Build the k32w lock app example.
230233
enable_k32w_lock_app_build = enable_k32w_builds
234+
235+
# Build the k32w shell app example.
236+
enable_k32w_shell_app_build = enable_k32w_builds
231237
}
232238

233239
if (enable_host_clang_build) {
@@ -348,12 +354,24 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
348354
}
349355
}
350356

357+
if (enable_k32w_lighting_app_build) {
358+
group("k32w_lighting_app") {
359+
deps = [ "${chip_root}/examples/lighting-app/k32w(${chip_root}/config/k32w/toolchain:k32w_lighting_app)" ]
360+
}
361+
}
362+
351363
if (enable_k32w_lock_app_build) {
352364
group("k32w_lock_app") {
353365
deps = [ "${chip_root}/examples/lock-app/k32w(${chip_root}/config/k32w/toolchain:k32w_lock_app)" ]
354366
}
355367
}
356368

369+
if (enable_k32w_shell_app_build) {
370+
group("k32w_shell_app") {
371+
deps = [ "${chip_root}/examples/shell/k32w(${chip_root}/config/k32w/toolchain:k32w_shell_app)" ]
372+
}
373+
}
374+
357375
group("default") {
358376
deps = []
359377
if (enable_host_clang_build) {
@@ -403,9 +421,15 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
403421
if (enable_efr32_window_app_build) {
404422
deps += [ ":efr32_window_app" ]
405423
}
424+
if (enable_k32w_lighting_app_build) {
425+
deps += [ ":k32w_lighting_app" ]
426+
}
406427
if (enable_k32w_lock_app_build) {
407428
deps += [ ":k32w_lock_app" ]
408429
}
430+
if (enable_k32w_shell_app_build) {
431+
deps += [ ":k32w_shell_app" ]
432+
}
409433
if (enable_qpg6100_lock_app_build) {
410434
deps += [ ":qpg6100_lock_app" ]
411435
}

config/k32w/toolchain/BUILD.gn

+14
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,23 @@ import("//build_overrides/chip.gni")
1717

1818
import("${build_root}/toolchain/arm_gcc/arm_toolchain.gni")
1919

20+
arm_toolchain("k32w_lighting_app") {
21+
toolchain_args = {
22+
current_os = "freertos"
23+
import("${chip_root}/examples/lighting-app/k32w/args.gni")
24+
}
25+
}
26+
2027
arm_toolchain("k32w_lock_app") {
2128
toolchain_args = {
2229
current_os = "freertos"
2330
import("${chip_root}/examples/lock-app/k32w/args.gni")
2431
}
2532
}
33+
34+
arm_toolchain("k32w_shell_app") {
35+
toolchain_args = {
36+
current_os = "freertos"
37+
import("${chip_root}/examples/shell/k32w/args.gni")
38+
}
39+
}

examples/lighting-app/k32w/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ k32w_platform_dir = "${chip_root}/examples/platform/k32w"
2525

2626
k32w_sdk("sdk") {
2727
sources = [
28-
"${k32w_platform_dir}/OpenThreadConfig.h",
28+
"${k32w_platform_dir}/app/project_include/OpenThreadConfig.h",
2929
"include/CHIPProjectConfig.h",
3030
"include/FreeRTOSConfig.h",
3131
"main/include/app_config.h",

examples/lock-app/k32w/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ k32w_platform_dir = "${chip_root}/examples/platform/k32w"
2626

2727
k32w_sdk("sdk") {
2828
sources = [
29-
"${k32w_platform_dir}/OpenThreadConfig.h",
29+
"${k32w_platform_dir}/app/project_include/OpenThreadConfig.h",
3030
"include/CHIPProjectConfig.h",
3131
"include/FreeRTOSConfig.h",
3232
"main/include/app_config.h",

examples/shell/efr32/args.gni

-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain")
2121
pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip"
2222
pw_assert_BACKEND = "$dir_pw_assert_log"
2323
chip_enable_openthread = true
24-
chip_build_shell_lib = true

examples/shell/k32w/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ k32w_platform_dir = "${chip_root}/examples/platform/k32w"
2626

2727
k32w_sdk("sdk") {
2828
sources = [
29-
"${k32w_platform_dir}/OpenThreadConfig.h",
29+
"${k32w_platform_dir}/app/project_include/OpenThreadConfig.h",
3030
"include/CHIPProjectConfig.h",
3131
"include/FreeRTOSConfig.h",
3232
"main/include/app_config.h",

examples/shell/k32w/args.gni

-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,3 @@ import("${chip_root}/examples/platform/k32w/args.gni")
1818
import("${chip_root}/src/platform/K32W/args.gni")
1919

2020
k32w_sdk_target = get_label_info(":sdk", "label_no_toolchain")
21-
22-
pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip"
23-
pw_assert_BACKEND = "$dir_pw_assert_log"
24-
chip_build_shell_lib = true

scripts/examples/k32w_example.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ env
2727

2828
"$(dirname "$0")"/../../third_party/k32w_sdk/sdk_fixes/patch_k32w_sdk.sh
2929

30-
gn gen --root="$1" "$2" --args="k32w_sdk_root=\"$K32W061_SDK_ROOT\" is_debug=false"
30+
gn gen --check --fail-on-unused-args --root="$1" "$2" --args="k32w_sdk_root=\"$K32W061_SDK_ROOT\" is_debug=false"
3131
ninja -C "$2"

0 commit comments

Comments
 (0)