@ -11,25 +11,24 @@
@@ -11,25 +11,24 @@
# directories ( build/zephyr, zephyr base, west top dir and application source
# d i r ) , t o a v o i d l e a k i n g a n y i n f o r m a t i o n a b o u t t h e h o s t s y s t e m .
#
# T h e f o l l o w i n g a r g u m e n t s a r e e x p e c t e d :
# - l l e x t _ e d k _ n a m e : N a m e o f t h e e x t e n s i o n , u s e d t o n a m e t h e t a r b a l l a n d t h e
# i n s t a l l d i r e c t o r y v a r i a b l e f o r M a k e f i l e .
# - I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S : L i s t o f i n c l u d e d i r e c t o r i e s t o c o p y h e a d e r s
# f r o m . I t s h o u l d s i m p l y b e t h e I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S p r o p e r t y o f t h e
# z e p h y r _ i n t e r f a c e t a r g e t .
# - l l e x t _ e d k _ f i l e : O u t p u t f i l e n a m e f o r t h e t a r b a l l .
# - l l e x t _ e d k _ c f l a g s : F l a g s t o b e u s e d f o r s o u r c e c o m p i l e c o m m a n d s .
# - Z E P H Y R _ B A S E : P a t h t o t h e z e p h y r b a s e d i r e c t o r y .
# - W E S T _ T O P D I R : P a t h t o t h e w e s t t o p d i r e c t o r y .
# - A P P L I C A T I O N _ S O U R C E _ D I R : P a t h t o t h e a p p l i c a t i o n s o u r c e d i r e c t o r y .
# - P R O J E C T _ B I N A R Y _ D I R : P a t h t o t h e p r o j e c t b i n a r y b u i l d d i r e c t o r y .
# - C O N F I G _ L L E X T _ E D K _ U S E R S P A C E _ O N L Y : W h e t h e r t o c o p y s y s c a l l h e a d e r s f r o m t h e
# e d k d i r e c t o r y . T h i s i s n e c e s s a r y w h e n b u i l d i n g a n e x t e n s i o n t h a t o n l y
# s u p p o r t s u s e r s p a c e , a s t h e s y s c a l l h e a d e r s a r e r e g e n e r a t e d i n t h e e d k
# d i r e c t o r y .
# T h e s c r i p t e x p e c t s a b u i l d _ i n f o . y m l f i l e i n t h e p r o j e c t b i n a r y d i r e c t o r y .
# T h i s f i l e s h o u l d c o n t a i n t h e f o l l o w i n g e n t r i e s :
# - c m a k e a p p l i c a t i o n s o u r c e - d i r
# - c m a k e l l e x t - e d k c f l a g s
# - c m a k e l l e x t - e d k f i l e
# - c m a k e l l e x t - e d k i n c l u d e - d i r s
# - w e s t t o p d i r
cmake_minimum_required ( VERSION 3.20.0 )
# i n i t i a l i z e t h e s a m e p a t h s a s t h e m a i n C M a k e L i s t s . t x t f o r c o n s i s t e n c y
set ( PROJECT_BINARY_DIR ${ CMAKE_BINARY_DIR } )
set ( ZEPHYR_BASE ${ CMAKE_CURRENT_LIST_DIR } /../ )
list ( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules" )
include ( extensions )
include ( yaml )
# U s a g e :
# relative_dir ( <dir> <relative_out> <bindir_out> )
#
@ -142,11 +141,24 @@ endfunction()
@@ -142,11 +141,24 @@ endfunction()
# r e a d i n c o m p u t e d b u i l d c o n f i g u r a t i o n
import_kconfig ( CONFIG ${ PROJECT_BINARY_DIR } /.config )
if ( CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID )
message ( FATAL_ERROR
" T h e L L E X T E D K i s n o t c o m p a t i b l e w i t h C O N F I G _ L L E X T _ E X P O R T _ B U I L T I N S _ B Y _ S L I D . " )
endif ( )
set ( build_info_file ${ PROJECT_BINARY_DIR } /../build_info.yml )
yaml_load ( FILE ${ build_info_file } NAME build_info )
yaml_get ( llext_edk_cflags NAME build_info KEY cmake llext-edk cflags )
yaml_get ( llext_edk_file NAME build_info KEY cmake llext-edk file )
yaml_get ( INTERFACE_INCLUDE_DIRECTORIES NAME build_info KEY cmake llext-edk include-dirs )
yaml_get ( APPLICATION_SOURCE_DIR NAME build_info KEY cmake application source-dir )
yaml_get ( WEST_TOPDIR NAME build_info KEY west topdir )
set ( llext_edk_name ${ CONFIG_LLEXT_EDK_NAME } )
set ( llext_edk ${ PROJECT_BINARY_DIR } / ${ llext_edk_name } )
set ( llext_edk_inc ${ llext_edk } /include )
@ -154,8 +166,6 @@ string(REGEX REPLACE "[^a-zA-Z0-9]" "_" llext_edk_name_sane ${llext_edk_name})
@@ -154,8 +166,6 @@ string(REGEX REPLACE "[^a-zA-Z0-9]" "_" llext_edk_name_sane ${llext_edk_name})
string ( TOUPPER ${ llext_edk_name_sane } llext_edk_name_sane )
set ( install_dir_var "${llext_edk_name_sane}_INSTALL_DIR" )
separate_arguments ( llext_edk_cflags NATIVE_COMMAND ${ llext_edk_cflags } )
set ( make_relative FALSE )
foreach ( flag ${ llext_edk_cflags } )
if ( flag STREQUAL "-imacros" )
@ -179,9 +189,8 @@ set(llext_edk_cflags ${new_cflags})
@@ -179,9 +189,8 @@ set(llext_edk_cflags ${new_cflags})
list ( APPEND base_flags ${ llext_edk_cflags } ${ imacros } )
separate_arguments ( include_dirs NATIVE_COMMAND ${ INTERFACE_INCLUDE_DIRECTORIES } )
file ( MAKE_DIRECTORY ${ llext_edk_inc } )
foreach ( dir ${ include_dirs } )
foreach ( dir ${ INTERFACE_INCLUDE_DIRECTORIES } )
if ( NOT EXISTS ${ dir } )
continue ( )
endif ( )