Skip to content

XMake Setup

Note

Make sure you have followed the installation instructions first. If you encounter problems, please ask for support in our Discord server.

The Amplitude Audio SDK and its official plugins are published as XMake packages through a dedicated repository at AmplitudeAudio/repo-xmake. The repository ships:

Package Purpose
amplitudeaudiosdk The core Amplitude Audio SDK.
amplitude-plugin-vorbis Official Vorbis/OGG codec plugin.
amplitude-plugin-flac Official FLAC codec plugin.
amplitude-plugin-profiler Official profiler plugin.

Register the repository

Add the repository to xrepo once per machine using the xrepo CLI:

xrepo add-repo amplitudeaudio https://github.com/AmplitudeAudio/repo-xmake

Or, for a project-local registration, declare the repository directly in your xmake.lua:

add_repositories("amplitudeaudio https://github.com/AmplitudeAudio/repo-xmake")

Require the SDK in your project

Add the SDK as a project requirement in xmake.lua:

add_requires("amplitudeaudiosdk")

You can also pin a specific version, or override the default shared library configuration:

-- Pin a specific version
add_requires("amplitudeaudiosdk 1.0.0")

-- Build as a static library (disables runtime plugin loading)
add_requires("amplitudeaudiosdk", { configs = { shared = false } })

Warning

Linking against the static library prevents the engine from loading plugins at runtime. Use the default shared configuration if your project needs dynamic plugin loading (e.g. the official Vorbis or FLAC codecs).

Then attach the package to the targets that need it:

target("my_game")
    set_kind("binary")
    add_files("src/*.cpp")
    add_packages("amplitudeaudiosdk")

Add official plugins

Plugins follow the same flow. Declare them in add_requires and link them into the targets that should ship them:

add_requires("amplitudeaudiosdk", "amplitude-plugin-vorbis", "amplitude-plugin-flac")

target("my_game")
    set_kind("binary")
    add_files("src/*.cpp")
    add_packages("amplitudeaudiosdk", "amplitude-plugin-vorbis", "amplitude-plugin-flac")

At runtime you still need to call Engine::LoadPlugin() for each plugin (see Dynamic Plugins).

Install on demand without xmake.lua

If you only want the SDK headers and binaries on disk (for use with another build system or for inspection), install the package directly:

xrepo install amplitudeaudiosdk

xrepo resolves dependencies, builds the package for the current platform, and prints the install location. Use xrepo --help install for arch / mode / config flags.

Upgrade or rebuild

When the repository ships a new version, refresh your local cache and rebuild:

xrepo update-repo
xmake require --upgrade amplitudeaudiosdk

See also