Compiling on macOS
Dependencies
BZFlag uses Xcode and a several third-party dependencies to build on macOS.
- Xcode
- SDL 2.0.9+
- GLEW
- c-ares
Homebrew
As an alternative to manual installation of the various dependencies, the homebrew package manager can simplify installing external packages, if you have it installed.
SDL
Download the latest development library .dmg file and open it. Drag the SDL2.framework file into your
/Library/Frameworks/
directory, which may require an administrator account to accomplish.
GLEW
Download the latest GLEW .tgz source release and extract the contents. Open a Terminal and cd
into the glew
directory that was just created by extracting. Then run the following commands:
export GLEW_DEST=/usr/local
make glew.lib
sudo make install
sudo rm /usr/local/lib/libGLEW*.dylib
c-ares
Download the latest c-ares source release and extract the contents. Open a terminal and cd
into the c-ares
directory that was just created by extracting. Then run the following commands:
./configure --disable-shared
make
sudo make install
Obtaining the code
For BZFlag 2.4:
Either download and extract the specific release source .tar.gz or .tar.bz2 from our downloads archive or use Git to download the current 2.4 branch.
For BZFlag master (2.5):
Building the code
Nagivate to the Xcode directory of our source and open BZFlag.xcodeproj. This will launch Xcode.
By default we build in debug mode which leaves debugging symbols in the binaries and produces less optimized code. To change this, navigate to the Product menu, then to Scheme, and click on Edit Scheme. Then in the left sidebar click on the Run phase, and then the Info tab. Under Build Configuration, select the desired scheme of Debug or Release.
To build, select Build from the Product menu. If the build was successful, you can run the application from Xcode by selecting the Product menu and clicking on Run.
To locate the .app you just created, access the Navigator panel and select the Project Navigator. Expand the "BZFlag" project container and the "Targets" group within it. Click the "BZFlag.app" target. Make sure the Utilities page is visible, and under the Identify and Type panel it will show the full path to the application. Click the small grey right arrow at the bottom right corner of the path to reveal the application in the Finder.
More information
For more information, review the README.MacOSX and DEVINFO files from the source.
This content is maintained on GitHub. We welcome any feedback and improvements!