CMakeLists.txt 620 B

123456789101112131415161718
  1. # SPDX-License-Identifier: Apache-2.0
  2. set(CONFIGS_C ${CMAKE_CURRENT_BINARY_DIR}/misc/generated/configs.c)
  3. file(STRINGS
  4. ${AUTOCONF_H}
  5. LIST_OF_CONFIGS
  6. REGEX "^#define CONFIG_"
  7. ENCODING "UTF-8"
  8. )
  9. foreach (CONFIG ${LIST_OF_CONFIGS})
  10. string(REGEX REPLACE "#define (CONFIG_[A-Z|_|0-9]*) (.*)" "GEN_ABSOLUTE_SYM_KCONFIG(\\1, \\2)" CONFIG ${CONFIG})
  11. string(REGEX REPLACE "\"(.*)\"" "1" CONFIG ${CONFIG})
  12. set(GEN_ABS_SYM_LIST "${GEN_ABS_SYM_LIST}${CONFIG};\n")
  13. endforeach()
  14. configure_file(${CMAKE_CURRENT_LIST_DIR}/configs.c.in ${CONFIGS_C})
  15. zephyr_sources( ${CONFIGS_C})