From 9eec8f3352bee4f69be1dd1944b5b4d63fc82b68 Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Fri, 27 Jan 2023 13:34:50 +0000 Subject: [PATCH] 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 --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98aeb9c2..f20e346e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,6 +126,12 @@ macro(set_gnulike_module_compile_flags flags) endif() 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) # Don't warn when using standard non-secure functions. add_compile_definitions(_CRT_SECURE_NO_WARNINGS)