Skip to content

Commit 97b93a8

Browse files
committed
Fixed bug 4354 - CMake builds do not correctly enable IME on Linux
Callum McGing While the CMake build checks for ibus and does enable the ibus backend with set(HAVE_IBUS_IBUS_H TRUE), this does not define SDL_USE_IME, thus CMake built SDL2 (as in Arch Linux) cannot use IME at all. The attached patch fixes this behaviour when building against ibus. IME support will still fail when only fcitx is available on the build system.
1 parent 01075dc commit 97b93a8

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,7 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID)
11141114
set(HAVE_IBUS_IBUS_H TRUE)
11151115
include_directories(${IBUS_INCLUDE_DIRS})
11161116
list(APPEND EXTRA_LIBS ${IBUS_LIBRARIES})
1117+
add_definitions(-DSDL_USE_IME)
11171118
endif()
11181119
if(HAVE_LIBUNWIND_H)
11191120
# We've already found the header, so REQUIRE the lib to be present

configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -22731,7 +22731,7 @@ fi
2273122731

2273222732
$as_echo "#define SDL_USE_IME 1" >>confdefs.h
2273322733

22734-
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
22734+
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
2273522735
fi
2273622736
}
2273722737

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -2602,7 +2602,7 @@ AS_HELP_STRING([--enable-ime], [enable IME support [[default=yes]]]),
26022602
, enable_ime=yes)
26032603
if test x$enable_ime = xyes; then
26042604
AC_DEFINE(SDL_USE_IME, 1, [ ])
2605-
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
2605+
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
26062606
fi
26072607
}
26082608

0 commit comments

Comments
 (0)