cmake: Sync build config options with autotools

- SDL_CLOCK_GETTIME now defaults to ON to match autotools build
- Add detection of float.h and Xdbe
- Fix detection of pthread_setname_np() (requires _GNU_SOURCE)
- Move SDL_USE_IME definition into SDL_config.h.cmake
This commit is contained in:
Cameron Gutman
2021-11-16 17:59:38 -06:00
committed by Sam Lantinga
parent 7d3045f273
commit 43d1b42a5a
3 changed files with 20 additions and 6 deletions

View File

@@ -395,10 +395,10 @@ dep_option(SDL_FUSIONSOUND_SHARED "Dynamically load fusionsound audio support"
set_option(SDL_LIBSAMPLERATE "Use libsamplerate for audio rate conversion" ${UNIX_SYS})
dep_option(SDL_LIBSAMPLERATE_SHARED "Dynamically load libsamplerate" ON "SDL_LIBSAMPLERATE" OFF)
set_option(SDL_RPATH "Use an rpath when linking SDL" ${UNIX_SYS})
set_option(SDL_CLOCK_GETTIME "Use clock_gettime() instead of gettimeofday()" OFF)
set_option(SDL_CLOCK_GETTIME "Use clock_gettime() instead of gettimeofday()" ${UNIX_SYS})
set_option(SDL_X11 "Use X11 video driver" ${UNIX_SYS})
dep_option(SDL_X11_SHARED "Dynamically load X11 support" ON "SDL_X11" OFF)
set(SDL_X11_OPTIONS Xcursor Xinerama XInput Xfixes Xrandr Xscrnsaver XShape Xvm)
set(SDL_X11_OPTIONS Xcursor Xdbe Xinerama XInput Xfixes Xrandr Xscrnsaver XShape Xvm)
foreach(_SUB ${SDL_X11_OPTIONS})
string(TOUPPER "SDL_X11_${_SUB}" _OPT)
dep_option(${_OPT} "Enable ${_SUB} support" ON "SDL_X11" OFF)
@@ -836,7 +836,7 @@ if(SDL_LIBC)
set(HAVE_LIBC TRUE)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
foreach(_HEADER
stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h limits.h
stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h limits.h float.h
strings.h wchar.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h libunwind.h)
string(TOUPPER "HAVE_${_HEADER}" _UPPER)
string(REPLACE "." "_" _HAVE_H ${_UPPER})
@@ -1319,8 +1319,7 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT RISCOS AND NOT HAIKU)
endif()
if (HAVE_IBUS_IBUS_H OR HAVE_FCITX)
set(SDL_USE_IME TRUE)
target_compile_definitions(sdl-build-options INTERFACE "-DSDL_USE_IME") # !!! FIXME: why isn't this a definition and not in SDL_config.h.cmake?
set(SDL_USE_IME 1)
endif()
if(FREEBSD AND NOT HAVE_INOTIFY)