Skip to content

Commit e3cd6fc

Browse files
pillo79carlescufi
authored andcommitted
llext-edk: fix: add compile definitions to the generated EDK
The LLEXT EDK was not exporting common Zephyr compile definitions ("-Dxxx" flags). This patch adds the compile definitions before the other compile flags, as it is done in the Zephyr build system. This patch also adds to this list the "-DLL_EXTENSION_BUILD" flag, instead of providing a special case at a later stage. Signed-off-by: Luca Burelli <[email protected]>
1 parent c77bcd2 commit e3cd6fc

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,12 +2133,15 @@ endif()
21332133
set(llext_edk_file ${PROJECT_BINARY_DIR}/${CONFIG_LLEXT_EDK_NAME}.tar.xz)
21342134

21352135
# TODO maybe generate flags for C CXX ASM
2136+
zephyr_get_compile_definitions_for_lang(C zephyr_defs)
21362137
zephyr_get_compile_options_for_lang(C zephyr_flags)
21372138

21382139
# Filter out non LLEXT and LLEXT_EDK flags - and add required ones
2139-
llext_filter_zephyr_flags(LLEXT_REMOVE_FLAGS ${zephyr_flags} llext_edk_cflags)
2140-
llext_filter_zephyr_flags(LLEXT_EDK_REMOVE_FLAGS ${llext_edk_cflags} llext_edk_cflags)
2140+
llext_filter_zephyr_flags(LLEXT_REMOVE_FLAGS ${zephyr_flags} llext_filt_flags)
2141+
llext_filter_zephyr_flags(LLEXT_EDK_REMOVE_FLAGS ${llext_filt_flags} llext_filt_flags)
21412142

2143+
set(llext_edk_cflags ${zephyr_defs} -DLL_EXTENSION_BUILD)
2144+
list(APPEND llext_edk_cflags ${llext_filt_flags})
21422145
list(APPEND llext_edk_cflags ${LLEXT_APPEND_FLAGS})
21432146
list(APPEND llext_edk_cflags ${LLEXT_EDK_APPEND_FLAGS})
21442147

cmake/llext-edk.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ foreach(flag ${llext_edk_cflags})
118118
endforeach()
119119
set(llext_edk_cflags ${new_cflags})
120120

121-
list(APPEND base_flags_make ${llext_edk_cflags} ${imacros_make} -DLL_EXTENSION_BUILD)
122-
list(APPEND base_flags_cmake ${llext_edk_cflags} ${imacros_cmake} -DLL_EXTENSION_BUILD)
121+
list(APPEND base_flags_make ${llext_edk_cflags} ${imacros_make})
122+
list(APPEND base_flags_cmake ${llext_edk_cflags} ${imacros_cmake})
123123

124124
separate_arguments(include_dirs NATIVE_COMMAND ${INTERFACE_INCLUDE_DIRECTORIES})
125125
file(MAKE_DIRECTORY ${llext_edk_inc})

0 commit comments

Comments
 (0)