From 65180804c46c54080442ebda66566e134e895232 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 23 May 2023 17:23:30 -0700 Subject: [PATCH] Disable unused local typedefs warning This triggers on gcc 4.8.4 for compile time asserts inside of functions Fixes https://github.com/libsdl-org/SDL/issues/7732 --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 003b7bce6..76211e19b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -675,6 +675,11 @@ if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC) target_compile_options(sdl-global-options INTERFACE "-Wshadow") endif() + check_c_compiler_flag(-Wunused-local-typedefs HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS) + if(HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS) + target_compile_options(sdl-global-options INTERFACE "-Wno-unused-local-typedefs") + endif() + if(APPLE) cmake_push_check_state() # FIXME: don't use deprecated declarations