From e7e333e7727a2084a60401c7b64e1b1148288d0d Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sun, 20 Oct 2024 14:33:50 +0300
Subject: [PATCH] cmake: require C99 for example programs, as they use C99
features.
---
CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09717ce6..131ec3fb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -380,6 +380,9 @@ if(SDLTTF_SAMPLES)
sdl_add_warning_options(${prog} WARNING_AS_ERROR ${SDLTTF_WERROR})
target_link_libraries(${prog} PRIVATE SDL3_ttf::${sdl3_ttf_target_name})
target_link_libraries(${prog} PRIVATE ${sdl3_target_name})
+ if("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES)
+ target_compile_features(${prog} PRIVATE c_std_99)
+ endif()
if(SDLTTF_SAMPLES_INSTALL)
install(TARGETS ${prog}