Lines Matching +full:directory +full:- +full:to +full:- +full:scan
1 # SPDX-License-Identifier: Apache-2.0
5 # Note that this is *NOT* the top-level CMakeLists.txt. That's in the
9 # To see a list of typical targets execute "make usage"
11 # Comments in this file are targeted only to the developer, do not
12 # expect to learn how to build the kernel reading this file.
16 cmake was invoked with '${CMAKE_CURRENT_LIST_DIR}' specified as the source directory,
17 but it must be invoked with an application source directory,
26 # and https://cmake.org/pipermail/cmake/2019-May/thread.html#69496
33 subtle and hard to debug CMake issues.")
36 # -fmacro-prefix-map=${ZEPHYR_BASE}=
47 # Currently up to three linking stages may be executed:
57 # - device dependencies structs must be generated (CONFIG_DEVICE_DEPS=y)
58 # - ISR tables must be generated (CONFIG_GEN_ISR_TABLES=y)
59 # - Kernel objects hash tables (CONFIG_USERSPACE=y)
60 # - Application memory partitions (CONFIG_USERSPACE=y)
66 # - zephyr_pre0: linker sections may resize / addresses may relocate
67 # - zephyr_pre1: All linker section sizes are fixed, addresses cannot change
68 # - zephyr_final: Final image.
75 # existing variable to allow slowly cleanup of linking stage handling.
76 # Three stage linking active: pre0 -> pre1 -> final, this will correspond to `pre1`
77 # Two stage linking active: pre0 -> final, this will correspond to `pre0`
85 # Set some phony targets to collect dependencies
94 set_property( GLOBAL PROPERTY PROPERTY_OUTPUT_FORMAT elf32-little${ARCH}) # BFD format
101 # "zephyr_interface" is a source-less library that encapsulates all the global
103 # including the library named "zephyr" link with this library to
105 # https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#interface-libraries
108 # "zephyr" is a catch-all CMake library for source files that can be
131 message(WARNING "The environment variable '${var}' was set to $ENV{${var}}, "
133 "-DEXTRA_${var}=$ENV{${var}}' instead."
144 # Ensure that include/zephyr/toolchain.h includes toolchain/other.h for all off-tree toolchains
151 zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,no_strict_aliasing>…
161 # @Intent: Set compiler flags to enable buffer overflow checks in libc functions
165 # set. Refer to Kconfig.zephyr for selection logic and description of these
167 # properties and the Kconfig settings are used here to select between those.
175 # @Intent: Set compiler flags to detect general stack overflows across all functions
190 # Refer to Kconfig.zephyr for selection logic and description of these choices.
192 # to compiler flags. Each macro will store the flags in a CMake variable, whose
195 # If the user wants to tweak the optimizations, there are two ways:
205 # From kconfig choice, pick the actual OPTIMIZATION_FLAG to use.
219 "Unreachable code. Expected optimization level to have been chosen. See Kconfig.zephyr")
248 message(FATAL_ERROR "Unreachable code. Expected C standard to have been chosen.")
257 # @Intent: Obtain compiler specific flags related to C++ that are not influenced by kconfig
258 zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,required>>)
265 set(STD_CPP_DIALECT_FLAGS $<TARGET_PROPERTY:compiler-cpp,dialect_cpp98>)
268 set(STD_CPP_DIALECT_FLAGS $<TARGET_PROPERTY:compiler-cpp,dialect_cpp11>) # Default in kconfig
271 set(STD_CPP_DIALECT_FLAGS $<TARGET_PROPERTY:compiler-cpp,dialect_cpp14>)
274 set(STD_CPP_DIALECT_FLAGS $<TARGET_PROPERTY:compiler-cpp,dialect_cpp17>)
277 set(STD_CPP_DIALECT_FLAGS $<TARGET_PROPERTY:compiler-cpp,dialect_cpp2a>)
280 set(STD_CPP_DIALECT_FLAGS $<TARGET_PROPERTY:compiler-cpp,dialect_cpp20>)
283 set(STD_CPP_DIALECT_FLAGS $<TARGET_PROPERTY:compiler-cpp,dialect_cpp2b>)
287 "Unreachable code. Expected C++ standard to have been chosen. See Kconfig.zephyr.")
295 # @Intent: Obtain compiler specific flags related to C++ Exceptions
296 zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,no_exceptions>>)
300 # @Intent: Obtain compiler specific flags related to C++ Run Time Type Information
301 zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,no_rtti>>)
305 # @Intent: Obtain toolchain compiler flags relating to MISRA.
307 …zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,warning_error_misr…
310 # This is intend to be temporary. Once we have fixed the violations that
313 # @Intent: Obtain toolchain compiler flags relating to coding guideline
327 # @Intent: Set compiler specific flag to disable printf-related optimizations
331 # @Intent: Set compiler specific flag for tentative definitions, no-common
343 # @Intent: Set compiler specific flags to not track macro expansion
356 # @Intent: Obtain compiler specific flags related to assembly
357 # ToDo: Remember to get feedback from Oticon on this, as they might use the `ASM_BASE_FLAG` since t…
360 # @Intent: Enforce standard integer type correspondence to match Zephyr usage.
366 # Common toolchain-agnostic assembly flags
368 $<$<COMPILE_LANGUAGE:ASM>:-D_ASMLANGUAGE>
384 # in descending order to minimize padding between these symbols.
397 # Note that some architectures will skip this flag if set to error, even
402 # additions to the host toolchain linker script. The relocation
403 # sections (.rel*) requires us to override those provided
406 # for development, it is better to turn this off.
408 # CONFIG_LINKER_ORPHAN_SECTION_PLACE is to place the orphan sections
410 # So there is no need to explicitly set a linker flag.
428 zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,warning_base>>)
432 # cmake -DW=... settings
434 # W=1 - warnings that may be relevant and does not occur too often
435 # W=2 - warnings that occur quite often but may still be relevant
436 # W=3 - the more obscure warnings, can most likely be ignored
438 # @Intent: Add cmake -DW toolchain supported warnings, if any
441 zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,warning_dw_1>>)
446 zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,warning_dw_2>>)
451 zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,warning_dw_3>>)
459 zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,warning_error_impli…
466 # but we cannot tell that to the linker yet as we are first only doing a
471 # Allow the user to inject options when calling cmake, e.g.
472 # 'cmake -DEXTRA_CFLAGS="-Werror -Wno-deprecated-declarations" ..'
475 zephyr_cc_option(-fno-asynchronous-unwind-tables)
483 zephyr_cc_option(-ftls-model=local-exec)
488 zephyr_cc_option(-fomit-frame-pointer)
490 zephyr_cc_option(-fno-omit-frame-pointer)
503 zephyr_cc_option(-fno-reorder-functions)
507 # `min-pagesize` parameter (defaults to 0x1000). The `min-pagesize` parameter
508 # is set to 0 such that GCC never generates any warnings for the constant
509 # address pointers. For more details, refer to the GCC PR99578.
510 zephyr_cc_option(--param=min-pagesize=0)
513 zephyr_cc_option(-fno-defer-pop)
517 zephyr_cc_option(-Wno-vla)
520 zephyr_cc_option_ifdef(CONFIG_STACK_USAGE -fstack-usage)
532 zephyr_cc_option(-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=CMAKE_SOURCE_DIR)
533 zephyr_cc_option(-fmacro-prefix-map=${ZEPHYR_BASE}=ZEPHYR_BASE)
535 zephyr_cc_option(-fmacro-prefix-map=${WEST_TOPDIR}=WEST_TOPDIR)
542 # Declare MPU userspace dependencies before the linker scripts to make
555 set(build_version_argument "-DBUILD_VERSION=${BUILD_VERSION}")
559 "Path to Zephyr git repository index file")
561 # Likely a git-submodule. Let's ask git where the real database is located.
565 COMMAND ${GIT_EXECUTABLE} rev-parse --absolute-git-dir
573 message(WARNING "BUILD_VERSION: git rev-parse failed: ${stderr}")
576 message(WARNING "BUILD_VERSION: git rev-parse warned: ${stderr}")
579 "Path to Zephyr git repository index file")
583 "please specify '-DBUILD_VERSION=<version>'")
586 message(WARNING "ZEPHYR_BASE=${ZEPHYR_BASE} doesn't appear to be a git "
587 "repository, please specify '-DBUILD_VERSION=<version>'")
597 COMMAND ${CMAKE_COMMAND} -DZEPHYR_BASE=${ZEPHYR_BASE}
598 -DOUT_FILE=${PROJECT_BINARY_DIR}/include/generated/zephyr/version.h
599 -DVERSION_TYPE=KERNEL
600 -DVERSION_FILE=${ZEPHYR_BASE}/VERSION
601 -DKERNEL_VERSION_CUSTOMIZATION="$<TARGET_PROPERTY:version_h,KERNEL_VERSION_CUSTOMIZATION>"
603 -P ${ZEPHYR_BASE}/cmake/gen_version_h.cmake
614 COMMAND ${CMAKE_COMMAND} -DZEPHYR_BASE=${ZEPHYR_BASE}
615 -DOUT_FILE=${PROJECT_BINARY_DIR}/include/generated/zephyr/app_version.h
616 -DVERSION_TYPE=APP
617 -DVERSION_FILE=${APPLICATION_SOURCE_DIR}/VERSION
618 -DAPP_VERSION_CUSTOMIZATION="$<TARGET_PROPERTY:app_version_h,APP_VERSION_CUSTOMIZATION>"
620 -P ${ZEPHYR_BASE}/cmake/gen_version_h.cmake
633 # matters so we need to be careful about how we order the processing
635 # build are not exported to external build systems #5605"; when we
646 # that must be exported to external build systems defined in
650 # We use include instead of add_subdirectory to avoid creating a new directory scope.
651 # This is because source file properties are directory scoped, including the GENERATED
663 # subdirectory to have its own, local cmake target(s). If not then
666 # https://cmake.org/pipermail/cmake/2019-June/069547.html
688 # The syscalls subdirs txt file is constructed by python containing a list of folders to use for
690 # Windows: The list is used to specify DIRECTORY list with CMAKE_CONFIGURE_DEPENDS attribute.
691 # Other OS: The list will update whenever a file is added/removed/modified and ensure a re-build.
700 set(syscalls_links --create-links ${CMAKE_CURRENT_BINARY_DIR}/misc/generated/syscalls_links)
708 --directory ${ZEPHYR_BASE}/include # Walk this directory
709 --out-file ${syscalls_subdirs_txt} # Write file with discovered folder
710 --trigger-file ${syscalls_subdirs_trigger} # Trigger file that is used for json generation
713 file(STRINGS ${syscalls_subdirs_txt} PARSE_SYSCALLS_PATHS_DEPENDS ENCODING UTF-8)
717 # Hence adding a file requires CMake to re-run to add this file to the file list.
718 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${PARSE_SYSCALLS_PATHS_DEPENDS})
721 # on directory level.
724 # The syscall parsing depends on the folders in order to detect add/removed/modified files.
725 # When a folder is removed, CMake will try to find a target that creates that dependency.
726 # This command sets up the target for CMake to find.
728 # <folder> needed by '<target>', missing and no known rule to make it
731 COMMAND ${CMAKE_COMMAND} -E echo ""
741 --directory ${ZEPHYR_BASE}/include # Walk this directory
742 --out-file ${syscalls_subdirs_txt} # Write file with discovered folder
743 --trigger-file ${syscalls_subdirs_trigger} # Trigger file that is used for json generation
754 # when using depend on directory level.
755 # Thus CMake only needs to re-run when sub-directories are added / removed, which is indicated
757 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${syscalls_subdirs_txt})
770 "not supported and known to break in many cases due to stack overflow or "
772 "specifically tuned to run in this configuration. To disable this warning "
787 --include ${d}
798 --scan ${ZEPHYR_BASE}/include # Read files from this dir
799 --scan ${ZEPHYR_BASE}/drivers # For net sockets
800 --scan ${ZEPHYR_BASE}/subsys/net # More net sockets
802 --json-file ${syscalls_json} # Write this file
803 --tag-struct-file ${struct_tags_json} # Write subsystem list to this file
804 --file-list ${syscalls_file_list_output}
805 $<$<BOOL:${CONFIG_EMIT_ALL_SYSCALLS}>:--emit-all-syscalls>
811 # reference to any of the files as they're all picked up by various compiler
831 # 64-bit systems do not require special handling of 64-bit system call
832 # parameters or return values, indicate this to the system call boilerplate
835 set(SYSCALL_LONG_REGISTERS_ARG --long-registers)
839 set(SYSCALL_SPLIT_TIMEOUT_ARG --split-type k_timeout_t --split-type k_ticks_t)
843 # to the `syscall_list.h`, make a copy of the generated file so that percepio is able to build
846 ${CMAKE_COMMAND} -E copy
857 # Also, some files are written to include/generated/zephyr/syscalls/
861 --json-file ${syscalls_json} # Read this file
862 --base-output include/generated/zephyr/syscalls # Write to this dir
863 --syscall-dispatch include/generated/zephyr/syscall_dispatch.c # Write this file
864 --syscall-exports-llext include/generated/zephyr/syscall_exports_llext.c
865 --syscall-weakdefs-llext syscall_weakdefs_llext.c # compiled in CMake library 'syscall_weakdefs'
866 --syscall-list ${syscall_list_h}
867 $<$<BOOL:${CONFIG_USERSPACE}>:--gen-mrsh-files>
876 # This is passed into all calls to the gen_kobject_list.py script.
877 set(gen_kobject_list_include_args --include-subsystem-list ${struct_tags_json})
879 set(DRV_VALIDATION ${PROJECT_BINARY_DIR}/include/generated/zephyr/driver-validation.h)
885 --validation-output ${DRV_VALIDATION}
887 $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
901 ${CMAKE_CURRENT_BINARY_DIR}/include/generated/device-api-sections.ld
905 ${CMAKE_CURRENT_BINARY_DIR}/include/generated/device-api-sections.cmake
913 --alignment ${CONFIG_LINKER_ITERABLE_SUBALIGN}
914 --input ${struct_tags_json}
915 --tag __subsystem
916 --ld-output ${DEVICE_API_LD_SECTIONS}
917 --cmake-output ${DEVICE_API_LINKER_SECTIONS_CMAKE}
929 # Add a pseudo-target that is up-to-date when all generated headers
930 # are up-to-date.
965 -i $<TARGET_OBJECTS:${OFFSETS_LIB}>
966 -o ${OFFSETS_H_PATH}
990 # To prevent CMake failure when a driver is enabled, for example: REGULATOR=y
1003 "No SOURCES given to Zephyr library: ${zephyr_lib}\nExcluding target from build."
1027 # to avoid shadowing actual implementations.
1045 STRIP_PREFIX # Don't use a -I prefix
1050 set(dynamic_deps --dynamic-deps)
1066 --output-source device_deps.c
1067 --output-graphviz dev_graph.dot
1069 --num-dynamic-devices ${number_of_dynamic_devices}
1070 --kernel $<TARGET_FILE:${ZEPHYR_LINK_STAGE_EXECUTABLE}>
1071 --zephyr-base ${ZEPHYR_BASE}
1072 --start-symbol "$<TARGET_PROPERTY:linker,devices_start_symbol>"
1078 # gen_device_deps runs on `__device_deps_pass1` so pass this info to the linker script generator
1083 # @Intent: Linker script to relocate .text, data and .bss sections
1109 set_ifndef( TOPT -Wl,-T) # Use this if the compiler driver doesn't set a value
1143 # only initialized post-kernel.
1150 …set(APP_SMEM_PINNED_PARTITION_LIST_ARG "--pinpartitions=${APP_SMEM_PINNED_PARTITION_LIST_ARG_CSL}")
1157 set(LIBC_PART -l libc.a z_libc_partition -l libm.a z_libc_partition)
1160 set(LIBC_PART -l libc_nano.a z_libc_partition -l libm_nano.a z_libc_partition)
1163 set(LIBC_PART -l libc.a z_libc_partition)
1170 -f ${CMAKE_BINARY_DIR}/compile_commands.json
1171 -o ${APP_SMEM_UNALIGNED_LD}
1172 $<$<BOOL:${APP_SMEM_PINNED_UNALIGNED_LD}>:--pinoutput=${APP_SMEM_PINNED_UNALIGNED_LD}>
1176 $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
1209 -e $<TARGET_FILE:${ZEPHYR_LINK_STAGE_EXECUTABLE}>
1210 -o ${APP_SMEM_ALIGNED_LD}
1211 $<$<BOOL:${APP_SMEM_PINNED_ALIGNED_LD}>:--pinoutput=${APP_SMEM_PINNED_ALIGNED_LD}>
1215 $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
1227 # This CONFIG_USERSPACE block is to create place holders to reserve space
1243 --kernel $<TARGET_FILE:${ZEPHYR_LINK_STAGE_EXECUTABLE}>
1244 --gperf-output ${KOBJECT_PREBUILT_HASH_LIST}
1246 $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
1260 --output-file ${KOBJECT_PREBUILT_HASH_OUTPUT_SRC_PRE}
1261 --multiple-iterations 10
1276 -i ${KOBJECT_PREBUILT_HASH_OUTPUT_SRC_PRE}
1277 -o ${KOBJECT_PREBUILT_HASH_OUTPUT_SRC}
1278 -p "struct k_object"
1279 $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
1295 "${NO_COVERAGE_FLAGS} -fno-function-sections -fno-data-sections")
1309 …LINKER_HEADER_DATA "${PROJECT_BINARY_DIR}/include/generated/zephyr/linker-kobject-prebuilt-data.h")
1316 --object $<TARGET_OBJECTS:kobj_prebuilt_hash_output_lib>
1317 --outdir ${PROJECT_BINARY_DIR}/include/generated/zephyr
1318 --datapct ${CONFIG_KOBJECT_DATA_AREA_RESERVE_EXTRA_PERCENT}
1319 --rodata ${CONFIG_KOBJECT_RODATA_AREA_EXTRA_BYTES}
1320 $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
1382 list(APPEND GEN_ISR_TABLE_EXTRA_ARG --sw-isr-table)
1386 list(APPEND GEN_ISR_TABLE_EXTRA_ARG --vector-table)
1395 --output-source isr_tables.c
1396 --linker-output-files isr_tables_vt.ld isr_tables_swi.ld
1397 --kernel $<TARGET_FILE:${ZEPHYR_LINK_STAGE_EXECUTABLE}>
1398 --intlist-section .intList
1399 --intlist-section intList
1400 $<$<BOOL:${CONFIG_BIG_ENDIAN}>:--big-endian>
1401 $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--debug>
1415 -k $<TARGET_FILE:${ZEPHYR_LINK_STAGE_EXECUTABLE}>
1416 -o symtab.c
1433 # elf file. More information in gen_kobject_list.py --help.
1435 # Use the script GEN_KOBJ_LIST to scan the kernel binary's
1436 # (${ZEPHYR_LINK_STAGE_EXECUTABLE}) DWARF information to produce a table of kernel
1437 # objects (KOBJECT_HASH_LIST) which we will then pass to gperf
1443 --kernel $<TARGET_FILE:${ZEPHYR_LINK_STAGE_EXECUTABLE}>
1444 --gperf-output ${KOBJECT_HASH_LIST}
1446 $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
1456 # Use gperf to generate C code (KOBJECT_HASH_OUTPUT_SRC_PRE) which implements a
1462 --output-file ${KOBJECT_HASH_OUTPUT_SRC_PRE}
1463 --multiple-iterations 10
1476 # KOBJECT_HASH_OUTPUT_SRC_PRE to greatly reduce the amount of code/data generated
1483 -i ${KOBJECT_HASH_OUTPUT_SRC_PRE}
1484 -o ${KOBJECT_HASH_OUTPUT_SRC}
1485 -p "struct k_object"
1486 $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
1496 # kernel image. Disable function/data sections and use objcopy to move
1505 "${NO_COVERAGE_FLAGS} -fno-function-sections -fno-data-sections")
1583 # FIXME: Is there any way to get rid of empty_file.c?
1652 # Export the variable to the application's scope to allow the
1653 # application to know what the name of the final elf target is.
1668 ${CMAKE_COMMAND} -E copy ${logical_target_for_zephyr_elf}.map ${KERNEL_MAP_NAME}
1672 # Use ';' as separator to get proper space in resulting command.
1681 …# Note: The use of generator expressions allows downstream extensions to add/change the post build.
1781 # variable is undefined and thus expands to nothing.
1791 -c
1792 -f ${CONFIG_BUILD_OUTPUT_UF2_FAMILY_ID}
1793 -b ${flash_addr}
1794 -o ${KERNEL_UF2_NAME}
1811 --meta-out ${KERNEL_META_PATH}
1812 --zephyr-base=${ZEPHYR_BASE}
1813 $<$<BOOL:${CONFIG_BUILD_OUTPUT_META_STATE_PROPAGATE}>:--meta-state-propagate>
1820 # Prevent spdx to use invalid data
1831 ${CMAKE_COMMAND} -E remove zephyr_pre${index}.elf
1839 # Should we print a warning if case the tools does not support converting to s19 ?
1943 ${CMAKE_COMMAND} -E copy ${KERNEL_ELF_NAME} ${KERNEL_EXE_NAME}
1958 ${MAKE} -f ${ZEPHYR_BASE}/scripts/native_simulator/Makefile all --warn-undefined-variables
1959 -r NSI_CONFIG_FILE=${APPLICATION_BINARY_DIR}/zephyr/NSI/nsi_config
1972 --elf-file=${KERNEL_ELF_NAME}
1973 --header-file=${PROJECT_BINARY_DIR}/include/public/zephyr_image_info.h
1974 $<$<BOOL:${adjustment}>:--adjusted-lma=${adjustment}>
1983 #slidgen must be the first post-build command to be executed
1984 #on the Zephyr ELF to ensure that all other commands, such as
1990 --elf-file ${PROJECT_BINARY_DIR}/${KERNEL_ELF_NAME}
1991 --slid-listing ${PROJECT_BINARY_DIR}/slid_listing.txt
2002 --elf-file=${check_init_priorities_input}
2021 COMMAND ${check_init_priorities_command} --initlevels
2048 # Generate USB-C VIF policies in XML format
2075 set(LOG_DICT_DB_NAME_ARG --json)
2078 set(LOG_DICT_DB_NAME_ARG --syst)
2087 --build-header ${PROJECT_BINARY_DIR}/include/generated/zephyr/version.h
2092 # database, add the generation to post build command to make sure
2096 COMMAND ${CMAKE_COMMAND} -E echo "Generating logging dictionary database: ${LOG_DICT_DB_NAME}"
2105 # This needs to be explicitly called/used to generate the database.
2117 # Add post_build_commands to post-process the final .elf file produced by
2123 …COMMAND ${CMAKE_COMMAND} -E echo "Generating files from ${PROJECT_BINARY_DIR}/${KERNEL_ELF_NAME} f…
2130 # To populate with hex files to merge, do the following:
2135 # Merge in out-of-tree hex files.
2143 -o ${MERGED_HEX_NAME}
2172 ${CMAKE_COMMAND} -E echo
2211 # The CMAKE_C_FLAGS_<build_type> is a string, so we do a regex to see if the
2213 # To avoid false-positive matches, the flag must either be matched first
2217 …The CMake build type was set to '${CMAKE_BUILD_TYPE}', but the optimization flag was set to '${OPT…
2230 # Filter out non LLEXT and LLEXT_EDK flags - and add required ones
2234 set(llext_edk_cflags ${zephyr_defs} -DLL_EXTENSION_BUILD)
2243 -E make_directory edk/include/generated/zephyr
2247 --json-file ${syscalls_json} # Read this file
2248 --base-output edk/include/generated/zephyr/syscalls # Write to this dir
2249 --syscall-dispatch edk/include/generated/zephyr/syscall_dispatch.c # Write this file
2250 --syscall-list ${edk_syscall_list_h}
2251 $<$<BOOL:${CONFIG_LLEXT_EDK_USERSPACE_ONLY}>:--userspace-only>
2255 -DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR}
2256 -DAPPLICATION_SOURCE_DIR=${APPLICATION_SOURCE_DIR}
2257 …-DINTERFACE_INCLUDE_DIRECTORIES="$<TARGET_PROPERTY:zephyr_interface,INTERFACE_INCLUDE_DIRECTORIES>"
2258 -Dllext_edk_file=${llext_edk_file}
2259 -Dllext_edk_cflags="${llext_edk_cflags}"
2260 -Dllext_edk_name=${CONFIG_LLEXT_EDK_NAME}
2261 -DWEST_TOPDIR=${WEST_TOPDIR}
2262 -DZEPHYR_BASE=${ZEPHYR_BASE}
2263 -DCONFIG_LLEXT_EDK_USERSPACE_ONLY=${CONFIG_LLEXT_EDK_USERSPACE_ONLY}
2264 -P ${ZEPHYR_BASE}/cmake/llext-edk.cmake
2268 add_custom_target(llext-edk DEPENDS ${llext_edk_file})
2278 zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,nostdincxx>>)
2292 build_info(zephyr zephyr-base VALUE ${ZEPHYR_BASE})