BUILD.md
Prerequisites:
Instructions for Visual Studio 2022:
git clone --recursive https://github.com/cemu-project/CemuAny other IDE should also work as long as it has CMake and MSVC support. CLion and Visual Studio Code have been confirmed to work.
To compile Cemu, a recent enough compiler and STL with C++20 support is required! Clang-15 or higher is what we recommend.
sudo pacman -S --needed base-devel bluez-libs clang cmake freeglut git glm gtk3 libgcrypt libpulse libsecret linux-headers llvm nasm ninja systemd unzip zip
sudo apt install -y cmake curl clang-15 freeglut3-dev git libbluetooth-dev libgcrypt20-dev libglm-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev libtool nasm ninja-build
You may also need to install libusb-1.0-0-dev as a workaround for an issue with the vcpkg hidapi package.
At Step 3 in Build Cemu using cmake and clang, use the following command instead:
cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang-15 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-15 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja
sudo dnf install bluez-libs-devel clang cmake cubeb-devel freeglut-devel git glm-devel gtk3-devel kernel-headers libgcrypt-devel libsecret-devel libtool libusb1-devel llvm nasm ninja-build perl-core systemd-devel wayland-protocols-devel zlib-devel zlib-static
git clone --recursive https://github.com/cemu-project/Cemu
cd Cemu
cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -G Ninja
cmake --build build
If you are building using GCC, make sure you have g++ installed:
sudo pacman -S gccsudo apt install g++sudo dnf install gcc-c++git clone --recursive https://github.com/cemu-project/Cemu
cd Cemu
cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -G Ninja
cmake --build build
git clone --recursive https://github.com/cemu-project/Cemu
cd Cemu
cmake -S . -B build -DCMAKE_BUILD_TYPE=debug -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -G Ninja
cmake --build build
If you are using GCC, replace cmake -S . -B build -DCMAKE_BUILD_TYPE=debug -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -G Ninja with cmake -S . -B build -DCMAKE_BUILD_TYPE=debug -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -G Ninja
This section refers to running cmake -S... (truncated).
vcpkg install failed
cd dependencies/vcpkg && git fetch --unshallowPlease ensure you're using the latest port files with git pull and vcpkg update.
git submodule update --remote dependencies/vcpkgCemu/dependencies/vcpkg/buildtrees/wxwidgets/config-x64-linux-out.logCemu/dependencies/vcpkg/buildtrees/libsystemd/config-x64-linux-dbg-meson-log.txt.logCemu/dependencies/vcpkg/buildtrees/libsystemd/config-x64-linux-dbg-out.log-DCMAKE_MAKE_PROGRAM=/usr/bin/ninjagit pull with an error that mentions RPATH
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ONVCPKG_FORCE_SYSTEM_BINARIES must be set.
export VCPKG_FORCE_SYSTEM_BINARIES=1If you are getting a different error than any of the errors listed above, you may either open an issue in this repo or try using GCC. Make sure your standard library and compilers are updated since Cemu uses a lot of modern features!
This section refers to running cmake --build build.
main.cpp.o: in function 'std::__cxx11::basic_string...
fatal error: 'span' file not found
libstdc++ or are using a version that's too old. Install at least v10 with your package manager, eg sudo apt install libstdc++-10-dev. See #644.undefined libdecor_xx
If you are getting a different error than any of the errors listed above, you may either open an issue in this repo or try using GCC. Make sure your standard library and compilers are updated since Cemu uses a lot of modern features!
To compile Cemu, a recent enough compiler and STL with C++20 support is required! LLVM 13 and below don't support the C++20 feature set required, so either install LLVM from Homebrew or make sure that you have a recent enough version of Xcode. Xcode 15 is known to work. The OpenGL graphics API isn't supported on macOS, so Vulkan must be used through the Molten-VK compatibility layer.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"eval "$(/usr/local/Homebrew/bin/brew shellenv)""$(/opt/homebrew/bin/brew shellenv)"The native versions of these can be used regardless of what type of Mac you have.
brew install git cmake ninja nasm automake libtool
On Apple Silicon Macs, Rosetta 2 and the x86_64 version of Homebrew must be used to install these dependencies:
softwareupdate --install-rosetta # Install Rosetta 2 if you don't have it. This only has to be done oncearch -x86_64 zsh # run an x64 shell/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"eval "$(/usr/local/Homebrew/bin/brew shellenv)"Then install the dependencies:
brew install boost molten-vk
git clone --recursive https://github.com/cemu-project/Cemucd Cemucmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_OSX_ARCHITECTURES=x86_64 -G Ninjacmake --build build./bin/Cemu_release.-DCMAKE_MAKE_PROGRAM=/usr/local/bin/ninja to the command and running it again.The following instructions to build Cemu on FreeBSD are experimental. Some features available on other platforms are not available on FreeBSD (discord rich presence, bluetooth/support for actual Wii U controllers, auto-updates, etc.)
To compile Cemu, a recent enough compiler and STL with C++20 support is required! Clang-15 or higher is what we recommend. Any version of FreeBSD 13.3-RELEASE or higher comes bundled with LLVM > version 15 as part of the base system. However, if for whatever reason your system lacks a recent version of LLVM you can install one by executing:
sudo pkg install llvm15
Or a higher version as desired.
sudo pkg install boost-libs cmake-core curl glslang gtk3 libzip ninja png pkgconf pugixml rapidjson sdl2 wayland wayland-protocols wx32-gtk3 xorg zstd
git clone --recursive https://github.com/cemu-project/Cemu
cd Cemu
cmake -B build -DCMAKE_BUILD_TYPE=release -DENABLE_BLUEZ=OFF -DENABLE_DISCORD_RPC=OFF -DENABLE_FERAL_GAMEMODE=OFF -DENABLE_HIDAPI=OFF -DENABLE_VCPKG=OFF -G Ninja
cmake --build build
cd build && ninja install
You should now have a Cemu executable file in the /bin folder, which you can run using ./bin/Cemu_release.
git pull --recurse-submodules (run this command on the Cemu root).
If CMake complains about Cemu already being compiled or another similar error, try deleting the CMakeCache.txt file inside the build folder and retry building.
Some flags can be passed during CMake configure to customise which features are enabled on build.
Example usage: cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DENABLE_SDL=ON -DENABLE_VULKAN=OFF
| Flag | Description | Default | Note | |
|---|---|---|---|---|
| ALLOW_PORTABLE | Allow Cemu to use the portable directory to store configs and data | ON | ||
| CEMU_CXX_FLAGS | Flags passed straight to the compiler, e.g. -march=native, -Wall, /W3 | "" | ||
| ENABLE_CUBEB | Enable cubeb audio backend | ON | ||
| ENABLE_DISCORD_RPC | Enable Discord Rich presence support | ON | ||
| ENABLE_OPENGL | Enable OpenGL graphics backend | ON | Currently required | |
| ENABLE_HIDAPI | Enable HIDAPI (used for Wiimote controller API) | ON | ||
| ENABLE_SDL | Enable SDLController controller API | ON | Currently required | |
| ENABLE_VCPKG | Use VCPKG package manager to obtain dependencies | ON | ||
| ENABLE_VULKAN | Enable the Vulkan graphics backend | ON | ||
| ENABLE_WXWIDGETS | Enable wxWidgets UI | ON | Currently required |
| Flag | Description | Default | Note |
|---|---|---|---|
| ENABLE_DIRECTAUDIO | Enable DirectAudio audio backend | ON | Currently required |
| ENABLE_DIRECTINPUT | Enable DirectInput controller API | ON | Currently required |
| ENABLE_XAUDIO | Enable XAudio audio backend | ON | |
| ENABLE_XINPUT | Enable XInput controller API | ON |
| Flag | Description | Default |
|---|---|---|
| ENABLE_BLUEZ | Build with Bluez (used for Wiimote controller API) | ON |
| ENABLE_FERAL_GAMEMODE | Enable Feral Interactive GameMode support | ON |
| ENABLE_WAYLAND | Enable Wayland support | ON |
| Flag | Description | Default |
|---|---|---|
| MACOS_BUNDLE | MacOS executable will be an application bundle | OFF |