Build system

#load "build/"

Compiler integrated build pipeline. Build pipline can be used to manage whole project compilation process directly in BL. All you need is to create the build file called and specify the build_entry function inside. When -b flag is used without need of specifying any files, the compiler will lookup file in the current directory and execute it in compile time. All compilation steps, assembly input and output can be specified here. Example: Build System.

Example of minimal

build :: fn () #build_entry {
    // create new executable assembly
    exe :: add_executable("MyProgram");

    // add '' file into the assembly 'exe'
    add_unit(exe, "");

Start build pipeline using our file:

$ blc -build

Compiler will automatically use file as build script and execute build function in compile time. SDK file build/ containing compiler API for build pipeline manipulation is loaded implicitly.


Build API is available only in compile-time.


Create new assembly

Assembly is a single build target defined as consisting of build Units representing source files needed for compilation. It’s basically a target compiled into an executable or binary file. Use add_executable function to specify your assembly. There are several options related to assembly, described later in this documentation.

exe :: add_assembly("MyProgram");

Add file into assembly

Use add_unit function to add source files into the assembly. There is no need to add all files you want to use, general load and import will do so automatically. Only main or entry files must be included.

add_unit(exe, "");

Specify output directory

Output directory is a directory where all compiler-produced files will be written (i.e. native executables). Use set_output_dir function to specify this directory, current directory is used by default.

set_output_dir(exe, "bin");

Command line argumets

All argumets passed after -build|-b compiler flag are automatically forwarded into command_line_arguments global variable.