To build torzu on Windows with Visual Studio, you need to install:
from Notabug repo:
git clone --depth 1 https://notabug.org/litucks/torzu.git
from Torzu repo (assuming Tor is installed as a service):
git -c http.proxy=socks5h://127.0.0.1:9050 clone --depth 1 http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu.git
git clone
and run the following commands to build:cd torzu
git submodule update --init --recursive
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A x64 -DYUZU_TESTS=OFF
cmake --build . --config Release
You'll find the resulting files in the build/bin/Release
folder. To make it a portable install with all AppData files local to the torzu folder, add a "user" folder:
cd bin
cd Release
mkdir user
ERRORS: If you get an error after running the first cmake command (such as a missing library or CMakeLists.txt), first try running git submodule update --init --recursive
from inside "torzu" folder again. If that doesn't work, try deleting the whole "torzu" folder and recloning via git from the beginning (as sometimes submodules will be incomplete without throwing an error.)
from Notabug repo:
git clone --depth 1 https://notabug.org/litucks/torzu.git
from Torzu repo (assuming Tor is installed as a service):
git -c http.proxy=socks5h://127.0.0.1:9050 clone --depth 1 http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu.git
then download dependencies with:
cd torzu
git submodule update --init --recursive
torzu
directory (instead of yuzu-canary
)./build
subdirectory inside the torzu
directory or some other directory of your choice. (Tell CMake to create it.)Visual Studio 17 2022
, with x64
for the optional platform.(Note: If you used GitHub's own app to clone, run git submodule update --init --recursive
to get the remaining dependencies)
ERRORS: If you get an error about missing packages, enable YUZU_USE_BUNDLED_VCPKG
, and then click Configure again.
YUZU_TESTS
in this case since Catch2 is not yet supported with this.)ERRORS: If you get an error "Unable to find a valid Visual Studio instance", make sure that you installed the required MSVC components displayed above (especially VS 2019 build tools) and then try again.
Click "Generate" to create the project files.
yuzu.sln
in Visual Studio 2022, which is located in the build
directory.yuzu
in the Solution Explorer, right-click and Set as StartUp Project
(the yuzu, yuzu-cmd and yuzu-room executables will all be built.)build\bin\Release
.)pacman -Syu
as many times as needed.MSYS2 MinGW 64-bit
(mingw64.exe) shellpacman -Syu git make mingw-w64-x86_64-SDL2 mingw-w64-x86_64-cmake mingw-w64-x86_64-qt5 mingw-w64-x86_64-toolchain
export PATH="<Absolute path to the Bin folder in Vulkan SDK>:$PATH"
export VCPKG_DEFAULT_HOST_TRIPLET=x64-mingw-static
export VCPKG_DEFAULT_TRIPLET=x64-mingw-static
We have to manually set some VCPKG variables for some reason. This issue probably already exists in the original Yuzu.
Navigate to a directory where you want the repo, then use one option below to clone into a subdirectory named "torzu":
from NotABug repo:
git clone --depth 1 https://notabug.org/litucks/torzu.git
from Torzu repo (assuming Tor is installed as a service):
git -c http.proxy=socks5h://127.0.0.1:9050 clone --depth 1 http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu.git
then download the submodule dependencies with:
cd torzu
git submodule update --init --recursive
mkdir build && cd build
cmake -G "MSYS Makefiles" -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF -DVCPKG_TARGET_TRIPLET=x64-mingw-static ..
DVCPKG_TARGET_TRIPLET
has to be overriden to x64-mingw-static
here to generate a static build that doesn't require extra DLLs to be packaged.
make -j$(nproc) yuzu
The reason we are not using make all
is that linker will fail.
This is because Yuzu developer didn't set linker flags properly in their CMakeLists.txt
for some reason. So we have add something manually.
VERBOSE=1 make yuzu
This will shows the exact link command, should be something like:
cd ***/src/yuzu && /mingw64/bin/c++.exe -O3 -DNDEBUG -Wl,--subsystem,windows -Wl,--whole-archive ...
Copy the command line and add the following arguments:
-static-libstdc++ -lws2_32 -s -Wl,--Map,../../bin/yuzu.map
Explanation of the extra arguments:
-static-libstdc++
: Force usage of static libstdc++, without this argument the binary will have no entrypoint.-lws2_32
: Link the ws2_32.a provided by mingw.-s
: Optional, strip the symbols from the output binary.-Wl,--Map,../../bin/yuzu.map
: Optional, output a separated linker map to ../../bin/yuzu.map
Please note that -lw2_32
is already added, but the order is not correct and hence cause linking fails.Now the built executable should work properly. Repeating step 4 should build yuzu-cmd
as well.
Some DLLs (e.g., Qt) are still required as they cannot being linked statically. Copying those DLLs from the latest release is one option.
Doesn't require the rather large Qt dependency, but you will lack a GUI frontend:
-DENABLE_QT=NO
flag to cmakeTo build yuzu, you need to install the following:
https://notabug.org/litucks/torzu.git
(instead of the shown yuzu repo):Build type: Release
Name: Release
Toolchain Visual Studio
Generator: Let CMake decide
Build directory: build