Browse Source

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.
Sam Lantinga 6 years ago
parent
commit
e9ec7d41b3
3 changed files with 3 additions and 2 deletions
  1. 1 0
      CMakeLists.txt
  2. 1 1
      configure
  3. 1 1
      configure.ac

+ 1 - 0
CMakeLists.txt

@@ -1114,6 +1114,7 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID)
         set(HAVE_IBUS_IBUS_H TRUE)
         set(HAVE_IBUS_IBUS_H TRUE)
         include_directories(${IBUS_INCLUDE_DIRS})
         include_directories(${IBUS_INCLUDE_DIRS})
         list(APPEND EXTRA_LIBS ${IBUS_LIBRARIES})
         list(APPEND EXTRA_LIBS ${IBUS_LIBRARIES})
+        add_definitions(-DSDL_USE_IME)
       endif()
       endif()
       if(HAVE_LIBUNWIND_H)
       if(HAVE_LIBUNWIND_H)
         # We've already found the header, so REQUIRE the lib to be present
         # We've already found the header, so REQUIRE the lib to be present

+ 1 - 1
configure

@@ -22731,7 +22731,7 @@ fi
 
 
 $as_echo "#define SDL_USE_IME 1" >>confdefs.h
 $as_echo "#define SDL_USE_IME 1" >>confdefs.h
 
 
-            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
+        SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
     fi
     fi
 }
 }
 
 

+ 1 - 1
configure.ac

@@ -2602,7 +2602,7 @@ AS_HELP_STRING([--enable-ime], [enable IME support [[default=yes]]]),
                   , enable_ime=yes)
                   , enable_ime=yes)
     if test x$enable_ime = xyes; then
     if test x$enable_ime = xyes; then
         AC_DEFINE(SDL_USE_IME, 1, [ ])
         AC_DEFINE(SDL_USE_IME, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
+        SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
     fi
     fi
 }
 }