mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
feat(examples): trim down the plugins example build
Set the COMPONENTS project variable to streamline the build process. Although the minimal build feature could be used to specify plugin components in the main component dependencies, it's more convenient to set the plugin components at the project level. This approach also allows for quick selection of which plugins to include in the application. Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
parent
e66e8a7a28
commit
c368f15328
@ -3,4 +3,6 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
# "Trim" the build. Include the minimal set of components, main, and plugins.
|
||||
set(COMPONENTS main plugin_hello plugin_nihao)
|
||||
project(plugins)
|
||||
|
@ -52,6 +52,14 @@ For each plugin, a structure describing the plugin (or a pointer to it) is place
|
||||
|
||||
## Example code overview
|
||||
|
||||
This example uses the optional `COMPONENTS` project variable to streamline the build process. By specifying components in this variable, only those components and their dependencies are linked to the application, reducing build time. Additionally, listing plugin components in the `COMPONENTS` variable ensures that only the specified plugins are linked. This approach provides a convenient way to quickly select the plugins to include in the application. The `COMPONENTS` variable is set in the project's CMakeLists.txt file:
|
||||
|
||||
```cmake
|
||||
set(COMPONENTS main plugin_hello plugin_nihao)
|
||||
```
|
||||
|
||||
For details about the `COMPONENTS` project variable, please refer to the Build System documentation.
|
||||
|
||||
This example contains 4 components:
|
||||
|
||||
* `main` — Only calls two sample functions defined in `plugins` component.
|
||||
|
Loading…
x
Reference in New Issue
Block a user