diff --git a/app/src/main/jni/CMakeLists.txt b/app/src/main/jni/CMakeLists.txt index 1843035ff6..157f99410f 100644 --- a/app/src/main/jni/CMakeLists.txt +++ b/app/src/main/jni/CMakeLists.txt @@ -47,12 +47,9 @@ option(USE_SYSTEM_MARISA "" ON) add_subdirectory(OpenCC) include(OpenccWorkarounds) -include(RimePlugins) - set(X11Keysym "${CMAKE_SOURCE_DIR}/librime/include") include_directories("${X11Keysym}") -option(BUILD_TEST "" OFF) -add_subdirectory(librime) +include(Rime) add_subdirectory(librime_jni) diff --git a/app/src/main/jni/cmake/Rime.cmake b/app/src/main/jni/cmake/Rime.cmake new file mode 100644 index 0000000000..db3b68db99 --- /dev/null +++ b/app/src/main/jni/cmake/Rime.cmake @@ -0,0 +1,38 @@ +# if you want to add some new plugins, add them to librime_jni/rime_jni.cc too +set(RIME_PLUGINS + librime-lua + librime-charcode + librime-octagram + librime-predict +) + +# symlink plugins +foreach(plugin ${RIME_PLUGINS}) + execute_process(COMMAND ln -sv + "${CMAKE_SOURCE_DIR}/${plugin}" + "${CMAKE_SOURCE_DIR}/librime/plugins" + ) +endforeach() + +# librime-lua +file(REMOVE "${CMAKE_SOURCE_DIR}/librime/plugins/librime-lua/thirdparty") +execute_process(COMMAND ln -sv + "${CMAKE_SOURCE_DIR}/librime-lua-deps" + "${CMAKE_SOURCE_DIR}/librime/plugins/librime-lua/thirdparty" +) + +# librime-charcode +option(BUILD_WITH_ICU "" OFF) + +option(BUILD_TEST "" OFF) +option(BUILD_STATIC "" ON) +add_subdirectory(librime) + +target_link_libraries(rime-charcode-objs + Boost::asio + Boost::locale +) + +target_link_libraries(rime-lua-objs + Boost::optional +) diff --git a/app/src/main/jni/cmake/RimePlugins.cmake b/app/src/main/jni/cmake/RimePlugins.cmake deleted file mode 100644 index 8d371755ab..0000000000 --- a/app/src/main/jni/cmake/RimePlugins.cmake +++ /dev/null @@ -1,38 +0,0 @@ -# if you want to add some new plugins, add them to librime_jni/rime_jni.cc too -set(RIME_PLUGINS - librime-lua - librime-charcode - librime-octagram - librime-predict -) - -# plugins didn't use target_link_libraries, the usage-requirements won't work, include manually -find_package(Boost) -get_target_property(PLUGIN_INCLUDES Boost::boost - INTERFACE_INCLUDE_DIRECTORIES -) -include_directories(${PLUGIN_INCLUDES}) - -# move plugins -file(GLOB old_plugin_files "librime/plugins/*") -foreach(file ${old_plugin_files}) - if(IS_DIRECTORY ${file}) # plugin is directory - file(REMOVE "${file}") - endif() -endforeach() -foreach(plugin ${RIME_PLUGINS}) - execute_process(COMMAND ln -s - "${CMAKE_SOURCE_DIR}/${plugin}" - "${CMAKE_SOURCE_DIR}/librime/plugins" - ) -endforeach() - -# librime-lua -file(REMOVE "${CMAKE_SOURCE_DIR}/librime/plugins/librime-lua/thirdparty") -execute_process(COMMAND ln -s - "${CMAKE_SOURCE_DIR}/librime-lua-deps" - "${CMAKE_SOURCE_DIR}/librime/plugins/librime-lua/thirdparty" -) - -# librime-charcode -option(BUILD_WITH_ICU "" OFF)