Skip to content

Commit

Permalink
build: correct way to make opencc use prebuilt marisa on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Oct 21, 2023
1 parent eb6bd22 commit e139fd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 4 additions & 1 deletion build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,12 @@ if %build_deps% == 1 (

echo building opencc.
pushd deps\opencc
rem here we use python as a sed alternative, since it's easier to install and more convienient than powershell commands.
python -c "with open(r'%RIME_ROOT%\deps\opencc\CMakeLists.txt', 'w+') as f:;old = f.read();new = old.replace('find_library(LIBMARISA NAMES marisa)', 'find_package(marisa)\nset(LIBMARISA marisa)');f.write(new)"
cmake . -B%build_dir% %deps_cmake_flags%^
-DBUILD_TESTING=OFF^
-DUSE_SYSTEM_MARISA=ON
-DUSE_SYSTEM_MARISA=ON^
-Dmarisa_DIR="%RIME_ROOT%\lib\cmake\marisa"
if errorlevel 1 goto error
cmake --build %build_dir% --config %build_config% --target install
if errorlevel 1 goto error
Expand Down
4 changes: 0 additions & 4 deletions cmake/cxx_flag_overrides.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,4 @@ if(WIN32)
else()
set(CMAKE_CXX_FLAGS_RELEASE_INIT "-D_MT -O3 -DNDEBUG")
endif()
if(NOT MINGW)
include_directories("$ENV{RIME_ROOT}\\inclide")
link_directories("$ENV{RIME_ROOT}\\lib")
endif()
endif()

0 comments on commit e139fd1

Please sign in to comment.