From cedd825dc0328049ab9395cbe4957e225c129898 Mon Sep 17 00:00:00 2001 From: WhiredPlanck Date: Fri, 20 Oct 2023 23:50:45 +0800 Subject: [PATCH] build: correct way to make opencc use prebuilt marisa on Windows Co-authored-by: Ace-Who --- build.bat | 5 ++++- cmake/cxx_flag_overrides.cmake | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/build.bat b/build.bat index 8ca02ab86f..ef29843181 100644 --- a/build.bat +++ b/build.bat @@ -166,9 +166,12 @@ if %build_deps% == 1 ( echo building opencc. pushd deps\opencc + powershell -c "if (($Content = gc %RIME_ROOT%\deps\opencc\CMakeLists.txt)[212] -match ' find_library\(LIBMARISA NAMES marisa\)') { $Content[212] = ' find_package(marisa)', ' set(LIBMARISA marisa)' }; $Content > %RIME_ROOT%\deps\opencc\CMakeLists.txt" + powershell -c "gc %RIME_ROOT%\deps\opencc\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 diff --git a/cmake/cxx_flag_overrides.cmake b/cmake/cxx_flag_overrides.cmake index aef3800a46..9f4fc5d4ca 100644 --- a/cmake/cxx_flag_overrides.cmake +++ b/cmake/cxx_flag_overrides.cmake @@ -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()