2019-04-06 21:08:09 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2017-10-27 21:43:34 +08:00
|
|
|
set(CONFIGS_C ${CMAKE_CURRENT_BINARY_DIR}/misc/generated/configs.c)
|
|
|
|
|
2018-03-21 20:06:24 +08:00
|
|
|
file(STRINGS
|
|
|
|
${AUTOCONF_H}
|
2019-02-27 15:35:02 +08:00
|
|
|
LIST_OF_CONFIGS
|
2018-03-21 20:06:24 +08:00
|
|
|
REGEX "^#define CONFIG_"
|
2018-03-21 20:07:16 +08:00
|
|
|
ENCODING "UTF-8"
|
2018-03-21 20:06:24 +08:00
|
|
|
)
|
2019-02-27 15:35:02 +08:00
|
|
|
foreach (CONFIG ${LIST_OF_CONFIGS})
|
2017-10-27 21:43:34 +08:00
|
|
|
string(REGEX REPLACE "#define (CONFIG_[A-Z|_|0-9]*) (.*)" "GEN_ABSOLUTE_SYM(\\1, \\2)" CONFIG ${CONFIG})
|
|
|
|
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})
|