Skip to content

Commit 37efbf8

Browse files
committed
fix(cmakev2/project): bump C and CXX standard
The cmakev1 bumped C and CXX standard to gnu23 and gnu++26, do the same in cmakev2. Signed-off-by: Frantisek Hrbata <[email protected]>
1 parent c98146a commit 37efbf8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/cmakev2/project.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function(__init_project_configuration)
128128
if(IDF_TARGET STREQUAL "linux")
129129
# Building for Linux target, fall back to an older version of the standard
130130
# if the preferred one is not supported by the compiler.
131-
set(preferred_c_versions gnu17 gnu11 gnu99)
131+
set(preferred_c_versions gnu23 gnu17 gnu11 gnu99)
132132
set(ver_found FALSE)
133133
foreach(c_version ${preferred_c_versions})
134134
check_c_compiler_flag("-std=${c_version}" ver_${c_version}_supported)
@@ -143,7 +143,7 @@ function(__init_project_configuration)
143143
"${preferred_c_versions}. Please upgrade the host compiler.")
144144
endif()
145145

146-
set(preferred_cxx_versions gnu++2b gnu++20 gnu++2a gnu++17 gnu++14)
146+
set(preferred_cxx_versions gnu++26 gnu++2b gnu++20 gnu++2a gnu++17 gnu++14)
147147
set(ver_found FALSE)
148148
foreach(cxx_version ${preferred_cxx_versions})
149149
check_cxx_compiler_flag("-std=${cxx_version}" ver_${cxx_version}_supported)
@@ -167,8 +167,8 @@ function(__init_project_configuration)
167167
# function, which must be called after project().
168168
# Please update docs/en/api-guides/c.rst, docs/en/api-guides/cplusplus.rst and
169169
# tools/test_apps/system/cxx_build_test/main/test_cxx_standard.cpp when changing this.
170-
list(APPEND c_compile_options "-std=gnu17")
171-
list(APPEND cxx_compile_options "-std=gnu++2b")
170+
list(APPEND c_compile_options "-std=gnu23")
171+
list(APPEND cxx_compile_options "-std=gnu++26")
172172
endif()
173173

174174
if(CONFIG_COMPILER_OPTIMIZATION_SIZE)

0 commit comments

Comments
 (0)