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
Co-authored-by: Ace-Who <[email protected]>
  • Loading branch information
WhiredPlanck and Ace-Who committed Oct 22, 2023
1 parent 90e1921 commit 8edbb87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 3 additions & 1 deletion build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,11 @@ if %build_deps% == 1 (

echo building opencc.
pushd deps\opencc
powershell -c "$Content = Get-Content -Path CMakeLists.txt; if ($Content[212] -match 'find_library\(LIBMARISA NAMES marisa\)') { $Content[212] = ' find_package(marisa)', ' set(LIBMARISA marisa)' } ; Set-Content -Value $Content -Path CMakeLists.txt"
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 8edbb87

Please sign in to comment.