Skip to content

Building

Building from Source

slang-server requires the following tools in order to build: - python 3 - CMake (3.28 or later) - C++20 compatible compiler. Minimum supported compiler versions: - GCC 11 - clang 17 - Xcode 16 - MSVC support is tested only against the most recent update of VS 2022

# Clone the repository
git clone https://github.com/hudson-trading/slang-server.git
cd slang-server

# Pull dependencies (slang and reflect-cpp)
git submodule update --init --recursive

# Build with cmake using a C++20 compliant compiler
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j --target slang_server

The binary will be at build/bin/slang-server.

Nix Development Shell

If you use Nix with flakes enabled, the repository provides a development shell for x86-64 Linux, ARM64 Linux, and Apple Silicon macOS. It includes the compiler, CMake, Ninja, Python, uv, and build and test dependencies.

After cloning the repository and initializing its submodules, run from the repository root:

nix develop
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j8 --target slang_server

The shell supplies the tools; the CMake commands build build/bin/slang-server. Use a separate build directory if an existing one was configured with a different compiler.