Compiling Yage

From Yage3D Wiki

Jump to: navigation, search

Contents

[edit] Compiling

These steps explain how to build Yage into an executable file. In the future, Yage will eventually be compiled as a dynamic library, but for now everything is compiled as a single binary.

[edit] The Build Script

Follow these steps to build Yage on Windows or Linux:

  1. Download and setup the DMD + Tango library bundle (version 0.99.9).
  2. Download the Yage source code and unzip to a directory of your choosing.
  3. Navigate to the build folder of Yage.
  4. Type without quotes "dmd -run buildyage.d". If successful, a yage3d binary will be placed in Yage's bin folder.
  5. src/demo1/main.d is the current entry point. Optionally modify this file to use the engine for any purpose, or modify buildyage.d to set a different main file.

The build script used to work with GDC on Linux with the following modifications.

  • Modify the build script to remove derelict from the import path and add it to the source path. For some reason, linking with the derelict lib files fails so they must be compiled into the engine directly from source.

[edit] Bud

If you have trouble with the above, you might try using Derek Parnell's Build utility for D (Bud) as an alternative. Download it, install it, and make sure it's part of your system's path variable. Navigate to the src folder of Yage and type:

  • Windows:
bud -op -clean yage/demo1/main.d
  • Linux:
bud -op -clean yage/demo1/main.d dl.a

and copy the executable from src/yage to bin before running it.

[edit] Rebuild

A simple Linux shell script for using rebuild exists in the /build folder. It should also be usable on Windows with very little modification.

[edit] Creating Something New

The file src/demo1/main.d currently functions as the program entry point. Replace anything there to create your own programs, or modify the build script to include a different folder as the source path and write your program there.