Skip to content

Commit

Permalink
librime and opencc share marisa
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Jul 10, 2023
1 parent a42f35e commit 28610ef
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
23 changes: 20 additions & 3 deletions opencc_patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9b3b15d..a939f2b 100644
index ee08591..526c2e1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -132,7 +132,9 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
@@ -125,6 +125,7 @@ add_definitions(
-DLOCALEDIR="${DIR_SHARE_LOCALE}"
-DVERSION="${OPENCC_VERSION}"
-DPACKAGE_NAME="${PACKAGE_NAME}"
+ -I"${CMAKE_CURRENT_SOURCE_DIR}/../../../build/sysroot/usr/local/include"
)

if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
@@ -132,7 +133,9 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
-std=c++14
-Wall
)
Expand All @@ -13,7 +21,7 @@ index 9b3b15d..a939f2b 100644
if (CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-O0 -g3)
endif ()
@@ -196,9 +198,11 @@ endif()
@@ -196,9 +199,11 @@ endif()
######## Subdirectories

add_subdirectory(src)
Expand All @@ -28,3 +36,12 @@ index 9b3b15d..a939f2b 100644

######## Testing

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c0a0b10..bbf3bc6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -185,4 +185,3 @@ endif()

# Subdir

-add_subdirectory(tools)
6 changes: 4 additions & 2 deletions scripts/build_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ popd
opencc_blddir=build/opencc_wasm
rm -rf $opencc_blddir
emcmake cmake librime/deps/opencc -B $opencc_blddir -G Ninja \
$CMAKE_DEF
$CMAKE_DEF \
-DCMAKE_FIND_ROOT_PATH:PATH=$root/build/sysroot/usr/local \
-DUSE_SYSTEM_MARISA:BOOL=ON
cmake --build $opencc_blddir
DESTDIR=$root/build/sysroot cmake --install $opencc_blddir

Expand All @@ -79,7 +81,7 @@ if [[ $ENABLE_LOGGING == 'ON' ]]; then
$CMAKE_DEF \
-DWITH_GFLAGS:BOOL=OFF \
-DWITH_UNWIND:BOOL=OFF
cmake --build $glog_blddir
cmake --build $glog_blddir
DESTDIR=$root/build/sysroot cmake --install $glog_blddir
fi

Expand Down

0 comments on commit 28610ef

Please sign in to comment.