2019-04-06 15:08:09 +02:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2017-10-27 15:43:34 +02:00
|
|
|
set(CONFIGS_C ${CMAKE_CURRENT_BINARY_DIR}/misc/generated/configs.c)
|
|
|
|
|
2018-03-21 13:06:24 +01:00
|
|
|
file(STRINGS
|
|
|
|
${AUTOCONF_H}
|
2019-02-27 08:35:02 +01:00
|
|
|
LIST_OF_CONFIGS
|
2018-03-21 13:06:24 +01:00
|
|
|
REGEX "^#define CONFIG_"
|
2018-03-21 13:07:16 +01:00
|
|
|
ENCODING "UTF-8"
|
2018-03-21 13:06:24 +01:00
|
|
|
)
|
2019-02-27 08:35:02 +01:00
|
|
|
foreach (CONFIG ${LIST_OF_CONFIGS})
|
2021-11-17 12:13:33 +01:00
|
|
|
string(REGEX REPLACE "#define (CONFIG_[A-Za-z|_|0-9]*) (.*)" "GEN_ABSOLUTE_SYM_KCONFIG(\\1, \\2)" CONFIG ${CONFIG})
|
2017-10-27 15:43:34 +02:00
|
|
|
string(REGEX REPLACE "\"(.*)\"" "1" CONFIG ${CONFIG})
|
|
|
|
set(GEN_ABS_SYM_LIST "${GEN_ABS_SYM_LIST}${CONFIG};\n")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/configs.c.in ${CONFIGS_C})
|
|
|
|
zephyr_sources( ${CONFIGS_C})
|