cmake: add SDL_IBUS option to enable/disable DBUS + test sys/inotify.h

This commit is contained in:
Anonymous Maarten 2022-08-26 02:38:54 +02:00 committed by Sam Lantinga
parent c8b56ee5e6
commit 32c4996c04

View file

@ -446,6 +446,7 @@ set_option(SDL_DUMMYAUDIO "Support the dummy audio driver" ON)
set_option(SDL_DIRECTFB "Use DirectFB video driver" OFF)
dep_option(SDL_DIRECTFB_SHARED "Dynamically load directfb support" ON "SDL_DIRECTFB" OFF)
set_option(SDL_DUMMYVIDEO "Use dummy video driver" ON)
dep_option(SDL_IBUS "Enable IBus support" ON ${UNIX_SYS} OFF)
set_option(SDL_OPENGL "Include OpenGL support" ON)
set_option(SDL_OPENGLES "Include OpenGL ES support" ON)
set_option(SDL_PTHREADS "Use POSIX threads for multi-threading" ${SDL_PTHREADS_ENABLED_BY_DEFAULT})
@ -1443,10 +1444,14 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
endif()
endif()
pkg_search_module(IBUS ibus-1.0 ibus)
if(IBUS_FOUND)
set(HAVE_IBUS_IBUS_H TRUE)
target_include_directories(sdl-build-options INTERFACE "${IBUS_INCLUDE_DIRS}")
if(SDL_IBUS)
pkg_search_module(IBUS ibus-1.0 ibus)
find_path(HAVE_SYS_INOTIFY_H NAMES sys/inotify.h)
if(IBUS_FOUND AND HAVE_SYS_INOTIFY_H)
set(HAVE_IBUS_IBUS_H TRUE)
target_include_directories(sdl-build-options INTERFACE "${IBUS_INCLUDE_DIRS}")
set(HAVE_IBUS TRUE)
endif()
endif()
if (HAVE_IBUS_IBUS_H OR HAVE_FCITX)