@ -32,40 +32,41 @@ find_package(ZephyrBuildConfiguration
@@ -32,40 +32,41 @@ find_package(ZephyrBuildConfiguration
)
# P r e p a r e u s e r c a c h e
include ( python )
include ( user_cache )
list ( APPEND zephyr_cmake_modules python )
list ( APPEND zephyr_cmake_modules user_cache )
# L o a d Z e p h y r e x t e n s i o n s
include ( extensions )
include ( version ) # d e p e n d s o n h e x . c m a k e
list ( APPEND zephyr_cmake_modules extensions )
list ( APPEND zephyr_cmake_modules version )
#
# F i n d t o o l s
#
include ( west )
include ( ccache )
list ( APPEND zephyr_cmake_modules west )
list ( APPEND zephyr_cmake_modules ccache )
# L o a d d e f a u l t r o o t s e t t i n g s
include ( root )
list ( APPEND zephyr_cmake_modules root )
#
# F i n d Z e p h y r m o d u l e s .
# T h o s e m a y c o n t a i n a d d i t i o n a l D T S , B O A R D , S O C , A R C H R O O T s .
# A l s o c r e a t e t h e K c o n f i g b i n a r y d i r f o r g e n e r a t e d K c o n f f i l e s .
#
include ( zephyr_module )
list ( APPEND zephyr_cmake_modules zephyr_module )
include ( boards )
include ( shields )
include ( arch )
include ( configuration_files )
list ( APPEND zephyr_cmake_modules boards )
list ( APPEND zephyr_cmake_modules shields )
list ( APPEND zephyr_cmake_modules arch )
list ( APPEND zephyr_cmake_modules configuration_files )
include ( verify-toolchain )
include ( host-tools )
list ( APPEND zephyr_cmake_modules verify-toolchain )
list ( APPEND zephyr_cmake_modules host-tools )
# I n c l u d e b o a r d s p e c i f i c d e v i c e - t r e e f l a g s b e f o r e p a r s i n g .
include ( ${ BOARD_DIR } /pre_dt_board.cmake OPTIONAL )
set ( pre_dt_board "\${BOARD_DIR}/pre_dt_board.cmake" OPTIONAL )
list ( APPEND zephyr_cmake_modules "\${pre_dt_board}" )
# D T S s h o u l d b e c l o s e t o k c o n f i g b e c a u s e C O N F I G _ v a r i a b l e s f r o m
# k c o n f i g a n d d t s s h o u l d b e a v a i l a b l e a t t h e s a m e t i m e .
@ -80,9 +81,35 @@ include(${BOARD_DIR}/pre_dt_board.cmake OPTIONAL)
@@ -80,9 +81,35 @@ include(${BOARD_DIR}/pre_dt_board.cmake OPTIONAL)
# p r e p r o c e s s D T s o u r c e s , a n d t h e n , a f t e r w e h a v e f i n i s h e d p r o c e s s i n g
# b o t h D T a n d K c o n f i g w e c o m p l e t e t h e t a r g e t - s p e c i f i c c o n f i g u r a t i o n ,
# a n d p o s s i b l y c h a n g e t h e t o o l c h a i n .
include ( generic_toolchain )
include ( dts )
include ( kconfig )
include ( soc )
include ( target_toolchain )
list ( APPEND zephyr_cmake_modules generic_toolchain )
list ( APPEND zephyr_cmake_modules dts )
list ( APPEND zephyr_cmake_modules kconfig )
list ( APPEND zephyr_cmake_modules soc )
list ( APPEND zephyr_cmake_modules target_toolchain )
foreach ( component ${ SUB_COMPONENTS } )
if ( NOT ${ component } IN_LIST zephyr_cmake_modules )
message ( FATAL_ERROR
" S u b c o m p o n e n t ' $ { c o m p o n e n t } ' n o t d e f a u l t m o d u l e f o r Z e p h y r C M a k e b u i l d s y s t e m . \ n "
" P l e a s e c h o o s e o n e o r m o r e v a l i d c o m p o n e n t s : $ { z e p h y r _ c m a k e _ m o d u l e s } "
)
endif ( )
endforeach ( )
foreach ( module IN LISTS zephyr_cmake_modules )
# E n s u r e s a n y m o d u l e o f t y p e ` $ { m o d u l e } ` a r e p r o p e r l y e x p a n d e d t o l i s t b e f o r e
# p a s s e d o n t h e ` include ( ${ module } ) ` .
# T h i s i s d o n e t w i c e t o s u p p o r t c a s e s w h e r e t h e c o n t e n t o f ` $ { m o d u l e } ` i t s e l f
# c o n t a i n s a v a r i a b l e , l i k e ` $ { B O A R D _ D I R } ` .
string ( CONFIGURE "${module}" module )
string ( CONFIGURE "${module}" module )
include ( ${ module } )
list ( REMOVE_ITEM SUB_COMPONENTS ${ module } )
if ( DEFINED SUB_COMPONENTS AND NOT SUB_COMPONENTS )
# A l l r e q u e s t e d Z e p h y r C M a k e m o d u l e s h a v e b e e n l o a d e d , s o l e t ' s r e t u r n .
return ( )
endif ( )
endforeach ( )
include ( kernel )