Assume we already have a default installation of Visual Studio 2015.
Install dev tools: git
, cmake
Download third-party libraries: boost(>=1.60.0)
Make sure you also checkout submodules brise
and librime
under weasel
directory.
git clone --recursive https://github.com/rime/weasel.git
If you want to build Weasel in minimal steps, jump to [this section] (#build-and-install-weasel).
This section guides you to build librime, the core input method library used by Weasel.
To be verbose, you'll get the following binaries as the build output of librime, as well as its dependent third-party libraries including boost, glog, marisa-trie, leveldb, opencc, yaml-cpp.
librime\build\lib\Release\rime.dll
/rime.lib
thirdparty\bin\libglog.dll
thirdparty\bin\opencc.dll
If you've already got a copy of prebuilt binaries of librime,
you can simply copy .dll
s / .lib
s into weasel\output
/ weasel\lib
directories respectively.
Then go straight to building Weasel.
Edit librime\env.bat.template
, save your copy as librime\env.bat
.
Make sure BOOST_ROOT
is set to \path\to\boost_1_57_0
in librime\env.bat
.
Then, start VC command line tools from librime\shell.bat
.
At the command prompt, enter the following command:
rem cd librime
rem shell.bat
build.bat boost thirdparty librime
With some luck, you now have a copy of the built library in librime\build\lib\Release
:
- shared library -
rime.dll
/rime.lib
, these will be used by Weasel - static library -
librime.lib
, if built withbuild.bat static
Rime comes with a REPL application by which you can test if the library is working.
Windows command line does not use UTF-8 character encoding, thus we save the output to a file.
rem cd librime
copy /Y thirdparty\bin\*.dll build\bin\
copy /Y build\lib\Release\rime.dll build\bin\
cd build\bin
echo zhongzhouyunshurufa | Release\rime_api_console.exe > output.txt
Back to weasel
directory.
Edit env.bat.template
, save your copy as env.bat
.
Edit weasel.props.template
, save your copy as weasel.props
.
Forget about Python. It's not used anyway.
Then, start VC command line tools from shell.bat
.
rem cd \path\to\weasel
rem shell.bat
build.bat all
Or, if using prebuilt librime libraries (see "Using prebuilt binaries" section above):
build.bat boost data hant
Voila.
cd output
install.bat
To create installer packages, you need to download and install [Unicode NSIS] (https://github.com/jimpark/unsis/releases).
Then go to output
directory, right-click and choose "Compile Unicode NSIS Script" with install.nsi
and expansion.nsi
.
Installers will be generated in archives
directory.