Skip to content

Commit

Permalink
build(jni): try to improve the build of rime and its plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Nov 17, 2023
1 parent 64b4913 commit 5350f8e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 42 deletions.
5 changes: 1 addition & 4 deletions app/src/main/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
38 changes: 38 additions & 0 deletions app/src/main/jni/cmake/Rime.cmake
Original file line number Diff line number Diff line change
@@ -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
)
38 changes: 0 additions & 38 deletions app/src/main/jni/cmake/RimePlugins.cmake

This file was deleted.

0 comments on commit 5350f8e

Please sign in to comment.