EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1291 background imageLoading...
Page #1291 background image
Chapter 4. API Guides
idf_component_register(SRCS "engine.c"
INCLUDE_DIRS "include"
PRIV_REQUIRES spark_plug)
As a result, source files in the car component dont need the spark_plug include directories added to their
compiler search path. This can speed up compilation, and stops compiler command lines from becoming longer than
necessary.
Spark Plug Component The spark_plug component doesnt depend on anything else. It has a public header
file spark_plug.h, but this doesnt include headers from any other components.
This means that the spark_plug/CMakeLists.txt file doesnt need any REQUIRES or PRIV_REQUIRES
clauses:
idf_component_register(SRCS "spark_plug.c"
INCLUDE_DIRS ".")
Source File Include Directories
Each components source file is compiled with these include path directories, as specified in the passed arguments
to idf_component_register:
idf_component_register(..
INCLUDE_DIRS "include"
PRIV_INCLUDE_DIRS "other")
The current components INCLUDE_DIRS and PRIV_INCLUDE_DIRS.
The INCLUDE_DIRS belonging to all other components listed in the REQUIRES and PRIV_REQUIRES
parameters (ie all the current components public and private dependencies).
Recursively, all of the INCLUDE_DIRS of those components REQUIRES lists (ie all public dependencies of
this components dependencies, recursively expanded).
Main component requirements
The component named main is special because it automatically requires all other components in the build. So its
not necessary to pass REQUIRES or PRIV_REQUIRES to this component. See renaming main for a description of
what needs to be changed if no longer using the main component.
Common component requirements
To avoid duplication, every component automatically requires some commonIDF components even if they are
not mentioned explicitly. Headers from these components can always be included.
The list of common components is: cxx, newlib, freertos, esp_hw_support, heap, log, lwip, soc, hal, esp_rom,
esp_common, esp_system.
Including components in the build
By default, every component is included in the build.
If you set the COMPONENTS variable to a minimal list of components used directly by your project, then the
build will expand to also include required components. The full list of components will be:
Components mentioned explicitly in COMPONENTS.
Those componentsrequirements (evaluated recursively).
The commoncomponents that every component depends on.
Setting COMPONENTS to the minimal list of required components can significantly reduce compile times.
Espressif Systems 1280
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish