Building Citron for macOS
This guide is intended for developers. Citron on macOS is not currently ready for regular use, but this guide will help you build it for development purposes.
Table of Contents
- Install Dependencies
- Building Citron with Debug Symbols
- Running Citron
- Running with MoltenVK
Install Dependencies
You can install the necessary dependencies for Citron on macOS using Homebrew. Open your terminal and run the following command:
brew install autoconf automake boost@1.76 ccache ffmpeg fmt glslang hidapi libtool libusb lz4 ninja nlohmann-json openssl pkg-config qt@5 sdl2 speexdsp zlib zstd
These dependencies are required for building Citron on macOS.
Building Citron with Debug Symbols
- Create a
build
directory and navigate into it:
mkdir build && cd build
- Set the Qt5 directory environment variable (required for Qt on macOS):
export Qt5_DIR="/opt/homebrew/opt/qt@5/lib/cmake"
- Run CMake to configure the build system:
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCITRON_USE_BUNDLED_VCPKG=OFF -DCITRON_TESTS=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_LIBUSB=OFF
- Build Citron using Ninja:
ninja
Note:
- vcpkg is currently not used on macOS due to issues with the boost-context library.
- There is a TODO to update vcpkg and fix the library issue, allowing for the use of the web service.
Running Citron
Once the build is complete, you can run Citron by executing the following command:
bin/citron.app/Contents/MacOS/citron
Running with MoltenVK
To run Citron with MoltenVK (for Vulkan support on macOS), you must install additional dependencies.
- Install MoltenVK and the Vulkan loader:
brew install molten-vk vulkan-loader
- Set the LIBVULKAN_PATH environment variable to the Vulkan loader path:
export LIBVULKAN_PATH=/opt/homebrew/lib/libvulkan.dylib
- Run Citron with the Vulkan loader:
bin/citron.app/Contents/MacOS/citron