Contents (7)

Build from source

moha is C++26. You need GCC 14+ or Clang 18+ and CMake 3.28+.

git clone --recursive git@github.com:1ay1/moha.git
cd moha
cmake -B build && cmake --build build
./build/moha

Auth happens in-app on first launch.

Dependencies (build time only)

DependencyVersionNotes
GCC or Clang14+ / 18+C++26 support
CMake3.28+Build system
OpenSSL3.xTLS for API calls
nghttp21.xHTTP/2 streaming

All dependencies are linked at build time — the resulting binary has no runtime dependencies beyond libc.


Standalone build (static linking)

A standalone build statically links OpenSSL + nghttp2 + libstdc++ + libgcc, producing a binary you can copy to other machines without worrying about shared library versions.

libc stays dynamic on Linux/macOS — fully-static glibc breaks getaddrinfo and the NSS resolver. This means:

The accurate one-liner: statically linked except libc and (usually) OpenSSL.

cmake -B build -DMOHA_STANDALONE=ON
cmake --build build

Prerequisites: the .a (static archive) variants of OpenSSL and nghttp2 must be installed. On Debian/Ubuntu:

sudo apt install libssl-dev libnghttp2-dev

Fully static (musl)

For a 100% static binary with no dynamic dependencies at all:

cmake -B build -DMOHA_STANDALONE=ON -DMOHA_FULLY_STATIC=ON
cmake --build build

Requires a musl toolchain (e.g., musl-gcc or Alpine Linux).

Windows

-DMOHA_STANDALONE=ON on Windows implies /MT (static CRT) and pulls third-party libs from the x64-windows-static vcpkg triplet.

cmake -B build -DMOHA_STANDALONE=ON -DCMAKE_TOOLCHAIN_FILE=path/to/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static
cmake --build build --config Release

Result

The standalone binary is typically ~9 MB and can be copied to any machine with a compatible libc (glibc 2.17+ on Linux, macOS 11+ on Apple Silicon).

file build/moha
# build/moha: ELF 64-bit LSB executable, x86-64, statically linked (uses shared libs for libc), not stripped

ldd build/moha
# linux-vdso.so.1
# libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
# (no other dependencies)

Platform support

PlatformStatus
Linux x86_64Daily smoke testing
Linux ARM64Supported, less frequently tested
macOS (Apple Silicon)Code paths exist, CI coming
macOS (Intel)Code paths exist, CI coming
WindowsCode paths exist (CreateProcessW, /MT), CI coming

Linux is the primary development platform. macOS and Windows code paths exist throughout (#ifdef branches for posix_spawn vs CreateProcessW, fdatasync vs fsync, etc.) but don’t yet have continuous integration.