docs: added new C++ language standard

This commit is contained in:
Jakob Hasse
2023-04-12 09:41:44 +08:00
parent 8f7a076619
commit 6991a92895
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -23,14 +23,14 @@ esp-idf-cxx Component
C++ language standard
---------------------
By default, ESP-IDF compiles C++ code with C++20 language standard with GNU extensions (``-std=gnu++20``).
By default, ESP-IDF compiles C++ code with C++23 language standard with GNU extensions (``-std=gnu++23``).
To compile the source code of a certain component using a different language standard, set the desired compiler flag in the component CMakeLists.txt file:
.. code-block:: cmake
idf_component_register( ... )
target_compile_options(${COMPONENT_LIB} PRIVATE -std=gnu++2b)
target_compile_options(${COMPONENT_LIB} PRIVATE -std=gnu++11)
Use ``PUBLIC`` instead of ``PRIVATE`` if the public header files of the component also need to be compiled with the same language standard.