Skip to content

Compiling

dd86k edited this page Mar 12, 2025 · 13 revisions

Prerequisites

  • A D compiler

    • DMD >=2.068.1
    • LDC >=0.17.1
    • GDC >=8.4.0
  • (Optional, recommended) DUB >=0.9.24

    ⚠️ For Windows, a more recent compiler is desired when linking standard stream usage.

    e.g., DMD 2.098.1 won't work, but DMD 2.108.1 (the last to support OMF), will.

Using DUB

DUB often comes alongside a D compiler and is the recommended way to build the project. Otherwise it can be installed manually.

A compiler can be chosen with the --compiler= option. Available options are DMD, GDC, and LDC (via ldc2).

NOTE: BetterC mode is used for builds when available. Except for docs and unittests.

Usage: dub COMMAND [-b|--build BUILDTYPE] [-c|--config CONFIG] [--compiler=COMPILER]

You can look in dub.sdl for available build types and configurations.

In summary:

  • Make a debug build of Alicedbg: dub build :debugger
  • Make a release build of Alicedump using LDC: dub build :dumper -b release --compiler=ldc2
  • Compile example: dub build :simple
  • Run tests (library only): dub test
  • Build docs: dub build -b docs
  • Make static library: dub build -c library (or dub build, as library is the default configuration)
  • Make shared library: dub build -c shared

Notes

Profile builds (-b profile)

The profile builds are GC-dependant and thus not supported.

Introduction

Usage

Development

Clone this wiki locally