Suppress -Wdeprecated-declarations for macOS (#1627)

Xcode 14 deprecated functions such as `sprintf` which is used in many
places.  As an immediate fix for the pre-commit checks, disable
deprecated function warnings when building for macOS.

Contributes to https://github.com/KhronosGroup/OpenCL-CTS/issues/1626

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2023-01-27 13:34:50 +00:00
committed by GitHub
parent afdd8b0058
commit 9eec8f3352

View File

@@ -126,6 +126,12 @@ macro(set_gnulike_module_compile_flags flags)
endif() endif()
endmacro(set_gnulike_module_compile_flags) endmacro(set_gnulike_module_compile_flags)
# Xcode 14.1 deprecated functions such as sprintf.
# Suppress such warnings for now, see Issue #1626
if(APPLE)
add_cxx_flag_if_supported(-Wno-deprecated-declarations)
endif(APPLE)
if(MSVC) if(MSVC)
# Don't warn when using standard non-secure functions. # Don't warn when using standard non-secure functions.
add_compile_definitions(_CRT_SECURE_NO_WARNINGS) add_compile_definitions(_CRT_SECURE_NO_WARNINGS)