If you are not sure what the following commands do, please check the descriptions below and make sure the operations before running them.
python -m pip install six requests
git clone https://github.com/google/mozc.git
cd mozc\src
python build_tools/update_deps.py
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsamd64_x86.bat"
python build_tools/build_qt.py --release --confirm_license
python build_mozc.py gyp
python build_mozc.py build -c Release package
# Install Mozc
out_win\Release\Mozc64.msi
Hint: You can also download Mozc64.msi
from GitHub Actions. Check Build with GitHub Actions for details.
64-bit Windows 10 or later.
Building Mozc on Windows requires the following software.
- Visual Studio 2022 Community Edition
- Build Tools for Visual Studio 2022 should also work
- Python 3.9 or later with the following pip modules.
six
requests
python3 -m pip install six requests
git clone https://github.com/google/mozc.git
cd mozc\src
Hereafter you can do all the operations without changing directory.
python build_tools/update_deps.py
In this step, additional build dependencies will be downloaded.
You can skip this step if you would like to manually download these libraries.
If you have not set up the build system in your command prompt, you might need to execute the setup command like this.
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsamd64_x86.bat"
python build_tools/build_qt.py --release --confirm_license
If you would like to manually confirm the Qt license, drop --confirm_license
option.
You can skip this process if you have already installed Qt prebuilt binaries.
If you have built Qt in the above step, the following commands should be sufficient to build Mozc installers.
python build_mozc.py gyp
python build_mozc.py build -c Release package
If you want to build Mozc without Qt dependencies, specify --noqt
option as follows. Note that mozc_tool.exe
will be built as a mock version that does nothing if you specify --noqt
.
python build_mozc.py gyp --noqt
python build_mozc.py build -c Release package
If you want to build Mozc with your own Qt binaries, specify --qtdir
option as follows.
python build_mozc.py gyp --qtdir=<your Qt directory>
python build_mozc.py build -c Release package
If you need debug information, you can build debug version of Mozc as follows.
python build_mozc.py build_tools/build_qt.py --release --debug --confirm_license
python build_mozc.py build -c Debug package
You have release build binaries in out_win\Release\Mozc64.msi
.
To clean up the tree, execute the following. This will remove executables and intermediate files like object files, generated source files, project files, etc.
python build_mozc.py clean
On a 64-bit environment, run the following command (or simply double click the corresponding file).
out_win\Release\Mozc64.msi
Press Win+R to open the dialog and type ms-settings:appsfeatures-app
, or on terminal run the following command.
start ms-settings:appsfeatures-app
Then uninstall Mozc
from the list.
You can run unit tests as follows.
python build_mozc.py gyp --noqt
python build_mozc.py runtests -c Release
Note that you can specify --qtdir=
option instead of --noqt
in GYP phase since currently there is no unit test that depends on Qt.
GitHub Actions are already set up in windows.yaml. With that, you can build and install Mozc with your own commit as follows.
- Fork https://github.com/google/mozc to your GitHub repository.
- Push a new commit to your own fork.
- Click "Actions" tab on your fork.
- Wait until the action triggered with your commit succeeds.
- Download
Mozc64.msi
from the action result page if you are using 64-bit Windows. - Install
Mozc64.msi
.
Files in the GitHub Actions page remain available up to 90 days.
You can also find Mozc Installers for Windows in google/mozc repository. Please keep in mind that Mozc is not an officially supported Google product, even if downloaded from https://github.com/google/mozc/.
- Sign in GitHub.
- Check recent successfull Windows runs in google/mozc repository.
- Find action in last 90 days and click it.
- Download
Mozc64.msi
from the action result page if you are using 64-bit Windows.