Skip to content

Commit 768f130

Browse files
committed
WIP: Build Rust version of libchewing
Signed-off-by: Hui-Hong You <hiroshi@ghostsinthelab.org>
1 parent 8d37dd6 commit 768f130

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ The libchewingAndroidAppModule is a byproduct of the [Guileless Bopomofo](https:
66

77
libchewingAndroidAppModule 是[樸實注音鍵盤](https://github.com/hiroshiyui/GuilelessBopomofo)專案的副產品,將[新酷音函式庫](https://github.com/chewing/libchewing)打包為 Android App Module (AAR) 格式,透過模組化途徑方便開發與元件再利用。
88

9+
# Prerequisites for Rust targets 編譯 Rust 程式碼的必備項目
10+
11+
* [rustup](https://rustup.rs/) - installer for the systems programming language Rust
12+
* `rustup target add aarch64-linux-android`
13+
* `rustup target add armv7-linux-androideabi`
14+
* `rustup target add i686-linux-android`
15+
* `rustup target add x86_64-linux-android`
16+
917
# Build 組建
1018

1119
1. `git clone --recursive https://github.com/hiroshiyui/libchewingAndroidAppModule.git`

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ android {
7979

8080
tasks.register<Exec>("prepareChewing") {
8181
workingDir(chewingLibraryPath)
82-
commandLine("cmake", "--preset", "c99-release", "-DBUILD_SHARED_LIBS=OFF", ".")
82+
commandLine("cmake", "--preset", "rust-release", "-DBUILD_SHARED_LIBS=OFF", ".")
8383
}
8484

8585
val chewingDataFiles =
86-
listOf<String>("dictionary.dat", "index_tree.dat", "pinyin.tab", "swkb.dat", "symbols.dat")
86+
listOf<String>("tsi.dat", "word.dat", "pinyin.tab", "swkb.dat", "symbols.dat")
8787

8888
tasks.register<Exec>("buildChewingData") {
8989
dependsOn("prepareChewing")

app/src/main/cpp/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ project("libchewing_android_app_module" LANGUAGES C CXX)
1414

1515
# Import libchewing here:
1616
SET(BUILD_INFO true)
17-
SET(WITH_RUST false)
18-
SET(WITH_SQLITE3 true)
17+
SET(WITH_RUST true)
18+
SET(WITH_SQLITE3 false)
1919
SET(BUILD_SHARED_LIBS OFF)
2020
add_subdirectory(${CMAKE_SOURCE_DIR}/libs/libchewing EXCLUDE_FROM_ALL)
2121

0 commit comments

Comments
 (0)