From 0a951c0d094990accf4921f20e7f76b5b3dc2cb9 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Fri, 11 Jun 2021 07:30:56 +0300
Subject: [PATCH] don't use add_compile_options for CFLAGS,
set CMAKE_C_FLAGS, instead.
see https://github.com/libsdl-org/sdl12-compat/issues/85#issuecomment-858932501
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 200acb6..1459c91 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,7 +39,7 @@ include("cmake/modules/FindSDL2.cmake")
target_include_directories(SDL PRIVATE ${SDL2_INCLUDE_DIRS})
if (CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
- add_compile_options(-Wall -Werror=declaration-after-statement) # force these universally.
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror=declaration-after-statement") # force these universally.
endif()
# avoid DLL having 'lib' prefix with Windows MinGW builds