mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-21 09:11:49 +00:00
cmake: don't use target_compile_features when the CMake thinks the compiler does not support it
This happens when using an older CMake with a new LLVM toolchain (e.g. Android ndk)
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user