cmake: only generate sdkconfig on top level project

This commit is contained in:
Renz Christian Bagaporo 2019-01-15 23:07:17 +08:00
parent 5c9ab21d81
commit eb6dbeb15a

View file

@ -109,7 +109,6 @@ function(kconfig_process_config)
--kconfig ${ROOT_KCONFIG} --kconfig ${ROOT_KCONFIG}
--config ${SDKCONFIG} --config ${SDKCONFIG}
${defaults_arg} ${defaults_arg}
--create-config-if-missing
--env "COMPONENT_KCONFIGS=${kconfigs}" --env "COMPONENT_KCONFIGS=${kconfigs}"
--env "COMPONENT_KCONFIGS_PROJBUILD=${kconfigs_projbuild}" --env "COMPONENT_KCONFIGS_PROJBUILD=${kconfigs_projbuild}"
--env "IDF_CMAKE=y") --env "IDF_CMAKE=y")
@ -141,12 +140,24 @@ function(kconfig_process_config)
# makes sdkconfig.h and skdconfig.cmake # makes sdkconfig.h and skdconfig.cmake
# #
# This happens during the cmake run not during the build # This happens during the cmake run not during the build
execute_process(COMMAND ${confgen_basecommand} if(NOT BOOTLOADER_BUILD)
--output header ${SDKCONFIG_HEADER} execute_process(
--output cmake ${SDKCONFIG_CMAKE} COMMAND ${confgen_basecommand}
--output json ${SDKCONFIG_JSON} --output header ${SDKCONFIG_HEADER}
--output json_menus ${KCONFIG_JSON_MENUS} --output cmake ${SDKCONFIG_CMAKE}
RESULT_VARIABLE config_result) --output json ${SDKCONFIG_JSON}
--output json_menus ${KCONFIG_JSON_MENUS}
--output config ${SDKCONFIG} # only generate config at the top-level project
RESULT_VARIABLE config_result)
else()
execute_process(
COMMAND ${confgen_basecommand}
--output header ${SDKCONFIG_HEADER}
--output cmake ${SDKCONFIG_CMAKE}
--output json ${SDKCONFIG_JSON}
--output json_menus ${KCONFIG_JSON_MENUS}
RESULT_VARIABLE config_result)
endif()
if(config_result) if(config_result)
message(FATAL_ERROR "Failed to run confgen.py (${confgen_basecommand}). Error ${config_result}") message(FATAL_ERROR "Failed to run confgen.py (${confgen_basecommand}). Error ${config_result}")
endif() endif()