Lines Matching +full:files +full:- +full:exclude
1 # SPDX-License-Identifier: Apache-2.0
14 # 1. Zephyr-aware extensions
21 # 2. Kconfig-aware extensions
23 # 3. CMake-generic extensions
43 # 1. Zephyr-aware extensions
48 # "zephyr". zephyr is a catch-all CMake library for source files that
50 # compiler flags that all zephyr source files use.
51 # [0] https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html
65 # As a very high-level introduction here are two call graphs that are
71 # zephyr_library_compile_options() --> target_compile_options()
74 # zephyr_cc_option() ---> target_cc_option()
77 # zephyr_cc_option_fallback() ---> target_cc_option_fallback()
80 # zephyr_compile_options() ---> target_compile_options()
149 # - include_directories # -I directories
150 # - system_include_directories # -isystem directories
151 # - compile_definitions # -D'efines
152 # - compile_options # misc. compiler flags
155 # - the empty string '', signifying that it should be returned as a list
156 # - _as_string signifying that it should be returned as a string
159 # - C
160 # - CXX
161 # - ASM
166 # to a compiler, e.g. prefixed with -D, or -I, but it is possible to
172 # writes "-Isome_dir;-Isome/other/dir" to x
214 set(result_output_list "-I$<JOIN:${genexp_output_list},$<SEMICOLON>-I>")
219 set(result_output_list "-I$<JOIN:${genexp_output_list},${args_DELIMITER}-I>")
232 …ult_output_list "$<$<BOOL:${genexp_output_list}>:-isystem$<JOIN:${genexp_output_list},${args_DELIM…
245 set(result_output_list "-D$<JOIN:${genexp_output_list},${args_DELIMITER}-D>")
289 # $<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>
296 # https://cmake.org/cmake/help/v3.3/manual/cmake-generator-expressions.7.html
330 # SHELL is used to avoid de-duplication, but when process flags
384 # methods have the signature: zephyr_library_<target-function>
387 # https://cmake.org/cmake/help/latest/manual/cmake-commands.7.html for
399 # Constructor with a directory-inferred name
435 # Provides amend functionality to a Zephyr library for out-of-tree usage.
577 "-l" $<TARGET_FILE_NAME:${ZEPHYR_CURRENT_LIBRARY}> "${partition}")
608 # ensure that when a user KConfig-enables a library then the header
609 # files of this library will be accessible to the 'app' library.
612 # expects to be able to include its header files and call its
613 # functions out-of-the box.
652 --file ${source_file}
696 # - Board runners
697 # - Board revision
716 # meant to be used from application CMakeLists.txt files.
718 # NOTE: Usually board_set_xxx_ifnset() is best in board.cmake files.
779 # This function is intended for board.cmake files and application
780 # CMakeLists.txt files.
782 # Usage from board.cmake files:
783 # board_runner_args(runner "--some-arg=val1" "--another-arg=val2")
787 # --some-arg=val1 --another-arg=val2
789 # Within application CMakeLists.txt files, ensure that all calls to
793 # board_runner_args(runner "--some-app-setting=value")
808 # boards/common/runner.board.cmake files.
818 # board_runner_args(runner "--some-arg=default-value")
872 # The function will check the revision from `-DBOARD=<board>@<revision>` that
878 # LETTER: Revision format is a single letter from A - Z.
904 # revisions 0.x.0-0.99.99 and 1.0.0-1.99.99, and it is expected
936 requires a revision. Please use: `-DBOARD=${BOARD}@<revision>`")
955 set(revision_regex "([A-Z])")
957 set(revision_regex "([0-9]+)")
959 set(revision_regex "((0|[1-9][0-9]*)(\.[0-9]+)(\.[0-9]+))")
962 if(BOARD_REVISION MATCHES "((0|[1-9][0-9]*)(\.[0-9]+)?(\.[0-9]+)?)")
1045 # again wraps the CMake-builtin's check_c_compiler_flag and
1068 # directory of files. The filenames in the directory are keys, and
1069 # the file contents are the values in this key-value store.
1104 # Flags that start with -Wno-<warning> can not be tested by
1105 # check_compiler_flag, they will always pass, but -W<warning> can be
1106 # tested, so to test -Wno-<warning> flags we test -W<warning>
1108 if("${option}" MATCHES "-Wno-(.*)")
1109 string(REPLACE "-Wno-" "-W" possibly_translated_option "${option}")
1127 # same files multiple times.
1160 # the test. Exclude them by toolchain-specific blocklist.
1170 # zephyr_linker_sources(<location> [SORT_KEY <sort_key>] <files>)
1172 # <files> is one or more .ld formatted files whose contents will be
1174 # Preprocessor directives work inside <files>. Relative paths are resolved
1183 # currently only available on ARM Cortex-M, ARM Cortex-R,
1184 # x86, ARC, openisa_rv32m1, and RISC-V.
1201 # given, the key 'default' is used. Keys are case-sensitive.
1206 # NOCACHE_SECTION, DTCM_SECTION or ITCM_SECTION the contents of the files will
1212 # _mysection_size = ABSOLUTE(_mysection_end - _mysection_start);
1215 # files must instead define their own output sections to achieve the same thing:
1222 # _mysection_size = _mysection_end - _mysection_start;
1231 # Set up the paths to the destination files. These files are #included inside
1234 set(sections_path "${snippet_base}/snippets-sections.ld")
1235 set(rom_sections_path "${snippet_base}/snippets-rom-sections.ld")
1236 set(ram_sections_path "${snippet_base}/snippets-ram-sections.ld")
1237 set(data_sections_path "${snippet_base}/snippets-data-sections.ld")
1238 set(rom_start_path "${snippet_base}/snippets-rom-start.ld")
1239 set(noinit_path "${snippet_base}/snippets-noinit.ld")
1240 set(rwdata_path "${snippet_base}/snippets-rwdata.ld")
1241 set(rodata_path "${snippet_base}/snippets-rodata.ld")
1242 set(ramfunc_path "${snippet_base}/snippets-ramfunc-section.ld")
1243 set(nocache_path "${snippet_base}/snippets-nocache-section.ld")
1244 set(itcm_path "${snippet_base}/snippets-itcm-section.ld")
1245 set(dtcm_path "${snippet_base}/snippets-dtcm-section.ld")
1247 set(pinned_ram_sections_path "${snippet_base}/snippets-pinned-ram-sections.ld")
1248 set(pinned_data_sections_path "${snippet_base}/snippets-pinned-data-sections.ld")
1249 set(pinned_rodata_path "${snippet_base}/snippets-pinned-rodata.ld")
1251 # Clear destination files if this is the first time the function is called.
1347 list(FILTER lines EXCLUDE REGEX ${relpath})
1372 # This function may either be invoked with a list of files, or a library
1375 # The FILES directive will relocate a list of files (wildcards supported)
1377 # zephyr_code_relocate(FILES file1.c file2.c LOCATION SRAM)
1378 # Note, files can also be passed as a comma separated list to support using
1386 # - NOCOPY: this flag indicates that the file data does not need to be copied
1388 # - NOKEEP: suppress the generation of KEEP() statements in the linker script,
1389 # to allow any unused code in the given files/library to be discarded.
1390 # - PHDR [program_header]: add program header. Used on Xtensa platforms.
1394 set(multi_args FILES)
1404 "zephyr_code_relocate() requires either FILES or LIBRARY be provided")
1408 "one argument between FILES and LIBRARY")
1422 set(src_list_abs "$<FILTER:${genex_src_list},INCLUDE,^[A-Za-z]\:>")
1423 set(src_list_rel "$<FILTER:${genex_src_list},EXCLUDE,^[A-Za-z]\:>")
1426 set(src_list_rel "$<FILTER:${genex_src_list},EXCLUDE,^/>")
1438 # no generator expression in CODE_REL_FILES, check if list of files
1463 # using set_property(APPEND) to produce a ";"-separated CMake list. This way,
1464 # each directive can embed multiple CMake lists, representing flags and files,
1474 # check_dtc_flag("-Wtest" DTC_WARN_TEST)
1483 ${DTC} ${flag} -v
1512 math(EXPR x "${${n}} & (${${n}} - 1)")
1538 # - Normalized board target build string, this includes qualifiers and revision
1539 # - Build string with board variants removed in addition
1540 # - Build string with cpuset removed in addition
1541 # - Build string with soc removed in addition
1547 # non-revisioned entry for each entry.
1550 # zephyr_build_string(<out-variable>
1552 # [SHORT <out-variable>]
1558 # zephyr_build_string(<out-variable>
1564 # <out-variable>: Output variable where the build string will be returned.
1565 # SHORT <out-variable>: Output variable where the shortened build string will be returned.
1736 # zephyr_blobs_verify(<MODULE module|FILES file [files...]> [REQUIRED])
1740 # zephyr_blobs_verify(FILES img/file.bin) # verify a single file and print on error
1742 cmake_parse_arguments(BLOBS_VERIFY "REQUIRED" "MODULE" "FILES" ${ARGN})
1745 message(FATAL_ERROR "Either MODULE or FILES required when calling ${CMAKE_CURRENT_FUNCTION}")
1753 COMMAND ${WEST} blobs list ${BLOBS_VERIFY_MODULE} --format "{status} {abspath}"
1804 # 2. Kconfig-aware extensions
1832 ENCODING "UTF-8"
1896 # 3. CMake-generic extensions
1924 # "<function-name>_ifdef(CONDITION args)"
1928 # <function-name>(args)
1932 # ifdef functions are added on an as-need basis. See
1933 # https://cmake.org/cmake/help/latest/manual/cmake-commands.7.html for
2231 # 3.3. *_option Compiler-compatibility checks
2235 # cc-option in
2247 # check_compiler_flag(C "-Wall" my_check)
2335 # 'gcc -M'.
2341 # of parsing the include files.
2355 # The file might also contain multiple files on one line if one or both of
2415 # compiler-cpp targets.
2427 set(APPEND-CPP "APPEND")
2431 set_property(TARGET compiler-cpp ${APPEND} PROPERTY ${COMPILER_PROPERTY_PROPERTY})
2435 # flag and only set the compiler or compiler-cpp property if the check succeeds
2439 # before setting the property on compiler or compiler-cpp targets.
2441 # To test flags together, such as '-Wformat -Wformat-security', an option group
2442 # can be specified by using shell-like quoting along with a 'SHELL:' prefix.
2444 # '"SHELL:-Wformat -Wformat-security"' becomes '-Wformat -Wformat-security' for
2457 set(APPEND-CPP "APPEND")
2473 set_property(TARGET compiler-cpp ${APPEND-CPP} PROPERTY ${property} ${option})
2474 set(APPEND-CPP "APPEND")
2549 # those paths that are defined with `-D<path>=<val>`
2552 # by user with `-D<path>`
2553 # BASE_DIR <base-dir>: convert paths relative to <base-dir>
2564 # CONF_FILES <paths>: Find all configuration files in the list of paths and
2566 # files are returned. Configuration files will be:
2567 # - DTS: Overlay files (.overlay)
2568 # - Kconfig: Config fragments (.conf)
2569 # - defconfig: defconfig files (_defconfig)
2571 # files for the current board.
2573 # BOARD <board>: Find configuration files for specified board.
2574 # BOARD_REVISION <revision>: Find configuration files for specified board
2585 # DTS <list>: List to append DTS overlay files in <path> to
2586 # KCONF <list>: List to append Kconfig fragment files in <path> to
2587 # DEFCONF <list>: List to append _defconfig files in <path> to
2625 # Note: user can do: `-D<var>=<relative-path>` and app can at same
2626 # time specify `list(APPEND <var> <abs-path>)`
2627 # Thus need to check and update only CACHED variables (-D<var>).
2630 # The cached variable is relative path, i.e. provided by `-D<var>` or
2651 Relative paths are only allowed with `-D${ARGV1}=<path>`")
2826 " you should switch to using -DFILE_SUFFIX instead")
2896 COMMAND ${CMAKE_COMMAND} -E ${copy_file_command} ${oldname} ${newname}
2952 # zephyr_string(<mode> <out-var> <input> ...)
2959 # characters. Special characters, such as -, +, =, $, etc. are
2963 # characters. Special characters, such as -, +, =, $, etc. are
2982 string(REGEX REPLACE "[^a-zA-Z0-9_]" "_" work_string ${work_string})
3002 # for storing current and future Zephyr-related extensions for list
3006 # converts the argument list <list> to a ;-list with
3009 # may be whitespace- or semicolon-separated.
3088 # - Sysbuild defined when sysbuild is used.
3091 # - BOARD is considered a global sysbuild cache variable
3092 # - blinky_BOARD is considered a local sysbuild cache variable only for the
3097 # - CMake cache, set by `-D<var>=<value>` or `set(<var> <val> CACHE ...)
3098 # - Environment
3099 # - Locally in CMakeLists.txt before 'find_package(Zephyr)'
3103 # using `-DZEPHYR_TOOLCHAIN_VARIANT=<val>`, then the value from the cache is
3261 # - BOARD
3262 # - SHIELD
3272 # - Using CMake argument, -D<variable>
3273 # - Using an environment variable
3274 # - In the project CMakeLists.txt before `find_package(Zephyr)`.
3284 # E.g. always specifies -D<variable>= on the command line,
3311 # If user uses -D<variable>=<new_value>, then cli_argument will hold the new
3352 message(FATAL_ERROR "${variable} is not being defined on the CMake command-line,"
3407 # Get build targets for a given directory and sub-directories.
3441 # This function allows samples that are multi-image samples by nature to ensure
3455 "For correct user-experiences, please build '${PROJECT_NAME}' "
3468 # may produce additional files, like map files. Those files are not known to the
3479 POST_BUILD COMMAND ${CMAKE_COMMAND} -E true
3488 # RESULT <out-variable>)
3564 # - In CMake, we refer to the nodes using the node's path, therefore
3568 # - As another difference from the C API, you can generally use an
3583 # nvic: interrupt-controller@e000e100 { ... };
3589 # # Sets 'nvic_path' to "/soc/interrupt-controller@e000e100"
3614 if(${${var}} STREQUAL ${var}-NOTFOUND)
3632 # # alias "does-not-exist".
3633 # dt_alias(path PROPERTY "does-not-exist")
3657 if(${${var}} STREQUAL ${var}-NOTFOUND)
3671 # - absolute path to a node, like '/foo/bar'
3672 # - a node alias, like 'my-alias'
3673 # - a node alias followed by a path to a child node, like 'my-alias/child-node'
3708 # - exists in the devicetree, and
3709 # - has a status property matching the <status> argument
3715 # - absolute path to a node, like '/foo/bar'
3716 # - a node alias, like 'my-alias'
3717 # - a node alias followed by a path to a child node, like 'my-alias/child-node'
3769 # - absolute path to a node, like '/foo/bar'
3770 # - a node alias, like 'my-alias'
3771 # - a node alias followed by a path to a child node, like 'my-alias/child-node'
3774 # devicetree binding types: string, int, boolean, array, uint8-array,
3775 # string-array, path.
3777 # For array valued properties (including uint8-array and
3778 # string-array), the entire array is returned as a CMake list unless
3789 # dt_prop(reserved_ranges PATH "/soc/gpio@deadbeef" PROPERTY "gpio-reserved-ranges")
3791 # # Node exists and has the "gpio-reserved-ranges" property.
3798 # dt_prop(reserved_ranges PATH "/soc/gpio@deadbeef" PROPERTY "gpio-reserved-ranges")
3800 # # Node "/soc/gpio@deadbeef" exists and has the "gpio-reserved-ranges" property
3915 # - absolute path to a node, like '/foo/bar'
3916 # - a node alias, like 'my-alias'
3917 # - a node alias followed by a path to a child node, like 'my-alias/child-node'
3954 # - absolute path to a node, like '/foo/bar'
3955 # - a node alias, like 'my-alias'
3956 # - a node alias followed by a path to a child node, like 'my-alias/child-node'
3959 # - The base address of the register block
3960 # - <var> will be undefined if node does not exists or does not have a register
3990 if(DT_REG_INDEX EQUAL "-1")
4019 # - absolute path to a node, like '/foo/bar'
4020 # - a node alias, like 'my-alias'
4021 # - a node alias followed by a path to a child node, like 'my-alias/child-node'
4050 if(DT_REG_INDEX EQUAL "-1")
4070 dt_prop(reg_names PATH "${path}" PROPERTY "reg-names")
4072 set(index "-1")
4122 if(${exists} STREQUAL exists-NOTFOUND)
4157 if(${${var}} STREQUAL ${var}-NOTFOUND)
4173 # my-label: bar {
4178 # my-alias = &my-label;
4185 # dt_path_internal(ret "my-alias") # sets ret to "/foo/bar"
4186 # dt_path_internal(ret "my-alias/baz") # sets ret to "/foo/bar/baz"
4208 if (NOT "${slash_index}" EQUAL -1)
4209 string(SUBSTRING "${path}" "${slash_index}" -1 rest)
4269 # with devicetree related files in CMake.
4286 # Preprocess one or more devicetree source files. The preprocessor
4295 # SOURCE_FILES <file...>: The source files to run the preprocessor on.
4325 list(APPEND include_opts -isystem ${dir})
4330 list(APPEND source_opts -include ${file})
4335 list(APPEND deps_opts -MD -MF ${DT_PREPROCESS_DEPS_FILE})
4347 -x assembler-with-cpp
4348 -nostdinc
4352 -D__DTS__
4354 -E # Stop after preprocessing
4356 -o ${DT_PREPROCESS_OUT_FILE}
4362 …message(FATAL_ERROR "failed to preprocess devicetree files (error code ${ret}): ${DT_PREPROCESS_SO…
4378 # ARM scatter files with ARM linker.
4454 # r: Read-only region
4455 # w: Read-write region
4534 dt_prop(name PATH ${DTS_SECTION_PATH} PROPERTY "zephyr,memory-region")
4537 "\"zephyr,memory-region\" property"
4568 # r: Read-only region
4569 # w: Read-write region
4609 dt_prop(name PATH ${DTS_MEMORY_PATH} PROPERTY "zephyr,memory-region")
4612 "\"zephyr,memory-region\" property"
4664 # +-----------------+
4667 # | +-------------+ |
4669 # | +-------------+ |
4671 # | +-------------+ |
4673 # | +-------------+ |
4675 # +-----------------+
4684 # +---------------------+
4687 # | +-----------------+ |
4690 # | | +-------------+ | |
4692 # | | +-------------+ | |
4694 # | +-----------------+ |
4696 # +---------------------+
4825 - (${CONFIG_SRAM_BASE_ADDRESS} + ${CONFIG_SRAM_OFFSET})"
4887 # of equally-sized data structures. For use with STRUCT_SECTION_ITERABLE.
4921 # ToDo - Should we use ROM, RAM, etc as arguments ?
5050 # The FLAGS and ANY arguments only has effect for scatter files.
5100 # `+, -, *` and similar. The expression will go directly into the
5129 # The macro will create a list of argument-value pairs for defined arguments
5297 # Add a custom target that compiles a set of source files to a .llext file.
5299 # Output and source files must be specified using the OUTPUT and SOURCES
5311 # - lib_target Target name for the source compilation and/or link step.
5312 # - lib_output The binary file resulting from compilation and/or
5314 # - pkg_input The file to be used as input for the packaging step.
5315 # - pkg_output The final .llext file.
5335 # Source and output files must be provided
5366 # a "-shared" flag to the linker command line which does firmly
5367 # conflict with "-r".
5425 # they will take care of this and the default copy is replaced by a no-op.
5427 set(noop_cmd ${CMAKE_COMMAND} -E true)
5428 set(copy_cmd ${CMAKE_COMMAND} -E copy ${llext_lib_output} ${llext_pkg_input})
5446 --elf-file ${llext_pkg_output}
5449 set(slid_inject_cmd ${CMAKE_COMMAND} -E true)
5452 # Type-specific packaging of the built binary file into an .llext file
5458 COMMAND ${CMAKE_COMMAND} -E copy ${llext_pkg_input} ${llext_pkg_output}
5496 # Add user-visible target and dependency, and fill in properties
5519 # can refer to <target>'s properties for build-specific details.
5522 # - PRE_BUILD: Before the llext code is linked, if the architecture uses
5525 # - POST_BUILD: After the llext code is built, but before packaging
5528 # - POST_PKG: After the .llext file has been created. This can operate on
5531 # Anything else after COMMAND will be passed to add_custom_command() as-is
5536 # COMMAND and other options are passed to add_custom_command() as-is
5558 # > before the object files are linked:
5559 # - execute user command(s) before the lib target's link step.
5564 # - stop default file copy to prevent user files from being clobbered;
5565 # - execute user command(s) after the (now empty) `llext_proc_target`.
5571 # - execute user command(s) after the main target is done.
5598 # expressions that will be used to exclude flags from the input list.
5618 "$<FILTER:${flags},EXCLUDE,${llext_remove_flags_regexp}>"