diff --git a/CMakeLists.txt b/CMakeLists.txt index 74ed3a10d..5818a6e18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -372,14 +372,22 @@ if(SDL_SHARED) add_library(SDL3-shared SHARED) add_library(SDL3::SDL3-shared ALIAS SDL3-shared) SDL_AddCommonCompilerFlags(SDL3-shared) - target_compile_features(SDL3-shared PRIVATE c_std_99) + if ("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES) + target_compile_features(SDL3-shared PRIVATE c_std_99) + else() + message(WARNING "target_compile_features does not know c_std_99 for C compiler") + endif() endif() if(SDL_STATIC) add_library(SDL3-static STATIC) add_library(SDL3::SDL3-static ALIAS SDL3-static) SDL_AddCommonCompilerFlags(SDL3-static) - target_compile_features(SDL3-static PRIVATE c_std_99) + if ("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES) + target_compile_features(SDL3-static PRIVATE c_std_99) + else() + message(WARNING "target_compile_features does not know c_std_99 for C compiler") + endif() endif() if(SDL_TEST_LIBRARY)