2018-01-12 13:49:13 +11:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								include(ExternalProject)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								function(__kconfig_init)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(idf_path IDF_PATH)
							 | 
						
					
						
							
								
									
										
										
										
											2018-11-30 16:07:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    idf_build_set_property(__ROOT_KCONFIG ${idf_path}/Kconfig)
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-16 16:39:12 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    idf_build_set_property(__ROOT_SDKCONFIG_RENAME ${idf_path}/sdkconfig.rename)
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    idf_build_set_property(__OUTPUT_SDKCONFIG 1)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								endfunction()
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-11 10:33:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Initialize Kconfig-related properties for components.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# This function assumes that all basic properties of the components have been
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# set prior to calling it.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								function(__kconfig_component_init component_target)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    __component_get_property(component_dir ${component_target} COMPONENT_DIR)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    file(GLOB kconfig "${component_dir}/Kconfig")
							 | 
						
					
						
							
								
									
										
										
										
											2021-07-09 01:46:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    list(SORT kconfig)
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    __component_set_property(${component_target} KCONFIG "${kconfig}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    file(GLOB kconfig "${component_dir}/Kconfig.projbuild")
							 | 
						
					
						
							
								
									
										
										
										
											2021-07-09 01:46:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    list(SORT kconfig)
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    __component_set_property(${component_target} KCONFIG_PROJBUILD "${kconfig}")
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-16 16:39:12 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    file(GLOB sdkconfig_rename "${component_dir}/sdkconfig.rename")
							 | 
						
					
						
							
								
									
										
										
										
											2022-01-31 10:53:59 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    file(GLOB sdkconfig_rename_target "${component_dir}/sdkconfig.rename.${IDF_TARGET}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    list(APPEND sdkconfig_rename ${sdkconfig_rename_target})
							 | 
						
					
						
							
								
									
										
										
										
											2021-07-09 01:46:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    list(SORT sdkconfig_rename)
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-16 16:39:12 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    __component_set_property(${component_target} SDKCONFIG_RENAME "${sdkconfig_rename}")
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								endfunction()
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-11 10:33:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-08-11 14:59:16 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Add bootloader components Kconfig and Kconfig.projbuild files to BOOTLOADER_KCONFIG
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# and BOOTLOADER_KCONFIGS_PROJ properties respectively.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								function(__kconfig_bootloader_component_add component_dir)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(bootloader_kconfigs BOOTLOADER_KCONFIGS)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(bootloader_kconfigs_proj BOOTLOADER_KCONFIGS_PROJ)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    file(GLOB kconfig "${component_dir}/Kconfig")
							 | 
						
					
						
							
								
									
										
										
										
											2021-08-30 18:02:58 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    list(SORT kconfig)
							 | 
						
					
						
							
								
									
										
										
										
											2021-08-11 14:59:16 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    if(EXISTS "${kconfig}" AND NOT IS_DIRECTORY "${kconfig}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        list(APPEND bootloader_kconfigs "${kconfig}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    endif()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    file(GLOB kconfig "${component_dir}/Kconfig.projbuild")
							 | 
						
					
						
							
								
									
										
										
										
											2021-08-30 18:02:58 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    list(SORT kconfig)
							 | 
						
					
						
							
								
									
										
										
										
											2021-08-11 14:59:16 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    if(EXISTS "${kconfig}" AND NOT IS_DIRECTORY "${kconfig}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        list(APPEND bootloader_kconfigs_proj "${kconfig}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    endif()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_set_property(BOOTLOADER_KCONFIGS "${bootloader_kconfigs}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_set_property(BOOTLOADER_KCONFIGS_PROJ "${bootloader_kconfigs_proj}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								endfunction()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2023-06-12 14:30:53 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Find the initial IDF version used to generate the config.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# This is needed to pass this variable back to confgen, so that the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# value of CONFIG_IDF_INIT_VERSION option stays the same.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								function(__get_init_config_version config version_out)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set(${version_out} NOTFOUND PARENT_SCOPE)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    if(NOT EXISTS "${config}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        return()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    endif()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    file(STRINGS "${config}" lines)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    foreach(line ${lines})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        string(STRIP "${line}" line)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        if(NOT "${line}" MATCHES "CONFIG_IDF_INIT_VERSION=\"([0-9]+\.[0-9]+\.[0-9]+)\"$")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            continue()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        endif()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        string(REGEX REPLACE "CONFIG_IDF_INIT_VERSION=\"([0-9]+\.[0-9]+\.[0-9]+)\"$" "\\1" version "${line}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        set(${version_out} ${version} PARENT_SCOPE)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        return()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    endforeach()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								endfunction()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Generate the config files and create config related targets and configure
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# dependencies.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # List all Kconfig and Kconfig.projbuild in known components
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(component_targets __COMPONENT_TARGETS)
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-24 18:32:42 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(build_component_targets __BUILD_COMPONENT_TARGETS)
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    foreach(component_target ${component_targets})
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-24 18:32:42 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        if(component_target IN_LIST build_component_targets)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            __component_get_property(kconfig ${component_target} KCONFIG)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            __component_get_property(kconfig_projbuild ${component_target} KCONFIG_PROJBUILD)
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-16 16:39:12 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            __component_get_property(sdkconfig_rename ${component_target} SDKCONFIG_RENAME)
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-24 18:32:42 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            if(kconfig)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                list(APPEND kconfigs ${kconfig})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            endif()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            if(kconfig_projbuild)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                list(APPEND kconfig_projbuilds ${kconfig_projbuild})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            endif()
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-16 16:39:12 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            if(sdkconfig_rename)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                list(APPEND sdkconfig_renames ${sdkconfig_rename})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            endif()
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-27 15:45:30 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        endif()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    endforeach()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2023-06-12 14:30:53 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    __get_init_config_version(${sdkconfig} idf_init_version)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    if(NOT idf_init_version)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        set(idf_init_version $ENV{IDF_VERSION})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    endif()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set(ENV{IDF_INIT_VERSION} ${idf_init_version})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-08-11 14:59:16 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    # Take into account bootloader components configuration files
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(bootloader_kconfigs BOOTLOADER_KCONFIGS)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(bootloader_kconfigs_proj BOOTLOADER_KCONFIGS_PROJ)
							 | 
						
					
						
							
								
									
										
										
										
											2021-08-30 18:01:43 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    if(bootloader_kconfigs)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        list(APPEND kconfigs "${bootloader_kconfigs}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    endif()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    if(bootloader_kconfigs_proj)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        list(APPEND kconfig_projbuilds "${bootloader_kconfigs_proj}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    endif()
							 | 
						
					
						
							
								
									
										
										
										
											2021-08-11 14:59:16 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    # Store the list version of kconfigs and kconfig_projbuilds
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_set_property(KCONFIGS "${kconfigs}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_set_property(KCONFIG_PROJBUILDS "${kconfig_projbuilds}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(idf_target IDF_TARGET)
							 | 
						
					
						
							
								
									
										
										
										
											2022-11-23 15:00:11 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(idf_toolchain IDF_TOOLCHAIN)
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-27 20:30:42 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(idf_path IDF_PATH)
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-26 11:37:34 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(idf_env_fpga __IDF_ENV_FPGA)
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-27 20:30:42 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-10 09:58:52 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    # These are the paths for files which will contain the generated "source" lines for COMPONENT_KCONFIGS and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # COMPONENT_KCONFIGS_PROJBUILD
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set(kconfigs_projbuild_path "${CMAKE_CURRENT_BINARY_DIR}/kconfigs_projbuild.in")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set(kconfigs_path "${CMAKE_CURRENT_BINARY_DIR}/kconfigs.in")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-27 20:30:42 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    # Place config-related environment arguments into config.env file
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # to work around command line length limits for execute_process
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # on Windows & CMake < 3.11
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set(config_env_path "${CMAKE_CURRENT_BINARY_DIR}/config.env")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    configure_file("${idf_path}/tools/kconfig_new/config.env.in" ${config_env_path})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_set_property(CONFIG_ENV_PATH ${config_env_path})
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    if(sdkconfig_defaults)
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-22 13:01:13 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        foreach(sdkconfig_default ${sdkconfig_defaults})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            list(APPEND defaults_arg --defaults "${sdkconfig_default}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            if(EXISTS "${sdkconfig_default}.${idf_target}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                list(APPEND defaults_arg --defaults "${sdkconfig_default}.${idf_target}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            endif()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        endforeach()
							 | 
						
					
						
							
								
									
										
										
										
											2018-10-19 11:51:51 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    endif()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(root_kconfig __ROOT_KCONFIG)
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-16 16:39:12 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(root_sdkconfig_rename __ROOT_SDKCONFIG_RENAME)
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(python PYTHON)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 13:44:19 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    set(prepare_kconfig_files_command
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        ${python} ${idf_path}/tools/kconfig_new/prepare_kconfig_files.py
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-06 00:13:55 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --list-separator=semicolon
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 13:44:19 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --env-file ${config_env_path})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-28 17:59:32 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    set(kconfgen_basecommand
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        ${python} -m kconfgen
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-06 00:13:55 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --list-separator=semicolon
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --kconfig ${root_kconfig}
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-16 16:39:12 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --sdkconfig-rename ${root_sdkconfig_rename}
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --config ${sdkconfig}
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-27 15:45:30 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        ${defaults_arg}
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-27 20:30:42 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --env-file ${config_env_path})
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(build_dir BUILD_DIR)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set(config_dir ${build_dir}/config)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    file(MAKE_DIRECTORY "${config_dir}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-08 10:41:18 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    message(STATUS "Project sdkconfig file ${sdkconfig}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    # Generate the config outputs
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set(sdkconfig_cmake ${config_dir}/sdkconfig.cmake)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set(sdkconfig_header ${config_dir}/sdkconfig.h)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set(sdkconfig_json ${config_dir}/sdkconfig.json)
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-23 18:08:22 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    set(sdkconfig_json_menus ${config_dir}/kconfig_menus.json)
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_get_property(output_sdkconfig __OUTPUT_SDKCONFIG)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    if(output_sdkconfig)
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 13:44:19 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        execute_process(
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            COMMAND ${prepare_kconfig_files_command})
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        execute_process(
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-28 17:59:32 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            COMMAND ${kconfgen_basecommand}
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            --output header ${sdkconfig_header}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            --output cmake ${sdkconfig_cmake}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            --output json ${sdkconfig_json}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            --output json_menus ${sdkconfig_json_menus}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            --output config ${sdkconfig}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            RESULT_VARIABLE config_result)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    else()
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 13:44:19 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        execute_process(
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            COMMAND ${prepare_kconfig_files_command})
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        execute_process(
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-28 17:59:32 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            COMMAND ${kconfgen_basecommand}
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            --output header ${sdkconfig_header}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            --output cmake ${sdkconfig_cmake}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            --output json ${sdkconfig_json}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            --output json_menus ${sdkconfig_json_menus}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            RESULT_VARIABLE config_result)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    endif()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    if(config_result)
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-28 17:59:32 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        message(FATAL_ERROR "Failed to run kconfgen (${kconfgen_basecommand}). Error ${config_result}")
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    endif()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # Add the generated config header to build specifications.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_set_property(INCLUDE_DIRECTORIES ${config_dir} APPEND)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # When sdkconfig file changes in the future, trigger a cmake run
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${sdkconfig}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # Ditto if either of the generated files are missing/modified (this is a bit irritating as it means
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # you can't edit these manually without them being regenerated, but I don't know of a better way...)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${sdkconfig_header}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${sdkconfig_cmake}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # Or if the config generation tool changes
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${idf_path}/tools/kconfig_new/confgen.py")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY
							 | 
						
					
						
							
								
									
										
										
										
											2023-05-08 15:41:30 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                ADDITIONAL_CLEAN_FILES "${sdkconfig_header}" "${sdkconfig_cmake}")
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_set_property(SDKCONFIG_HEADER ${sdkconfig_header})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_set_property(SDKCONFIG_JSON ${sdkconfig_json})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_set_property(SDKCONFIG_CMAKE ${sdkconfig_cmake})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    idf_build_set_property(SDKCONFIG_JSON_MENUS ${sdkconfig_json_menus})
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-15 11:17:16 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    idf_build_set_property(CONFIG_DIR ${config_dir})
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-11-23 14:02:47 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    set(MENUCONFIG_CMD ${python} -m menuconfig)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set(TERM_CHECK_CMD ${python} ${idf_path}/tools/check_term.py)
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-15 13:46:50 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-10 09:58:52 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    # Generate the menuconfig target
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-27 15:45:30 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    add_custom_target(menuconfig
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-01 15:42:28 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        ${menuconfig_depends}
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-27 15:45:30 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        # create any missing config file, with defaults if necessary
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 13:44:19 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        COMMAND ${prepare_kconfig_files_command}
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-28 17:59:32 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        COMMAND ${kconfgen_basecommand}
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-08 14:40:28 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --env "IDF_TARGET=${idf_target}"
							 | 
						
					
						
							
								
									
										
										
										
											2022-11-23 15:00:11 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --env "IDF_TOOLCHAIN=${idf_toolchain}"
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-17 12:38:52 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --env "IDF_ENV_FPGA=${idf_env_fpga}"
							 | 
						
					
						
							
								
									
										
										
										
											2023-06-12 14:30:53 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --env "IDF_INIT_VERSION=${idf_init_version}"
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-08 14:40:28 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --dont-write-deprecated
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        --output config ${sdkconfig}
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-15 12:51:18 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        COMMAND ${TERM_CHECK_CMD}
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-27 15:45:30 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        COMMAND ${CMAKE_COMMAND} -E env
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-10 09:58:52 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        "COMPONENT_KCONFIGS_SOURCE_FILE=${kconfigs_path}"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        "COMPONENT_KCONFIGS_PROJBUILD_SOURCE_FILE=${kconfigs_projbuild_path}"
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-26 13:42:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        "KCONFIG_CONFIG=${sdkconfig}"
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-15 11:20:43 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        "IDF_TARGET=${idf_target}"
							 | 
						
					
						
							
								
									
										
										
										
											2022-11-23 15:00:11 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        "IDF_TOOLCHAIN=${idf_toolchain}"
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-17 12:38:52 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        "IDF_ENV_FPGA=${idf_env_fpga}"
							 | 
						
					
						
							
								
									
										
										
										
											2023-06-12 14:30:53 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        "IDF_INIT_VERSION=${idf_init_version}"
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-10 09:58:52 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        ${MENUCONFIG_CMD} ${root_kconfig}
							 | 
						
					
						
							
								
									
										
										
										
											2019-03-14 09:54:04 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        USES_TERMINAL
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-28 17:59:32 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        # additional run of kconfgen esures that the deprecated options will be inserted into sdkconfig (for backward
							 | 
						
					
						
							
								
									
										
										
										
											2019-03-14 09:54:04 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        # compatibility)
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-28 17:59:32 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        COMMAND ${kconfgen_basecommand}
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-17 12:38:52 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --env "IDF_TARGET=${idf_target}"
							 | 
						
					
						
							
								
									
										
										
										
											2022-11-23 15:00:11 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --env "IDF_TOOLCHAIN=${idf_toolchain}"
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-17 12:38:52 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --env "IDF_ENV_FPGA=${idf_env_fpga}"
							 | 
						
					
						
							
								
									
										
										
										
											2023-06-12 14:30:53 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --env "IDF_INIT_VERSION=${idf_init_version}"
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-17 12:38:52 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --output config ${sdkconfig}
							 | 
						
					
						
							
								
									
										
										
										
											2019-03-14 09:54:04 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        )
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-27 15:45:30 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-28 17:59:32 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    # Custom target to run kconfserver from the build tool
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-16 14:54:22 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    add_custom_target(confserver
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 13:44:19 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        COMMAND ${prepare_kconfig_files_command}
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-28 17:59:32 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        COMMAND ${python} -m kconfserver
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-27 20:30:42 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --env-file ${config_env_path}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        --kconfig ${IDF_PATH}/Kconfig
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-16 16:39:12 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --sdkconfig-rename ${root_sdkconfig_rename}
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-27 20:30:42 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --config ${sdkconfig}
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-16 14:54:22 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        VERBATIM
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        USES_TERMINAL)
							 | 
						
					
						
							
								
									
										
										
										
											2021-12-14 15:31:08 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    add_custom_target(save-defconfig
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        COMMAND ${prepare_kconfig_files_command}
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-28 17:59:32 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        COMMAND ${kconfgen_basecommand}
							 | 
						
					
						
							
								
									
										
										
										
											2021-12-14 15:31:08 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        --dont-write-deprecated
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        --output savedefconfig ${CMAKE_SOURCE_DIR}/sdkconfig.defaults
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        USES_TERMINAL
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        )
							 | 
						
					
						
							
								
									
										
										
										
											2019-03-14 09:54:04 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								endfunction()
							 |