Skip to content

Installation

Lee Yunjin edited this page Oct 7, 2026 · 1 revision

Installation

CWIST builds from source on Linux, macOS and FreeBSD. It vendors its heavy dependencies (BoringSSL, lsquic, libttak, cJSON, uriparser, cnats, multipart-parser-c, usrsctp) as git submodules and downloads the SQLite amalgamation during the first build, so a build needs only a C/C++ toolchain and a few system libraries.

Homebrew (macOS and Linuxbrew)

The tap installs the latest release from its source tarball:

brew tap c4punks/cwist
brew install cwist
# or, without tapping first:
brew install c4punks/cwist/cwist

The formula installs libcwist.a, the public headers, the cwist CLI and the cwist.pc pkg-config file under the Homebrew prefix.

From source

System packages

Platform Packages
Debian / Ubuntu build-essential cmake pkg-config libcurl4-openssl-dev libnghttp2-dev libbrotli-dev libzstd-dev zlib1g-dev
Fedora / RHEL gcc gcc-c++ make cmake pkgconf libcurl-devel libnghttp2-devel brotli-devel libzstd-devel zlib-devel
macOS (Homebrew) cmake pkg-config curl nghttp2 brotli zstd

cmake builds the vendored BoringSSL, lsquic, uriparser, cnats and usrsctp. A C++ compiler is required because BoringSSL contains C++ sources.

Build

git clone --recursive https://github.com/c4punks/CWIST.git
cd CWIST
make -j"$(nproc)"

If the repository was cloned without --recursive, run git submodule update --init --recursive first. The Makefile initializes the lsquic and usrsctp submodules on its own, but not the others.

The first build downloads sqlite-amalgamation from sqlite.org into lib/sqlite3/. On a machine without network access, build from a release tarball instead (see below), which already contains it.

Install

sudo make install                      # PREFIX defaults to /usr/local
make install PREFIX=/opt/cwist         # custom prefix
make install PREFIX=/usr DESTDIR=/tmp/pkgroot   # staged install for packaging

make install writes:

Path Contents
$PREFIX/lib/libcwist.a the CWIST objects only (a "thin" archive, see Linking)
$PREFIX/lib/cwist/ the bundled dependency archives (BoringSSL, lsquic, libttak, cJSON, uriparser, cnats, usrsctp)
$PREFIX/include/cwist/ public CWIST headers
$PREFIX/include/cwist/vendor/ headers of the bundled dependencies
$PREFIX/lib/pkgconfig/cwist.pc pkg-config metadata
$PREFIX/bin/cwist the project CLI
$PREFIX/share/doc/cwist/ LICENSE, NOTICE.md and every vendored license

Build options

Variable Default Effect
WERROR=1 unset Treat warnings as errors (CI uses this). Vendored sources are exempt.
SANITIZE=address,undefined unset Build the library and tests with the given sanitizers (disables LTO).
CWIST_WEBRTC=0 1 Leave out the WebRTC DataChannel module (src/net/webrtc/) and usrsctp.
CWIST_WEBTRANSPORT=0 1 Leave out the WebTransport client. Only dev pins an lsquic that has the required API; see WebTransport.
PREFIX, DESTDIR /usr/local, empty Install location and staging root.

Test

make test                                   # full suite
make SANITIZE=address,undefined test        # what the ASan/UBSan CI job runs
make tutorials-check                        # compile every tutorial against the library

From a release tarball

Every release publishes cwist-<version>.tar.gz with all submodule sources and the SQLite amalgamation included, so it builds without git or network access:

curl -LO https://github.com/c4punks/CWIST/releases/download/v3.9/cwist-3.9.tar.gz
tar xf cwist-3.9.tar.gz && cd cwist-3.9
make -j"$(nproc)" && make test

Maintainers create the archive with make dist VERSION=X.Y.Z.

vcpkg

An in-tree vcpkg port draft lives under packaging/vcpkg/. It has not been submitted upstream.

WebAssembly targets

Browser (Emscripten) and WASI builds use separate make targets; see WASM Browser Builds and WASI.

Next

Quick Start builds and runs a first server; Linking explains the flags an application needs.

Clone this wiki locally