cmake: Minor refactor

Minor refactor of build script for readability and diff-ability.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2018-03-21 13:06:24 +01:00 committed by Anas Nashif
parent abc47a0717
commit 64f858874d

View file

@ -1,6 +1,10 @@
set(CONFIGS_C ${CMAKE_CURRENT_BINARY_DIR}/misc/generated/configs.c)
file(STRINGS ${AUTOCONF_H} CONFIG_LIST REGEX "^#define CONFIG_")
file(STRINGS
${AUTOCONF_H}
CONFIG_LIST
REGEX "^#define CONFIG_"
)
foreach (CONFIG ${CONFIG_LIST})
string(REGEX REPLACE "#define (CONFIG_[A-Z|_|0-9]*) (.*)" "GEN_ABSOLUTE_SYM(\\1, \\2)" CONFIG ${CONFIG})
string(REGEX REPLACE "\"(.*)\"" "1" CONFIG ${CONFIG})