cmake: compiler: Check -fno-printf-return-value before using

GCC versions before 7.1.0 do not have the -fno-printf-return-value flag and
give an error if it is used. This patch improves compatibility with older
compilers by making CMake check for the flag's availability before using.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
This commit is contained in:
Joel Holdsworth 2025-01-14 14:55:27 -08:00 committed by Benjamin Cabé
commit 8b59dcfd11

View file

@ -121,7 +121,7 @@ if (NOT CONFIG_NEWLIB_LIBC AND
set_compiler_property(APPEND PROPERTY nostdinc_include ${NOSTDINC}) set_compiler_property(APPEND PROPERTY nostdinc_include ${NOSTDINC})
endif() endif()
set_compiler_property(PROPERTY no_printf_return_value -fno-printf-return-value) check_set_compiler_property(PROPERTY no_printf_return_value -fno-printf-return-value)
set_property(TARGET compiler-cpp PROPERTY nostdincxx "-nostdinc++") set_property(TARGET compiler-cpp PROPERTY nostdincxx "-nostdinc++")