Skip to content

Commit

Permalink
doc: build: snippets: application required snippets
Browse files Browse the repository at this point in the history
Document how an application can automatically include snippets when
being built.

Signed-off-by: Jordan Yates <[email protected]>
  • Loading branch information
Jordan Yates authored and carlescufi committed Feb 14, 2024
1 parent ef8e325 commit d323aca
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions doc/build/snippets/using.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,17 @@ snippet names you want to use. For example:
cmake -Sapp -Bbuild -DSNIPPET="snippet1;snippet2" [...]
cmake --build build
Application required snippets
*****************************

If an application should always be compiled with a given snippet, it
can be added to that application's ``CMakeLists.txt`` file. For example:

.. code-block:: cmake
if(NOT snippet1 IN_LIST SNIPPET)
set(SNIPPET snippet1 ${SNIPPET} CACHE STRING "" FORCE)
endif()
find_package(Zephyr ....)

0 comments on commit d323aca

Please sign in to comment.