mirror of
https://github.com/espressif/esp-idf.git
synced 2026-05-04 03:52:01 +02:00
Merge branch 'contrib/github_pr_11025' into 'master'
Enable support for C++23 in esp-idf (GitHub PR) Closes IDFGH-9684 See merge request espressif/esp-idf!23144
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user