-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build.bat, appveyor): upgrade to Visual Studio 2017
- Loading branch information
Showing
5 changed files
with
61 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,75 @@ | ||
Rime with Windows | ||
=== | ||
# Rime with Windows | ||
|
||
## Prerequisites | ||
|
||
`librime` is tested to work on Windows with the following combinations of build | ||
tools and libraries: | ||
|
||
- Visual Studio 2017 | ||
- [Boost](http://www.boost.org/)=1.64 | ||
- [cmake](http://www.cmake.org/)>=3.8 | ||
|
||
and | ||
|
||
Prerequisites | ||
--- | ||
librime is tested to work on Windows with the following build tools and libraries: | ||
- Visual Studio 2015 | ||
- [Boost](http://www.boost.org/)>=1.60 | ||
- [cmake](http://www.cmake.org/)>=2.8 | ||
[Python](https://python.org)>=2.7 is needed to build opencc dictionaries. | ||
- [Boost](http://www.boost.org/)=1.60 | ||
- [cmake](http://www.cmake.org/)>=3.8 | ||
|
||
Boost and cmake versions need to match higher VS version. | ||
|
||
You may need to update Boost when using a higher version of VS. | ||
[Python](https://python.org)>=2.7 is needed to build opencc dictionaries. | ||
|
||
You can also build third-party libraries manually, by following instructions in the build script. | ||
## Get the code | ||
|
||
Get the code | ||
--- | ||
``` batch | ||
git clone --recursive https://github.com/rime/librime.git | ||
``` | ||
or [download from GitHub](https://github.com/rime/librime). | ||
|
||
Setup a build environment | ||
--- | ||
Copy `env.bat.template` to `env.bat` and edit the script according to your setup. | ||
Specifically, make sure `BOOST_ROOT` is set to the path to Boost source directory; | ||
modify `CMAKE_GENERATOR` and `PLATFORM_TOOLSET` if using a different version of Visual Studio; | ||
set `DEVTOOLS_PATH` for build tools installed to a custom location. | ||
## Setup a build environment | ||
|
||
Copy `env.bat.template` to `env.bat` and edit the file according to your setup. | ||
Specifically, make sure `BOOST_ROOT` is set to the root directory of Boost | ||
source tree; modify `BJAM_TOOLSET`, `CMAKE_GENERATOR` and `PLATFORM_TOOLSET` if | ||
using a different version of Visual Studio; also set `DEVTOOLS_PATH` for build | ||
tools installed to custom location. | ||
|
||
When prepared, run the following commands in a Developer Command Prompt window. | ||
When prepared, do the following in a *Developer Command Prompt* window. | ||
|
||
## Build Boost | ||
|
||
Build Boost | ||
--- | ||
``` batch | ||
build.bat boost | ||
``` | ||
|
||
Build third-party libraries | ||
--- | ||
## Build third-party libraries | ||
|
||
``` batch | ||
build.bat thirdparty | ||
``` | ||
This builds dependent libraries in `thirdparty\src\*`, and copies artifacts to `thirdparty\lib` and `thirdparty\bin`. | ||
This builds dependent libraries in `thirdparty\src\*`, and copies artifacts to | ||
`thirdparty\lib` and `thirdparty\bin`. | ||
|
||
## Build librime | ||
|
||
Build librime | ||
--- | ||
``` batch | ||
build.bat librime | ||
``` | ||
This creates `build\lib\Release\rime.dll`. | ||
|
||
Try it in the console | ||
--- | ||
Build artifacts - the shared library along with API headers and supporting files | ||
are gathered in `dist` directory. | ||
|
||
## Try it in the console | ||
|
||
`librime` comes with a REPL application which can be used to test if the library | ||
is working. | ||
|
||
``` batch | ||
copy /Y build\lib\Release\rime.dll build\bin | ||
cd build\bin | ||
echo "congmingdeRime{space}shurufa" | Release\rime_api_console.exe > output.txt | ||
echo congmingdeRime{space}shurufa | Release\rime_api_console.exe > output.txt | ||
``` | ||
|
||
Instead of redirecting output to a file, you can set appropriate code page | ||
(`chcp 65001`) and font in the console to work with the REPL interactively. |
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 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 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 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