Setup on macOS

Building Garvan applications on macOS works the same way as on Linux — the bundled libgarvan.a is universal, you only need to install a few system libraries.

Requirements

  • Xcode command line tools (xcode-select --install).
  • A C++ compiler with C++23 support (Xcode 16+ Apple Clang, or LLVM Clang 18+ from Homebrew).
  • CMake 3.20 or later.
  • Asio headers.
  • libcurl (bundled with macOS; Homebrew's curl is a newer option).

Using Homebrew

The easiest path is via Homebrew. Install the build tools and any database drivers you need:

brew install cmake asio openssl@3 curl
brew install libpq mysql-connector-c++ mongo-cxx-driver sqlite
# For C++23: install a newer toolchain if Apple Clang is too old
brew install llvm@18

Compiling your project

Point CMake at the Homebrew prefixes for OpenSSL:

cmake -S . -B build \
    -DOPENSSL_ROOT_DIR=$(brew --prefix openssl@3) \
    -DCMAKE_PREFIX_PATH=$(brew --prefix)
cmake --build build
Tip

On Apple Silicon Macs, make sure all your dependencies are arm64 builds — mixing x86_64 Homebrew with arm64 will fail at link time.