diff --git a/doc/build/snippets/using.rst b/doc/build/snippets/using.rst index 608e2924302..74557ce7bff 100644 --- a/doc/build/snippets/using.rst +++ b/doc/build/snippets/using.rst @@ -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 ....)