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
40 # 1. Zephyr-aware extensions
45 # "zephyr". zephyr is a catch-all CMake library for source files that
47 # compiler flags that all zephyr source files use.
48 # [0] https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html
62 # As a very high-level introduction here are two call graphs that are
68 # zephyr_library_compile_options() --> target_compile_options()
71 # zephyr_cc_option() ---> target_cc_option()
74 # zephyr_cc_option_fallback() ---> target_cc_option_fallback()
77 # zephyr_compile_options() ---> target_compile_options()
146 # - include_directories # -I directories
147 # - system_include_directories # -isystem directories
148 # - compile_definitions # -D'efines
149 # - compile_options # misc. compiler flags
152 # - the empty string '', signifying that it should be returned as a list
153 # - _as_string signifying that it should be returned as a string
156 # - C
157 # - CXX
158 # - ASM
163 # to a compiler, e.g. prefixed with -D, or -I, but it is possible to
169 # writes "-Isome_dir;-Isome/other/dir" to x
211 set(result_output_list "-I$<JOIN:${genexp_output_list},$<SEMICOLON>-I>")
216 set(result_output_list "-I$<JOIN:${genexp_output_list},${args_DELIMITER}-I>")
229 …ult_output_list "$<$<BOOL:${genexp_output_list}>:-isystem$<JOIN:${genexp_output_list},${args_DELIM…
242 set(result_output_list "-D$<JOIN:${genexp_output_list},${args_DELIMITER}-D>")
286 # $<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>
293 # https://cmake.org/cmake/help/v3.3/manual/cmake-generator-expressions.7.html
327 # SHELL is used to avoid de-duplication, but when process flags
381 # methods have the signature: zephyr_library_<target-function>
384 # https://cmake.org/cmake/help/latest/manual/cmake-commands.7.html for
396 # Constructor with a directory-inferred name
432 # Provides amend functionality to a Zephyr library for out-of-tree usage.
574 "-l" $<TARGET_FILE_NAME:${ZEPHYR_CURRENT_LIBRARY}> "${partition}")
605 # ensure that when a user KConfig-enables a library then the header
606 # files of this library will be accessible to the 'app' library.
609 # expects to be able to include its header files and call its
610 # functions out-of-the box.
649 --file ${source_file}
693 # - Board runners
694 # - Board revision
712 # meant to be used from application CMakeLists.txt files.
714 # NOTE: Usually board_set_xxx_ifnset() is best in board.cmake files.
765 # This function is intended for board.cmake files and application
766 # CMakeLists.txt files.
768 # Usage from board.cmake files:
769 # board_runner_args(runner "--some-arg=val1" "--another-arg=val2")
773 # --some-arg=val1 --another-arg=val2
775 # Within application CMakeLists.txt files, ensure that all calls to
779 # board_runner_args(runner "--some-app-setting=value")
794 # boards/common/runner.board.cmake files.
804 # board_runner_args(runner "--some-arg=default-value")
858 # The function will check the revision from `-DBOARD=<board>@<revision>` that
864 # LETTER: Revision format is a single letter from A - Z.
890 # revisions 0.x.0-0.99.99 and 1.0.0-1.99.99, and it is expected
922 requires a revision. Please use: `-DBOARD=${BOARD}@<revision>`")
941 set(revision_regex "([A-Z])")
943 set(revision_regex "([0-9]+)")
945 set(revision_regex "((0|[1-9][0-9]*)(\.[0-9]+)(\.[0-9]+))")
948 if(BOARD_REVISION MATCHES "((0|[1-9][0-9]*)(\.[0-9]+)?(\.[0-9]+)?)")
1031 # again wraps the CMake-builtin's check_c_compiler_flag and
1054 # directory of files. The filenames in the directory are keys, and
1055 # the file contents are the values in this key-value store.
1090 # Flags that start with -Wno-<warning> can not be tested by
1091 # check_compiler_flag, they will always pass, but -W<warning> can be
1092 # tested, so to test -Wno-<warning> flags we test -W<warning>
1094 if("${option}" MATCHES "-Wno-(.*)")
1095 string(REPLACE "-Wno-" "-W" possibly_translated_option "${option}")
1113 # same files multiple times.
1146 # the test. Exclude them by toolchain-specific blocklist.
1156 # zephyr_linker_sources(<location> [SORT_KEY <sort_key>] <files>)
1158 # <files> is one or more .ld formatted files whose contents will be
1160 # Preprocessor directives work inside <files>. Relative paths are resolved
1169 # currently only available on ARM Cortex-M, ARM Cortex-R,
1170 # x86, ARC, openisa_rv32m1, and RISC-V.
1186 # given, the key 'default' is used. Keys are case-sensitive.
1191 # NOCACHE_SECTION, DTCM_SECTION or ITCM_SECTION the contents of the files will
1197 # _mysection_size = ABSOLUTE(_mysection_end - _mysection_start);
1199 # When placing into SECTIONS, RAM_SECTIONS or DATA_SECTIONS, the files must
1207 # _mysection_size = _mysection_end - _mysection_start;
1216 # Set up the paths to the destination files. These files are #included inside
1219 set(sections_path "${snippet_base}/snippets-sections.ld")
1220 set(ram_sections_path "${snippet_base}/snippets-ram-sections.ld")
1221 set(data_sections_path "${snippet_base}/snippets-data-sections.ld")
1222 set(rom_start_path "${snippet_base}/snippets-rom-start.ld")
1223 set(noinit_path "${snippet_base}/snippets-noinit.ld")
1224 set(rwdata_path "${snippet_base}/snippets-rwdata.ld")
1225 set(rodata_path "${snippet_base}/snippets-rodata.ld")
1226 set(ramfunc_path "${snippet_base}/snippets-ramfunc-section.ld")
1227 set(nocache_path "${snippet_base}/snippets-nocache-section.ld")
1228 set(itcm_path "${snippet_base}/snippets-itcm-section.ld")
1229 set(dtcm_path "${snippet_base}/snippets-dtcm-section.ld")
1231 set(pinned_ram_sections_path "${snippet_base}/snippets-pinned-ram-sections.ld")
1232 set(pinned_data_sections_path "${snippet_base}/snippets-pinned-data-sections.ld")
1233 set(pinned_rodata_path "${snippet_base}/snippets-pinned-rodata.ld")
1235 # Clear destination files if this is the first time the function is called.
1328 list(FILTER lines EXCLUDE REGEX ${relpath})
1353 # This function may either be invoked with a list of files, or a library
1356 # The FILES directive will relocate a list of files (wildcards supported)
1358 # zephyr_code_relocate(FILES file1.c file2.c LOCATION SRAM)
1359 # Note, files can also be passed as a comma separated list to support using
1367 # - NOCOPY: this flag indicates that the file data does not need to be copied
1369 # - NOKEEP: suppress the generation of KEEP() statements in the linker script,
1370 # to allow any unused code in the given files/library to be discarded.
1371 # - PHDR [program_header]: add program header. Used on Xtensa platforms.
1375 set(multi_args FILES)
1385 "zephyr_code_relocate() requires either FILES or LIBRARY be provided")
1389 "one argument between FILES and LIBRARY")
1403 set(src_list_abs "$<FILTER:${genex_src_list},INCLUDE,^[A-Za-z]\:>")
1404 set(src_list_rel "$<FILTER:${genex_src_list},EXCLUDE,^[A-Za-z]\:>")
1407 set(src_list_rel "$<FILTER:${genex_src_list},EXCLUDE,^/>")
1419 # no generator expression in CODE_REL_FILES, check if list of files
1444 # using set_property(APPEND) to produce a ";"-separated CMake list. This way,
1445 # each directive can embed multiple CMake lists, representing flags and files,
1455 # check_dtc_flag("-Wtest" DTC_WARN_TEST)
1464 ${DTC} ${flag} -v
1493 math(EXPR x "${${n}} & (${${n}} - 1)")
1515 # zephyr_build_string(<out-variable>
1521 # <out-variable>: Output variable where the build string will be returned.
1608 # zephyr_blobs_verify(<MODULE module|FILES file [files...]> [REQUIRED])
1612 # zephyr_blobs_verify(FILES img/file.bin) # verify a single file and print on error
1614 cmake_parse_arguments(BLOBS_VERIFY "REQUIRED" "MODULE" "FILES" ${ARGN})
1617 message(FATAL_ERROR "Either MODULE or FILES required when calling ${CMAKE_CURRENT_FUNCTION}")
1625 COMMAND ${WEST} blobs list ${BLOBS_VERIFY_MODULE} --format "{status} {abspath}"
1672 # 2. Kconfig-aware extensions
1700 ENCODING "UTF-8"
1764 # 3. CMake-generic extensions
1792 # "<function-name>_ifdef(CONDITION args)"
1796 # <function-name>(args)
1800 # ifdef functions are added on an as-need basis. See
1801 # https://cmake.org/cmake/help/latest/manual/cmake-commands.7.html for
2099 # 3.3. *_option Compiler-compatibility checks
2103 # cc-option in
2115 # check_compiler_flag(C "-Wall" my_check)
2203 # 'gcc -M'.
2209 # of parsing the include files.
2227 string(SUBSTRING ${first_input_line} ${j} -1 first_include_file)
2287 # compiler-cpp targets.
2299 set(APPEND-CPP "APPEND")
2303 set_property(TARGET compiler-cpp ${APPEND} PROPERTY ${COMPILER_PROPERTY_PROPERTY})
2307 # flag and only set the compiler or compiler-cpp property if the check succeeds
2311 # before setting the property on compiler or compiler-cpp targets.
2313 # To test flags together, such as '-Wformat -Wformat-security', an option group
2314 # can be specified by using shell-like quoting along with a 'SHELL:' prefix.
2316 # '"SHELL:-Wformat -Wformat-security"' becomes '-Wformat -Wformat-security' for
2329 set(APPEND-CPP "APPEND")
2345 set_property(TARGET compiler-cpp ${APPEND-CPP} PROPERTY ${property} ${option})
2346 set(APPEND-CPP "APPEND")
2421 # those paths that are defined with `-D<path>=<val>`
2424 # by user with `-D<path>`
2434 # CONF_FILES <paths>: Find all configuration files in the list of paths and
2436 # files are returned. Configuration files will be:
2437 # - DTS: Overlay files (.overlay)
2438 # - Kconfig: Config fragments (.conf)
2440 # files for the current board.
2442 # BOARD <board>: Find configuration files for specified board.
2443 # BOARD_REVISION <revision>: Find configuration files for specified board
2455 # DTS <list>: List to append DTS overlay files in <path> to
2456 # KCONF <list>: List to append Kconfig fragment files in <path> to
2490 # Note: user can do: `-D<var>=<relative-path>` and app can at same
2491 # time specify `list(APPEND <var> <abs-path>)`
2492 # Thus need to check and update only CACHED variables (-D<var>).
2495 # The cached variable is relative path, i.e. provided by `-D<var>` or
2516 Relative paths are only allowed with `-D${ARGV1}=<path>`")
2637 " you should switch to using -DFILE_SUFFIX instead")
2673 COMMAND ${CMAKE_COMMAND} -E ${copy_file_command} ${oldname} ${newname}
2729 # zephyr_string(<mode> <out-var> <input> ...)
2736 # characters. Special characters, such as -, +, =, $, etc. are
2740 # characters. Special characters, such as -, +, =, $, etc. are
2759 string(REGEX REPLACE "[^a-zA-Z0-9_]" "_" work_string ${work_string})
2779 # for storing current and future Zephyr-related extensions for list
2783 # converts the argument list <list> to a ;-list with
2786 # may be whitespace- or semicolon-separated.
2865 # - Sysbuild defined when sysbuild is used.
2868 # - BOARD is considered a global sysbuild cache variable
2869 # - blinky_BOARD is considered a local sysbuild cache variable only for the
2874 # - CMake cache, set by `-D<var>=<value>` or `set(<var> <val> CACHE ...)
2875 # - Environment
2876 # - Locally in CMakeLists.txt before 'find_package(Zephyr)'
2880 # using `-DZEPHYR_TOOLCHAIN_VARIANT=<val>`, then the value from the cache is
3038 # - BOARD
3039 # - SHIELD
3049 # - Using CMake argument, -D<variable>
3050 # - Using an environment variable
3051 # - In the project CMakeLists.txt before `find_package(Zephyr)`.
3061 # E.g. always specifies -D<variable>= on the command line,
3088 # If user uses -D<variable>=<new_value>, then cli_argument will hold the new
3129 message(FATAL_ERROR "${variable} is not being defined on the CMake command-line,"
3184 # Get build targets for a given directory and sub-directories.
3218 # This function allows samples that are multi-image samples by nature to ensure
3232 "For correct user-experiences, please build '${PROJECT_NAME}' "
3245 # may produce additional files, like map files. Those files are not known to the
3256 POST_BUILD COMMAND ${CMAKE_COMMAND} -E true
3265 # RESULT <out-variable>)
3341 # - In CMake, we refer to the nodes using the node's path, therefore
3345 # - As another difference from the C API, you can generally use an
3360 # nvic: interrupt-controller@e000e100 { ... };
3366 # # Sets 'nvic_path' to "/soc/interrupt-controller@e000e100"
3391 if(${${var}} STREQUAL ${var}-NOTFOUND)
3409 # # alias "does-not-exist".
3410 # dt_alias(path PROPERTY "does-not-exist")
3434 if(${${var}} STREQUAL ${var}-NOTFOUND)
3448 # - absolute path to a node, like '/foo/bar'
3449 # - a node alias, like 'my-alias'
3450 # - a node alias followed by a path to a child node, like 'my-alias/child-node'
3485 # - exists in the devicetree, and
3486 # - has a status property matching the <status> argument
3492 # - absolute path to a node, like '/foo/bar'
3493 # - a node alias, like 'my-alias'
3494 # - a node alias followed by a path to a child node, like 'my-alias/child-node'
3546 # - absolute path to a node, like '/foo/bar'
3547 # - a node alias, like 'my-alias'
3548 # - a node alias followed by a path to a child node, like 'my-alias/child-node'
3551 # devicetree binding types: string, int, boolean, array, uint8-array,
3552 # string-array, path.
3554 # For array valued properties (including uint8-array and
3555 # string-array), the entire array is returned as a CMake list unless
3566 # dt_prop(reserved_ranges PATH "/soc/gpio@deadbeef" PROPERTY "gpio-reserved-ranges")
3568 # # Node exists and has the "gpio-reserved-ranges" property.
3575 # dt_prop(reserved_ranges PATH "/soc/gpio@deadbeef" PROPERTY "gpio-reserved-ranges")
3577 # # Node "/soc/gpio@deadbeef" exists and has the "gpio-reserved-ranges" property
3692 # - absolute path to a node, like '/foo/bar'
3693 # - a node alias, like 'my-alias'
3694 # - a node alias followed by a path to a child node, like 'my-alias/child-node'
3731 # - absolute path to a node, like '/foo/bar'
3732 # - a node alias, like 'my-alias'
3733 # - a node alias followed by a path to a child node, like 'my-alias/child-node'
3736 # - The base address of the register block
3737 # - <var> will be undefined if node does not exists or does not have a register
3767 if(DT_REG_INDEX EQUAL "-1")
3796 # - absolute path to a node, like '/foo/bar'
3797 # - a node alias, like 'my-alias'
3798 # - a node alias followed by a path to a child node, like 'my-alias/child-node'
3827 if(DT_REG_INDEX EQUAL "-1")
3847 dt_prop(reg_names PATH "${path}" PROPERTY "reg-names")
3849 set(index "-1")
3899 if(${exists} STREQUAL exists-NOTFOUND)
3934 if(${${var}} STREQUAL ${var}-NOTFOUND)
3950 # my-label: bar {
3955 # my-alias = &my-label;
3962 # dt_path_internal(ret "my-alias") # sets ret to "/foo/bar"
3963 # dt_path_internal(ret "my-alias/baz") # sets ret to "/foo/bar/baz"
3985 if (NOT "${slash_index}" EQUAL -1)
3986 string(SUBSTRING "${path}" "${slash_index}" -1 rest)
4046 # with devicetree related files in CMake.
4063 # Preprocess one or more devicetree source files. The preprocessor
4072 # SOURCE_FILES <file...>: The source files to run the preprocessor on.
4102 list(APPEND include_opts -isystem ${dir})
4107 list(APPEND source_opts -include ${file})
4112 list(APPEND deps_opts -MD -MF ${DT_PREPROCESS_DEPS_FILE})
4124 -x assembler-with-cpp
4125 -nostdinc
4129 -D__DTS__
4131 -E # Stop after preprocessing
4133 -o ${DT_PREPROCESS_OUT_FILE}
4139 …message(FATAL_ERROR "failed to preprocess devicetree files (error code ${ret}): ${DT_PREPROCESS_SO…
4155 # ARM scatter files with ARM linker.
4231 # r: Read-only region
4232 # w: Read-write region
4311 dt_prop(name PATH ${DTS_SECTION_PATH} PROPERTY "zephyr,memory-region")
4314 "\"zephyr,memory-region\" property"
4345 # r: Read-only region
4346 # w: Read-write region
4386 dt_prop(name PATH ${DTS_MEMORY_PATH} PROPERTY "zephyr,memory-region")
4389 "\"zephyr,memory-region\" property"
4441 # +-----------------+
4444 # | +-------------+ |
4446 # | +-------------+ |
4448 # | +-------------+ |
4450 # | +-------------+ |
4452 # +-----------------+
4461 # +---------------------+
4464 # | +-----------------+ |
4467 # | | +-------------+ | |
4469 # | | +-------------+ | |
4471 # | +-----------------+ |
4473 # +---------------------+
4602 - (${CONFIG_SRAM_BASE_ADDRESS} + ${CONFIG_SRAM_OFFSET})"
4664 # of equally-sized data structures. For use with STRUCT_SECTION_ITERABLE.
4698 # ToDo - Should we use ROM, RAM, etc as arguments ?
4827 # The FLAGS and ANY arguments only has effect for scatter files.
4877 # `+, -, *` and similar. The expression will go directly into the
4906 # The macro will create a list of argument-value pairs for defined arguments
5038 # Output and source files must be specified using the OUTPUT and SOURCES
5053 # C_FLAGS -Werror
5056 # ${PROJECT_BINARY_DIR}/hello_world.llext, adding -Werror to the compilation.
5083 # Add user-visible target and dependency
5100 "$<FILTER:${zephyr_flags},EXCLUDE,${llext_remove_flags_regexp}>"
5125 # Arch-specific conversion of the object file to an llext
5131 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_OBJECTS:${target_name}_lib> ${output_file}
5147 -o ${pre_output_file}