@ -24,9 +24,11 @@ if(NOT HWMv2)
@@ -24,9 +24,11 @@ if(NOT HWMv2)
endif ( )
# I n t e r n a l h e l p e r f u n c t i o n f o r c r e a t i o n o f K c o n f i g f i l e s .
function ( kconfig_gen bin_dir file dirs )
file ( MAKE_DIRECTORY "${bin_dir}" )
set ( kconfig_file ${ bin_dir } / ${ file } )
function ( kconfig_gen bin_dir file dirs comment )
set ( kconfig_header "# Load ${comment} descriptions.\n" )
set ( kconfig_file ${ KCONFIG_BINARY_DIR } / ${ bin_dir } / ${ file } )
file ( WRITE ${ kconfig_file } "${kconfig_header}" )
foreach ( dir ${ dirs } )
cmake_path ( CONVERT "${dir}" TO_CMAKE_PATH_LIST dir )
file ( APPEND ${ kconfig_file } "osource \" ${ dir } / ${ file } \"\n")
@ -92,28 +94,12 @@ while(TRUE)
@@ -92,28 +94,12 @@ while(TRUE)
endwhile ( )
list ( REMOVE_DUPLICATES kconfig_soc_source_dir )
# S u p p o r t m u l t i p l e A R C H _ R O O T a n d S O C _ R O O T
set ( arch_kconfig_file Kconfig )
set ( soc_defconfig_file Kconfig.defconfig )
set ( soc_zephyr_file Kconfig )
set ( soc_kconfig_file Kconfig.soc )
set ( soc_sysbuild_file Kconfig.sysbuild )
set ( arch_kconfig_header "# Load arch Kconfig descriptions.\n" )
set ( defconfig_header "# Load Zephyr SoC Kconfig defconfig.\n" )
set ( soc_zephyr_header "# Load Zephyr SoC Kconfig descriptions.\n" )
set ( soc_kconfig_header "# Load SoC Kconfig descriptions.\n" )
set ( soc_sysbuild_header "# Load SoC sysbuild Kconfig descriptions.\n" )
file ( WRITE ${ KCONFIG_BINARY_DIR } /arch/ ${ arch_kconfig_file } "${arch_kconfig_header}" )
file ( WRITE ${ KCONFIG_BINARY_DIR } /soc/ ${ soc_defconfig_file } "${defconfig_header}" )
file ( WRITE ${ KCONFIG_BINARY_DIR } /soc/ ${ soc_zephyr_file } "${soc_zephyr_header}" )
file ( WRITE ${ KCONFIG_BINARY_DIR } /soc/ ${ soc_kconfig_file } "${soc_kconfig_header}" )
file ( WRITE ${ KCONFIG_BINARY_DIR } /soc/ ${ soc_sysbuild_file } "${soc_sysbuild_header}" )
kconfig_gen ( "${KCONFIG_BINARY_DIR}/arch" "${arch_kconfig_file}" "${kconfig_arch_source_dir}" )
kconfig_gen ( "${KCONFIG_BINARY_DIR}/soc" "${soc_defconfig_file}" "${kconfig_soc_source_dir}" )
kconfig_gen ( "${KCONFIG_BINARY_DIR}/soc" "${soc_zephyr_file}" "${kconfig_soc_source_dir}" )
kconfig_gen ( "${KCONFIG_BINARY_DIR}/soc" "${soc_kconfig_file}" "${kconfig_soc_source_dir}" )
kconfig_gen ( "${KCONFIG_BINARY_DIR}/soc" "${soc_sysbuild_file}" "${kconfig_soc_source_dir}" )
# S u p p o r t m u l t i p l e A R C H _ R O O T , S O C _ R O O T a n d B O A R D _ R O O T
kconfig_gen ( "arch" "Kconfig" "${kconfig_arch_source_dir}" "Zephyr Arch Kconfig" )
kconfig_gen ( "soc" "Kconfig.defconfig" "${kconfig_soc_source_dir}" "Zephyr SoC defconfig" )
kconfig_gen ( "soc" "Kconfig" "${kconfig_soc_source_dir}" "Zephyr SoC Kconfig" )
kconfig_gen ( "soc" "Kconfig.soc" "${kconfig_soc_source_dir}" "SoC Kconfig" )
kconfig_gen ( "soc" "Kconfig.sysbuild" "${kconfig_soc_source_dir}" "Sysbuild SoC Kconfig" )
# C l e a r v a r i a b l e s c r e a t e d b y c m a k e _ p a r s e _ a r g u m e n t s
unset ( SOC_V2_NAME )