cmake: do all compile tests with -D_GNU_SOURCE=1

This commit is contained in:
Anonymous Maarten 2023-01-08 18:45:59 +01:00 committed by Anonymous Maarten
parent ac99db9fc8
commit 61f76efb85
1 changed files with 4 additions and 3 deletions

View File

@ -131,16 +131,17 @@ else()
set(PROCESSOR_ARCH "x86")
endif()
# Get the platform
SDL_DetectCMakePlatform()
set(SDL_CHECK_REQUIRED_INCLUDES "" CACHE STRING "Extra includes (for CMAKE_REQUIRED_INCLUDES)")
set(SDL_CHECK_REQUIRED_LINK_OPTIONS "" CACHE STRING "Extra link options (for CMAKE_REQUIRED_LINK_OPTIONS)")
mark_as_advanced(SDL_CHECK_REQUIRED_INCLUDES SDL_CHECK_REQUIRED_LINK_OPTIONS)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_GNU_SOURCE=1")
list(APPEND CMAKE_REQUIRED_INCLUDES ${SDL_CHECK_REQUIRED_INCLUDES})
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS ${SDL_CHECK_REQUIRED_LINK_OPTIONS})
# Get the platform
SDL_DetectCMakePlatform()
# Don't mistake macOS for unix
if(UNIX AND NOT ANDROID AND NOT APPLE AND NOT RISCOS)
set(UNIX_SYS ON)