-
Notifications
You must be signed in to change notification settings - Fork 568
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: try to merge build.bat and build-clang.bat * build: correct way to make opencc use prebuilt marisa on Windows Co-authored-by: Ace-Who <[email protected]> * build: slightly refactor to cmake user make rules * deps: pick the latest marisa to fix include dir issue --------- Co-authored-by: Ace-Who <[email protected]>
- Loading branch information
1 parent
1c78709
commit 78587b8
Showing
5 changed files
with
28 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@echo off | ||
rem Rime build script for msvc toolchain. | ||
rem Rime build script for Windows platform. | ||
rem Maintainer: Chen Gong <[email protected]> | ||
|
||
setlocal | ||
|
@@ -100,23 +100,25 @@ if defined ARCH ( | |
if defined PLATFORM_TOOLSET ( | ||
set common_cmake_flags=%common_cmake_flags% -T%PLATFORM_TOOLSET% | ||
) | ||
|
||
set common_cmake_flags=%common_cmake_flags%^ | ||
-DCMAKE_CONFIGURATION_TYPES:STRING="%build_config%"^ | ||
-DCMAKE_BUILD_TYPE:STRING="%build_config%"^ | ||
-DCMAKE_USER_MAKE_RULES_OVERRIDE:PATH="%RIME_ROOT%\cmake\c_flag_overrides.cmake"^ | ||
-DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX:PATH="%RIME_ROOT%\cmake\cxx_flag_overrides.cmake"^ | ||
-DCMAKE_EXE_LINKER_FLAGS_INIT:STRING="-llibcmt"^ | ||
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>" | ||
|
||
set deps_cmake_flags=%common_cmake_flags%^ | ||
-DCMAKE_CONFIGURATION_TYPES:STRING="%build_config%"^ | ||
-DCMAKE_BUILD_TYPE:STRING="%build_config%"^ | ||
-DCMAKE_CXX_FLAGS_RELEASE:STRING="/MT /O2 /Ob2 /DNDEBUG"^ | ||
-DCMAKE_C_FLAGS_RELEASE:STRING="/MT /O2 /Ob2 /DNDEBUG"^ | ||
-DCMAKE_CXX_FLAGS_DEBUG:STRING="/MTd /Od"^ | ||
-DCMAKE_C_FLAGS_DEBUG:STRING="/MTd /Od"^ | ||
-DCMAKE_INSTALL_PREFIX:PATH="%RIME_ROOT%" | ||
-DBUILD_SHARED_LIBS:BOOL=OFF^ | ||
-DCMAKE_INSTALL_PREFIX:PATH="%RIME_ROOT%" | ||
|
||
if %build_deps% == 1 ( | ||
echo building glog. | ||
pushd deps\glog | ||
cmake . -B%build_dir% %deps_cmake_flags%^ | ||
-DBUILD_SHARED_LIBS:BOOL=OFF^ | ||
-DBUILD_TESTING:BOOL=OFF^ | ||
-DWITH_GFLAGS:BOOL=OFF^ | ||
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>" | ||
-DWITH_GFLAGS:BOOL=OFF | ||
if errorlevel 1 goto error | ||
cmake --build %build_dir% --config %build_config% --target install | ||
if errorlevel 1 goto error | ||
|
@@ -164,9 +166,11 @@ if %build_deps% == 1 ( | |
|
||
echo building opencc. | ||
pushd deps\opencc | ||
powershell -NoProfile -c "$Content = gc CMakeLists.txt; if ($Content[212] -match ' find_library\(LIBMARISA NAMES marisa\)') { $Content[212] = ' find_package(marisa)', ' set(LIBMARISA marisa)'; } sc CMakeLists.txt $Content" | ||
cmake . -B%build_dir% %deps_cmake_flags%^ | ||
-DBUILD_SHARED_LIBS=OFF^ | ||
-DBUILD_TESTING=OFF | ||
-DBUILD_TESTING=OFF^ | ||
-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 | ||
|
@@ -180,8 +184,6 @@ set rime_cmake_flags=%common_cmake_flags%^ | |
-DBUILD_SHARED_LIBS=%build_shared%^ | ||
-DBUILD_TEST=%build_test%^ | ||
-DENABLE_LOGGING=%enable_logging%^ | ||
-DCMAKE_CONFIGURATION_TYPES="%build_config%"^ | ||
-DCMAKE_BUILD_TYPE:STRING="%build_config%"^ | ||
-DCMAKE_INSTALL_PREFIX:PATH="%RIME_ROOT%\dist" | ||
|
||
echo on | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters