Prerequisites
Before building Hydra, ensure you have the following installed on your system:macOS Requirements
- Xcode (14.0 or later) - Required for Apple development tools and frameworks
- CMake (3.15 or later) - Build system generator
- Ninja - Fast build system (recommended)
- Git - For cloning the repository and submodules
Dependencies
You can install the required dependencies using Homebrew:Required Dependencies
- SDL3 - For the SDL3 frontend (default on macOS)
- fmt - Formatting library (will be auto-downloaded if not found)
Bundled Dependencies
The following dependencies are included as Git submodules:- dynarmic - ARM CPU emulator
- cubeb - Cross-platform audio library
- hatch - TOML configuration library
- libyaz0 - Yaz0 compression library
- nx2elf - Nintendo Switch executable converter
- metal-cpp - C++ Metal API wrapper
- stb - Image and font loading libraries
Getting the Source Code
Building
Standard Build (SDL3 Frontend)
Configure CMake
Generate build files with Ninja:This creates a macOS application bundle with the SDL3 frontend.
SwiftUI Frontend Build
For a native macOS experience using SwiftUI:The SwiftUI frontend requires macOS 15.0 or later, while the SDL3 frontend works with macOS 13.0+.
Build Configurations
Debug Build
Debug builds include additional logging and debugging symbols:- Define
HYDRA_DEBUGpreprocessor macro - Include Git commit hash in the version
- Enable additional runtime checks
Release Build
Release builds are optimized for performance:- Enable compiler optimizations
- Omit debug symbols
- Skip Git hash in version string
Build Options
CMake Configuration Options
Build System Requirements
- C++ Standard: C++20 (enforced by CMake)
- Minimum CMake Version: 3.15
- Apple Platforms: Enables Objective-C, Objective-C++, and Swift automatically
Troubleshooting
CMake Configuration Fails
Problem: CMake can’t find dependencies Solution: Ensure all dependencies are installed via Homebrew:Submodule Errors
Problem: Missing submodule errors during build Solution: Reinitialize submodules:Compilation Errors
Problem: Compiler warnings treated as errors Solution: Hydra uses-Werror (warnings as errors). Ensure you’re using a compatible Xcode/Clang version:
Metal/Graphics Errors
Problem: Metal framework linking errors Solution: Hydra requires macOS with Metal support. Ensure you’re running on compatible hardware and macOS version.Hypervisor Framework Errors (Apple Silicon)
Problem: Hypervisor.framework linking fails Solution: Hypervisor support requires specific entitlements. Try disabling it:SwiftUI Build Issues
Problem: SwiftUI frontend won’t build Solution: Ensure you’re running macOS 15.0 or later:Clean Build
To perform a clean build, remove the build directory:Build Output
After a successful build, you’ll find:- Executable:
build/bin/Hydra.app(whenMACOS_BUNDLE=ON) - Compile Commands:
build/compile_commands.json(for IDE integration)
Next Steps
After building Hydra:- Configure: Launch Hydra once to generate the config file at
~/Library/Application Support/Hydra/config.toml - Setup Firmware: Some games require decrypted firmware files
- Install Patches: Download the patch set for official games
- Start Emulating: Load NRO, NCA, or NX format games