fix: adjust C standard preferences for Linux target

In commit 70407df8c2 ("fix(build): don't call enable_language() before
proje.."), the C standard preferences were mistakenly changed to
`set(preferred_c_versions gnu99 gnu17 gnu11 gnu99)`. This was likely an
oversight from my testing. This corrects the C standard preferences to
the intended order.

Fixes: 70407df8c2 ("fix(build): don't call enable_language() before proje..")
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
Frantisek Hrbata
2025-03-10 08:57:10 +01:00
committed by BOT
parent 14908c9a2c
commit d20a5fd939

View File

@@ -179,7 +179,7 @@ function(__linux_build_set_lang_version)
# Building for Linux target, fall back to an older version of the standard
# if the preferred one is not supported by the compiler.
set(preferred_c_versions gnu99 gnu17 gnu11 gnu99)
set(preferred_c_versions gnu17 gnu11 gnu99)
set(ver_found FALSE)
foreach(c_version ${preferred_c_versions})
check_c_compiler_flag("-std=${c_version}" ver_${c_version}_supported)