Skip to content

Building ​

qzjs uses CMake with feature toggles. All dependencies are built from source — no system packages required.

Basic Build ​

bash
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)

Build types: Release (optimized), Debug (with symbols and assertions), RelWithDebInfo, MinSizeRel.

CMake Options ​

Feature Toggles (QZ_WITH_*) ​

OptionDefaultDescription
QZ_WITH_TLSONmbedTLS for HTTPS and crypto primitives
QZ_WITH_COMPRESSONminiz compression/decompression extension
QZ_WITH_CRYPTO_EXTONcrypto.subtle (SHA, HMAC, PBKDF2, AES-GCM)
QZ_WITH_TEXTCODECONUTF-8 / Base64 encoder/decoder
QZ_WITH_WAMRONWAMR WebAssembly engine (Fast Interp + AOT, default)
QZ_WITH_WASM3OFFwasm3 WebAssembly engine (alternative, lighter weight)

Note: QZ_WITH_WAMR and QZ_WITH_WASM3 are mutually exclusive — only one WASM engine can be enabled at a time.

Build Targets ​

OptionDefaultDescription
QZ_BUILD_TESTSOFFBuild test suite (25 test targets)
QZ_BUILD_EXAMPLESOFFBuild examples in examples/
QZ_BUILD_CLIONBuild the qzjs CLI plus the qzjs-rt worker and qzjs-ctl control-plane binaries
QZ_PROCESS_MODELISOLATEDTHREAD (single-process multi-thread) or ISOLATED (dedicated child processes, default)

Example Configurations ​

Minimal (WinterTC still met) ​

bash
cmake -B build -DQZ_PROFILE=minimal
cmake --build build -j$(nproc)

minimal keeps WebAssembly, crypto.subtle, atob/btoa, and compression (2.45 MiB stripped, Release) — the smallest profile that satisfies the full WinterTC mandatory set. See Build Options for the profile table and the QZ_WITH_GRPC CMake option.

Full Development Build ​

bash
cmake -B build -DCMAKE_BUILD_TYPE=Debug \
      -DQZ_BUILD_TESTS=ON
cmake --build build -j$(nproc)
cd build && ctest --output-on-failure

Full option reference including build profiles (QZ_PROFILE) and the gRPC stack (QZ_WITH_GRPC): Build Options.

wasm3 Alternative Engine ​

bash
cmake -B build -DQZ_WITH_WAMR=OFF -DQZ_WITH_WASM3=ON
cmake --build build -j$(nproc)

C Standard Isolation ​

qzjs and all its dependencies build under strict C99 (-std=c99).

Output Artifacts ​

ArtifactPath
libqzjs.abuild/ (static core — deliberately does not link libuv; uv symbols resolve at the final executable)
libqz_full.abuild/ (CMake link-interface aggregator: qzjs + libuv + mbedTLS + miniz + WAMR + pthread/dl/rt)
qzjs.pcbuild/ (pkg-config — pkg-config --cflags --libs qzjs lists every vendored archive)
Test binariesbuild/test/
qzjsbuild/ (CLI — qzjs -e 'console.log(1)')
qzjs-rtbuild/ (worker-process binary, worker-process binary)
qzjs-ctlbuild/ (control-plane endpoint client)

MIT Licensed