From 9b140d08d72b52915ddf1974342af06c6b93e06d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 7 Oct 2020 21:40:16 +0200 Subject: [PATCH] Remove ignored Clang compiler flag Clang ignores this when C99 is enabled, while GCC does not. Removing the checks for Clang to hopefully avoid a false sense of security. --- src/CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b47b2354..e2b86412 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -121,18 +121,20 @@ if (APPLE) LANGUAGE C) endif() -if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR - "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR - "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") - - # Make GCC and Clang warn about declarations that VS 2010 and 2012 won't - # accept for all source files that VS will build +# Make GCC warn about declarations that VS 2010 and 2012 won't accept for all +# source files that VS will build (Clang ignores this because we set -std=c99) +if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") set_source_files_properties(context.c init.c input.c monitor.c vulkan.c window.c win32_init.c win32_joystick.c win32_monitor.c win32_time.c win32_thread.c win32_window.c wgl_context.c egl_context.c osmesa_context.c PROPERTIES COMPILE_FLAGS -Wdeclaration-after-statement) +endif() + +if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR + "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR + "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") # Enable a reasonable set of warnings (no, -Wextra is not reasonable) target_compile_options(glfw PRIVATE "-Wall")