Site under construction!

Building From Source

Introduction

This tutorial outlines how to build DSFML from source. Building DSFML produces a set of static libraries which combine the C++ binding and the D wrapper code. If you plan on using DUB, you don't need to build DSFML directly and can jump to Building Your First DSFML Program.

Prerequisites:

Building DSFML

build.d

For convenience, DSFML comes with a build script (build.d) to automate the building process. Given that you have all the prerequesites listed above, building DSFML is mot much more complicated than cloning the DSFML repository and running the script.

To run the script, build it with your D compiler of choice and run the produced executable in the top level directory of the cloned repository. After completing, you'll see a newly created lib directory with static libraries. The build script will use the same compilerit was built with to build DSFML.

Examples

In the examples below, it is assumed that your D and C++ compilers are accessable from the command line. Please be aware that on Windows only MSVC is supported as the C++ compiler and the build script will default to building x64 libraries.

Windows and DMD


                       git clone -b v2.4.0-rc.1 https://github.com/jebbs/dsfml
                       cd dsfml
                       git submodule init
                       git submodule update
                       dmd build
                       build
                       

Linux and GDC


                       git clone -b v2.4.0-rc.1 https://github.com/jebbs/dsfml
                       cd dsfml
                       git submodule init
                       git submodule update
                       gdc build.d -obuild
                       ./build
                       

Any OS and rdmd


                       git clone -b v2.4.0-rc.1 https://github.com/jebbs/dsfml
                       cd dsfml
                       git submodule init
                       git submodule update
                       rdmd build
            

For more information about what the script can do, pass the executable --help or -h.