Skip to content

Commit

Permalink
refactor: remove librime charcode plugin
Browse files Browse the repository at this point in the history
It's deprecated by upstream
  • Loading branch information
WhiredPlanck committed Dec 16, 2024
1 parent 793b121 commit 89cb040
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 29 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
[submodule "librime-octagram"]
path = app/src/main/jni/librime-octagram
url = https://github.com/lotem/librime-octagram.git
[submodule "librime-charcode"]
path = app/src/main/jni/librime-charcode
url = https://github.com/rime/librime-charcode
[submodule "librime-predict"]
path = app/src/main/jni/librime-predict
url = https://github.com/rime/librime-predict
Expand Down
14 changes: 6 additions & 8 deletions app/src/main/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,16 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
option(BUILD_SHARED_LIBS "" OFF)
option(BUILD_TESTING "" OFF)

# iconv for Boost::locale
include(Iconv)
# workaround for boost install
install(TARGETS iconv EXPORT boost_locale-targets)

include(Boost)

option(WITH_GFLAGS "Use gflags" OFF)
option(WITH_GTEST "Use googletest" OFF)
option(WITH_UNWIND "Enable libunwind support" OFF)
add_subdirectory(librime/deps/glog)
target_compile_options(glog_internal PRIVATE "-ffile-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.")
target_compile_definitions(glog PRIVATE GLOG_OS_ANDROID) # remove when glog 0.8.0
target_compile_options(
glog_internal PRIVATE "-ffile-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.")
target_compile_definitions(glog PRIVATE GLOG_OS_ANDROID) # remove when glog
# 0.8.0

option(YAML_CPP_BUILD_TOOLS "" OFF)
option(YAML_CPP_BUILD_TESTS "" OFF)
Expand All @@ -50,7 +47,8 @@ option(LEVELDB_INSTALL "" OFF)
add_subdirectory(librime/deps/leveldb)

add_subdirectory(librime/deps/marisa-trie)
target_compile_options(marisa PRIVATE "-ffile-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.")
target_compile_options(
marisa PRIVATE "-ffile-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.")

set(LIBMARISA marisa)
option(USE_SYSTEM_MARISA "" ON)
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/jni/cmake/Boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ set(BOOST_INCLUDE_LIBRARIES
scope_exit
signals2
utility
uuid
# librime-charcode
locale)
uuid)

add_subdirectory(boost EXCLUDE_FROM_ALL)
3 changes: 0 additions & 3 deletions app/src/main/jni/cmake/FindBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@ foreach(__lib ${__boost_installed_libs})
set(__full_dir "${CMAKE_SOURCE_DIR}/${__lib}/include")
list(APPEND Boost_INCLUDE_DIRS "${__full_dir}")
endforeach()

# for librime-charcode
set(Boost_LOCALE_LIBRARIES Boost::locale)
16 changes: 7 additions & 9 deletions app/src/main/jni/cmake/Rime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

# 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)
set(RIME_PLUGINS librime-lua librime-octagram librime-predict)

# symlink plugins
foreach(plugin ${RIME_PLUGINS})
Expand All @@ -20,16 +20,14 @@ if(NOT EXISTS "${CMAKE_SOURCE_DIR}/librime/plugins/librime-lua/thirdparty")
COPY_ON_ERROR SYMBOLIC)
endif()

# librime-charcode
option(BUILD_WITH_ICU "" OFF)

option(BUILD_TEST "" OFF)
option(BUILD_STATIC "" ON)
add_subdirectory(librime)
target_compile_options(rime-static PRIVATE "-ffile-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.")

target_link_libraries(rime-charcode-objs Boost::locale)
target_compile_options(
rime-static PRIVATE "-ffile-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.")

target_compile_options(rime-lua-objs PRIVATE "-ffile-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.")
target_compile_options(
rime-lua-objs PRIVATE "-ffile-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.")

target_compile_options(rime-octagram-objs PRIVATE "-ffile-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.")
target_compile_options(
rime-octagram-objs PRIVATE "-ffile-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.")
1 change: 0 additions & 1 deletion app/src/main/jni/librime-charcode
Submodule librime-charcode deleted from c202c8
2 changes: 0 additions & 2 deletions app/src/main/jni/librime_jni/rime_jni.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
#define MAX_BUFFER_LENGTH 2048

extern void rime_require_module_lua();
extern void rime_require_module_charcode();
extern void rime_require_module_octagram();
extern void rime_require_module_predict();
// librime is compiled as a static library, we have to link modules explicitly
static void declare_librime_module_dependencies() {
rime_require_module_lua();
rime_require_module_charcode();
rime_require_module_octagram();
rime_require_module_predict();
}
Expand Down

0 comments on commit 89cb040

Please sign in to comment.