Skip to content

Compiling Q‐Zandronum on Mac

Joshua Surace edited this page Jan 28, 2025 · 3 revisions

Q-Zandronum needs certain tools and development files in order to compile:

Required:

Optional:

  • zlib (Zandronum has a copy of it and will be statically compiled in if not found)
  • libbzip2 (possibly static)
  • libjpeg (possibly static)
  • HomeBrew or Macports (Not recommended for building using M1 or M2 (ARM64) CPU)
  • Rosetta 2 (for building x86_64 binaries using M1 or M2 (ARM64) CPU)

Installing Xcode

There are 3 ways to install Xcode:

Command line Tools

Open Terminal.app and paste this command:

xcode-select --install

This'll pop up: 450px-Xcode_Command_Line_Tools_popup

Install it. (Caution: it's big so make sure you got enough space)

App Store (if you have an newer system)

[https://apps.apple.com/au/app/xcode/id497799835?mt=12 Xcode] (Click the link, it'll go straight to the App Store)

Apple developer (if you have an older system)

https://developer.apple.com/download/all/ (Sign in is required. It includes Command line Tools as well)

Rosetta (Optional)

If you are using M1 or M2 (ARM64), then this is required:

softwareupdate --install-rosetta

Installing from HomeBrew or Macports

HomeBrew (MacOS 10.15 - Latest)

brew install jpeg-turbo fluid-synth openssl sdl2 sdl12-compat libmpg123 libsndfile

MacPorts (Legacy MacOS)

sudo port install libjpeg-turbo fluidsynth openssl sdl2 sdl12-compat libmpg123 libsndfile

Installing CMake GUI

Download CMake.

Open up the DMG and copy them into Applications (or drag them).

Create qzandronum_build directory

Open Terminal.app and paste this command: mkdir -pv ~/qzandronum_build

Compiling SDL12-Compat

If you already have this installed using HomeBrew or Macports. Please skip this section. Create a directory like this:

cd ~/qzandronum_build && mkdir -pv sdl_pack

Download SDL2 and SDL 1.2 Compatibility and extract them into it.

Or

Clone it:

git clone https://github.com/libsdl-org/sdl12-compat.git && git clone https://github.com/libsdl-org/SDL.git

Click on the CMake app that you added into Applications, it'll give you a warning that you downloaded a third party app on Mac, just hit OK.

Click Browse Source, choose where you put SDL12-Compat, then click Open.

It's better if you build it inside the source, so do the same in Browse Build. Add a new folder into SDL12-Compat called Build.

When you click Configure it'll popup a window, choose "Unix Makefiles" (It's faster than using Xcode type) and click Done.

Make sure you disable SDL12TESTS as we don't need it and make the default architecture x86_64 because we are not using ARM64 until further releases.

Then check Advanced to display the SDL2 Section.

Configure only SDL_INCLUDE_DIR.

Click Generate and then compile, it'll give you 2 files.

cd ~/zandronum_build/sdl_pack/sdl12-compat/build/ && make

Compiling Q-Zandronum

Clone it:

cd ~/qzandronum_build/ git clone https://github.com/IgeNiaI/Q-Zandronum.git

Open the CMake app again.

This is a lot because you must compile most of the dependencies before you can do this next part, so read the readme on each source codes. Homebrew and MacPorts are fine.

So firstly Browse Source and Build like you did with SDL12-Compat.

Click Browse Source, choose where you put Q-Zandronum, then click Open.

It's better if you build it inside the source, so do the same in Browse Build. Add a new folder into Q-Zandronum called Build.

When you click Configure it'll popup a window, choose "Unix Makefiles" (It's faster than using Xcode type) and click Done. If it shows an error that means they couldn't find the rest. So you need to go through each dependency to find the directories and files then hit Generate.

If you only see SDL_INCLUDE_DIR, click Add Entry and type in SDL_LIBRARY then browse for the Dylib.

also in cmake_cxx_flags add this:

-std=c++14 -stdlib=libc++

and in cmake_exe_linker_flags add this:

-framework CoreFoundation -framework Carbon -framework Cocoa -framework IOKit -framework AudioToolbox -framework AudioUnit

Once you've done everything, compile.

cd ~/qzandronum_build/q-zandronum/build/ && make -j8

Once the compile is finished, all that's left to do is to add the dylibs and frameworks into the Frameworks you need to create an appbundles and use install name tool yourrself.

There you have it, just drag the bundle into the applications, and it should be good to go.