Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit 52301d9

Browse files
tejlmandcarlescufi
authored andcommitted
cmake: kconfig: fix issue if Kconfig symbol name contains lower case
Fixes: zephyrproject-rtos#40420 If a Kconfig has lower case in its symbol name, then the file configs.c is wrongly generated. For example a Kconfig snippet like this: > config FAIL_this > bool "Test fail" > default y will create an autoconf.h containing this: > #define CONFIG_FAIL_this 1 but the configs.c will wrongly contain the same > #define CONFIG_FAIL_this 1 instead of: > GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_FAIL_this, 1); which results in following error at compile time .../build/zephyr/misc/generated/configs.c: In function '_ConfigAbsSyms': .../build/zephyr/misc/generated/configs.c:309: warning: "CONFIG_FAIL_this" redefined 309 | #define CONFIG_FAIL_this 1; | In file included from <command-line>: .../build/zephyr/include/generated/autoconf.h:299: note: this is the location of the previous definition 299 | #define CONFIG_FAIL_this 1 | The file misc/generated/CMakeLists.txt has been updated to correctly handled lower casing in Kconfig symbol names. Signed-off-by: Torsten Rasmussen <[email protected]>
1 parent 525fa76 commit 52301d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

misc/generated/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ file(STRINGS
99
ENCODING "UTF-8"
1010
)
1111
foreach (CONFIG ${LIST_OF_CONFIGS})
12-
string(REGEX REPLACE "#define (CONFIG_[A-Z|_|0-9]*) (.*)" "GEN_ABSOLUTE_SYM_KCONFIG(\\1, \\2)" CONFIG ${CONFIG})
12+
string(REGEX REPLACE "#define (CONFIG_[A-Za-z|_|0-9]*) (.*)" "GEN_ABSOLUTE_SYM_KCONFIG(\\1, \\2)" CONFIG ${CONFIG})
1313
string(REGEX REPLACE "\"(.*)\"" "1" CONFIG ${CONFIG})
1414
set(GEN_ABS_SYM_LIST "${GEN_ABS_SYM_LIST}${CONFIG};\n")
1515
endforeach()

0 commit comments

Comments
 (0)