Skip to content

Commit c387d9c

Browse files
zejiang0jasondanieldegrasse
authored andcommitted
modules: hal_nxp: mcux-sdk-ng: Fix LPC55S16 build error
Fix build error when CONFIG_MCUX_COMPONENT_driver.fro_calib is set. Error message: modules/hal/nxp/mcux/mcux-sdk-ng/cmake/extension/function.cmake:2084 (if) if given arguments: "IN_LIST" "NEED_WRAP_TOOLCHAINS" The error is because, mcux sdk ng cmake functions `mcux_add_xxx` support add content based on toolchains. CMake should set current toolchain in CMake Variable `CONFIG_TOOLCHAIN` to use this feature. Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
1 parent ac0bf59 commit c387d9c

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

modules/hal_nxp/mcux/mcux-sdk-ng/basic.cmake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,21 @@ function(set_variable_ifdef feature_toggle variable)
2020
set(${variable} ON PARENT_SCOPE)
2121
endif()
2222
endfunction()
23+
24+
# mcux sdk ng cmake functions `mcux_add_xxx` support add content based on
25+
# toolchains, like
26+
#
27+
# mcux_add_library(
28+
# LIBS ../iar/iar_lib_fro_calib_cm33_core0.a
29+
# TOOLCHAINS iar
30+
# )
31+
#
32+
# CMake should set current toolchain in CMake Variable
33+
# `CONFIG_TOOLCHAIN` to use this feature.
34+
if (${COMPILER} STREQUAL iar)
35+
set(CONFIG_TOOLCHAIN iar)
36+
elseif (${COMPILER} STREQUAL xcc)
37+
set(CONFIG_TOOLCHAIN xtensa)
38+
else ()
39+
set(CONFIG_TOOLCHAIN armgcc)
40+
endif()

scripts/ci/check_compliance.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,9 @@ def check_no_undef_outside_kconfig(self, kconf):
11371137
"STACK_SIZE", # Used as an example in the Kconfig docs
11381138
"STD_CPP", # Referenced in CMake comment
11391139
"TEST1",
1140+
"TOOLCHAIN", # Defined in modules/hal_nxp/mcux/mcux-sdk-ng/basic.cmake.
1141+
# It is used by MCUX SDK cmake functions to add content
1142+
# based on current toolchain.
11401143
"TOOLCHAIN_ARCMWDT_SUPPORTS_THREAD_LOCAL_STORAGE", # The symbol is defined in the toolchain
11411144
# Kconfig which is sourced based on Zephyr
11421145
# toolchain variant and therefore not visible

0 commit comments

Comments
 (0)