Skip to content

Commit 8923108

Browse files
tejlmandnashif
authored andcommitted
doc: modules guide updated with Zephyr CMake lists description
This commit extends the `Build system integration` section in the Zephyr modules guide with a description on how a module may append additional values to Zephyr CMake lists. This is useful for modules that might need to append values to the `SYSCALL_INCLUDE_DIRS` list. This commit is followup to the discussion found in: #33756 Signed-off-by: Torsten Rasmussen <[email protected]> Signed-off-by: Marti Bolivar <[email protected]>
1 parent 3c0e7ad commit 8923108

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

doc/guides/modules.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,20 @@ variables. For example:
530530
531531
include(${ZEPHYR_CURRENT_MODULE_DIR}/cmake/code.cmake)
532532
533+
It is possible to append values to a Zephyr CMake list variable from the module's first
534+
CMakeLists.txt file.
535+
To do so, append the value to the list and then set the list in the PARENT_SCOPE
536+
of the CMakeLists.txt file. For example, to append ``bar`` to the ``FOO_LIST`` variable in the
537+
Zephyr CMakeLists.txt scope:
538+
539+
.. code-block:: cmake
540+
541+
list(APPEND FOO_LIST bar)
542+
set(FOO_LIST ${FOO_LIST} PARENT_SCOPE)
543+
544+
An example of a Zephyr list where this is useful is when adding additional
545+
directories to the ``SYSCALL_INCLUDE_DIRS`` list.
546+
533547
Zephyr module dependencies
534548
==========================
535549

0 commit comments

Comments
 (0)