|
@@ -195,7 +195,8 @@ function(__build_expand_requirements component_target)
|
|
|
# Since there are circular dependencies, make sure that we do not infinitely
|
|
# Since there are circular dependencies, make sure that we do not infinitely
|
|
|
# expand requirements for each component.
|
|
# expand requirements for each component.
|
|
|
idf_build_get_property(component_targets_seen __COMPONENT_TARGETS_SEEN)
|
|
idf_build_get_property(component_targets_seen __COMPONENT_TARGETS_SEEN)
|
|
|
- if(component_target IN_LIST component_targets_seen)
|
|
|
|
|
|
|
+ __component_get_property(component_registered ${component_target} __COMPONENT_REGISTERED)
|
|
|
|
|
+ if(component_target IN_LIST component_targets_seen OR NOT component_registered)
|
|
|
return()
|
|
return()
|
|
|
endif()
|
|
endif()
|
|
|
|
|
|
|
@@ -365,56 +366,13 @@ macro(idf_build_process target)
|
|
|
# Check for required Python modules
|
|
# Check for required Python modules
|
|
|
__build_check_python()
|
|
__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.
|
|
|
|
|
- idf_build_get_property(build_dir BUILD_DIR)
|
|
|
|
|
- set(build_properties_file ${build_dir}/build_properties.temp.cmake)
|
|
|
|
|
- idf_build_set_property(BUILD_PROPERTIES_FILE ${build_properties_file})
|
|
|
|
|
- __build_write_properties(${build_properties_file})
|
|
|
|
|
|
|
+ idf_build_set_property(__COMPONENT_REQUIRES_COMMON ${target} APPEND)
|
|
|
|
|
+ __component_get_requirements()
|
|
|
|
|
|
|
|
# Perform early expansion of component CMakeLists.txt in CMake scripting mode.
|
|
# Perform early expansion of component CMakeLists.txt in CMake scripting mode.
|
|
|
# It is here we retrieve the public and private requirements of each component.
|
|
# It is here we retrieve the public and private requirements of each component.
|
|
|
# It is also here we add the common component requirements to each component's
|
|
# It is also here we add the common component requirements to each component's
|
|
|
# own requirements.
|
|
# own requirements.
|
|
|
- idf_build_get_property(component_targets __COMPONENT_TARGETS)
|
|
|
|
|
- idf_build_set_property(__COMPONENT_REQUIRES_COMMON ${target} APPEND)
|
|
|
|
|
- idf_build_get_property(common_reqs __COMPONENT_REQUIRES_COMMON)
|
|
|
|
|
- foreach(component_target ${component_targets})
|
|
|
|
|
- get_property(component_dir TARGET ${component_target} PROPERTY COMPONENT_DIR)
|
|
|
|
|
- __component_get_requirements(error reqs priv_reqs ${component_dir})
|
|
|
|
|
- if(error)
|
|
|
|
|
- message(FATAL_ERROR "${error}")
|
|
|
|
|
- endif()
|
|
|
|
|
-
|
|
|
|
|
- list(APPEND reqs "${common_reqs}")
|
|
|
|
|
-
|
|
|
|
|
- # Remove duplicates and the component itself from its requirements
|
|
|
|
|
- __component_get_property(alias ${component_target} COMPONENT_ALIAS)
|
|
|
|
|
- __component_get_property(_name ${component_target} COMPONENT_NAME)
|
|
|
|
|
-
|
|
|
|
|
- # Prevent component from linking to itself.
|
|
|
|
|
- if(reqs)
|
|
|
|
|
- list(REMOVE_DUPLICATES reqs)
|
|
|
|
|
- list(REMOVE_ITEM reqs ${alias} ${_name})
|
|
|
|
|
- endif()
|
|
|
|
|
-
|
|
|
|
|
- if(priv_reqs)
|
|
|
|
|
- list(REMOVE_DUPLICATES priv_reqs)
|
|
|
|
|
- list(REMOVE_ITEM priv_reqs ${alias} ${_name})
|
|
|
|
|
- endif()
|
|
|
|
|
-
|
|
|
|
|
- __component_set_property(${component_target} REQUIRES "${reqs}")
|
|
|
|
|
- __component_set_property(${component_target} PRIV_REQUIRES "${priv_reqs}")
|
|
|
|
|
- endforeach()
|
|
|
|
|
- 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
|
|
# 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.
|
|
# of build component targets given the requirements set by each component.
|
|
@@ -436,12 +394,19 @@ macro(idf_build_process target)
|
|
|
|
|
|
|
|
# Get a list of common component requirements in component targets form (previously
|
|
# Get a list of common component requirements in component targets form (previously
|
|
|
# we just have a list of component names)
|
|
# we just have a list of component names)
|
|
|
|
|
+ idf_build_get_property(common_reqs __COMPONENT_REQUIRES_COMMON)
|
|
|
foreach(common_req ${common_reqs})
|
|
foreach(common_req ${common_reqs})
|
|
|
__component_get_target(component_target ${common_req})
|
|
__component_get_target(component_target ${common_req})
|
|
|
__component_get_property(lib ${component_target} COMPONENT_LIB)
|
|
__component_get_property(lib ${component_target} COMPONENT_LIB)
|
|
|
idf_build_set_property(___COMPONENT_REQUIRES_COMMON ${lib} APPEND)
|
|
idf_build_set_property(___COMPONENT_REQUIRES_COMMON ${lib} APPEND)
|
|
|
endforeach()
|
|
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
|
|
# Temporary trick to support both gcc5 and gcc8 builds
|
|
|
if(CMAKE_C_COMPILER_VERSION VERSION_EQUAL 5.2.0)
|
|
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")
|
|
set(GCC_NOT_5_2_0 0 CACHE STRING "GCC is 5.2.0 version")
|
|
@@ -471,29 +436,8 @@ endmacro()
|
|
|
# generating additional binary files, generating files related to flashing, etc.)
|
|
# generating additional binary files, generating files related to flashing, etc.)
|
|
|
function(idf_build_executable elf)
|
|
function(idf_build_executable elf)
|
|
|
# Propagate link dependencies from component library targets to the executable
|
|
# Propagate link dependencies from component library targets to the executable
|
|
|
- idf_build_get_property(build_components BUILD_COMPONENTS)
|
|
|
|
|
- foreach(build_component ${build_components})
|
|
|
|
|
- get_target_property(type ${build_component} TYPE)
|
|
|
|
|
- if(type STREQUAL "INTERFACE_LIBRARY")
|
|
|
|
|
- get_target_property(iface_link_depends ${build_component} INTERFACE_LINK_DEPENDS)
|
|
|
|
|
- else()
|
|
|
|
|
- get_target_property(link_depends ${build_component} LINK_DEPENDS)
|
|
|
|
|
- get_target_property(iface_link_depends ${build_component} INTERFACE_LINK_DEPENDS)
|
|
|
|
|
- endif()
|
|
|
|
|
- if(iface_link_depends)
|
|
|
|
|
- list(APPEND _link_depends ${iface_link_depends})
|
|
|
|
|
- endif()
|
|
|
|
|
- if(link_depends)
|
|
|
|
|
- list(APPEND _link_depends ${link_depends})
|
|
|
|
|
- endif()
|
|
|
|
|
- endforeach()
|
|
|
|
|
-
|
|
|
|
|
- idf_build_get_property(link_depends LINK_DEPENDS)
|
|
|
|
|
- if(link_depends)
|
|
|
|
|
- list(APPEND _link_depends ${link_depends})
|
|
|
|
|
- endif()
|
|
|
|
|
-
|
|
|
|
|
- set_property(TARGET ${elf} APPEND PROPERTY LINK_DEPENDS "${_link_depends}")
|
|
|
|
|
|
|
+ idf_build_get_property(link_depends __LINK_DEPENDS)
|
|
|
|
|
+ set_property(TARGET ${elf} APPEND PROPERTY LINK_DEPENDS "${link_depends}")
|
|
|
|
|
|
|
|
# Set the EXECUTABLE_NAME and EXECUTABLE properties since there are generator expression
|
|
# Set the EXECUTABLE_NAME and EXECUTABLE properties since there are generator expression
|
|
|
# from components that depend on it
|
|
# from components that depend on it
|