cmake: expand build components before generating config

!4452 had config generation first before building the component list
to be used in the build. This proved to be detrimental when a new target
is added as config generation would consider configs from both targets.
pull/3627/head
Renz Christian Bagaporo 2019-05-24 18:32:42 +08:00
rodzic 767455dbeb
commit 33dd7011be
2 zmienionych plików z 17 dodań i 13 usunięć

Wyświetl plik

@ -365,12 +365,6 @@ macro(idf_build_process target)
# Check for required Python modules
__build_check_python()
# Generate config values in different formats
idf_build_get_property(sdkconfig SDKCONFIG)
idf_build_get_property(sdkconfig_defaults SDKCONFIG_DEFAULTS)
__kconfig_generate_config("${sdkconfig}" "${sdkconfig_defaults}")
__build_import_configs()
# Write the partial build properties to a temporary file.
# The path to this generated file is set to a short-lived build
# property BUILD_PROPERTIES_FILE.
@ -416,6 +410,7 @@ macro(idf_build_process target)
idf_build_unset_property(BUILD_PROPERTIES_FILE)
file(REMOVE ${build_properties_file})
# Finally, do component expansion. In this case it simply means getting a final list
# of build component targets given the requirements set by each component.
if(__COMPONENTS)
@ -442,6 +437,12 @@ macro(idf_build_process target)
idf_build_set_property(___COMPONENT_REQUIRES_COMMON ${lib} APPEND)
endforeach()
# Generate config values in different formats
idf_build_get_property(sdkconfig SDKCONFIG)
idf_build_get_property(sdkconfig_defaults SDKCONFIG_DEFAULTS)
__kconfig_generate_config("${sdkconfig}" "${sdkconfig_defaults}")
__build_import_configs()
# Temporary trick to support both gcc5 and gcc8 builds
if(CMAKE_C_COMPILER_VERSION VERSION_EQUAL 5.2.0)
set(GCC_NOT_5_2_0 0 CACHE STRING "GCC is 5.2.0 version")

Wyświetl plik

@ -88,14 +88,17 @@ endfunction()
function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
# List all Kconfig and Kconfig.projbuild in known components
idf_build_get_property(component_targets __COMPONENT_TARGETS)
idf_build_get_property(build_component_targets __BUILD_COMPONENT_TARGETS)
foreach(component_target ${component_targets})
__component_get_property(kconfig ${component_target} KCONFIG)
__component_get_property(kconfig_projbuild ${component_target} KCONFIG_PROJBUILD)
if(kconfig)
list(APPEND kconfigs ${kconfig})
endif()
if(kconfig_projbuild)
list(APPEND kconfig_projbuilds ${kconfig_projbuild})
if(component_target IN_LIST build_component_targets)
__component_get_property(kconfig ${component_target} KCONFIG)
__component_get_property(kconfig_projbuild ${component_target} KCONFIG_PROJBUILD)
if(kconfig)
list(APPEND kconfigs ${kconfig})
endif()
if(kconfig_projbuild)
list(APPEND kconfig_projbuilds ${kconfig_projbuild})
endif()
endif()
endforeach()