bu.um
NOTE: This module contains other exported functions for low-level access to the generation API, which are not documented here.
type Target
type Target* = enum(int32) {
def
linux
linux_musl
linux_glibc
windows
emscripten
}
type Build
type Build* = struct {
//}
type Compile
type Compile* = struct {
//}
type LazyPath
type LazyPath* = struct {
path: str
}
Represents a path in the source directory.
type RawString
type RawString* = struct {
s: str
}
String directly output to the generated build.zig
fn Build.fatal
fn (b: ^Build) fatal*(s: str) {
Stops the build process with a message.
fn Build.path
fn (b: ^Build) path*(p: str): LazyPath {
Returns a LazyPath
fn Build.forTarget
fn (b: ^Build) forTarget*(t: Target, f: fn(b: ^Build)) {
Runs a function only if compiling for target t
.
fn Build.forTargets
fn (b: ^Build) forTargets*(targets: []Target, f: fn(b: ^Build)) {
Runs a function only if compiling for any of the targets. If a building for multiple targets, the function will be run for each of them.
fn Build.include
fn (b: ^Build) include*(f: fn(b: ^Build), par: struct{
srcDir: str
installDir: str
}) {
Includes another build function in this build. The source and output directories can be parametrized.
fn Build.addInstallDirectory
fn (b: ^Build) addInstallDirectory*(options: struct {
sourceDir: LazyPath
installDir: str
excludeExtensions: []str
includeExtensions: []str
}) {
Installs a directory sourceDir
to installDir
excludeExtensions
- if not empty excludes extensions in this arrayincludeExtensions
- if not empty, installs only files with extensions in this array
fn Build.addInstallFile
fn (b: ^Build) addInstallFile*(source: LazyPath, dest: str) {
Installs a file source
to path dest
. dest
must be a full path to
the resulting file (not a directory).
fn addSystemCommand
fn (b: ^Build) addSystemCommand*(argv: []str) {
Runs a system command during the install step.
fn Build.addSharedLibrary
fn (b: ^Build) addSharedLibrary*(name: str): Compile {
Creates a shared library.
NOTE: The library has to be installed with the
Compile.install
method.
fn Build.addExecutable
fn (b: ^Build) addExecutable*(name: str): Compile {
Creates an executable.
NOTE: The executable has to be installed with the
Compile.install
method.
fn Build.addStaticLibrary
fn (b: ^Build) addStaticLibrary*(name: str): Compile {
Creates a shared library.
NOTE: The library has to be installed with the
Compile.install
method.
fn Compile.addAfterIncludePath
fn (c: ^Compile) addAfterIncludePath*(path: LazyPath) {
fn Compile.addAssemblyFile
fn (c: ^Compile) addAssemblyFile*(path: LazyPath) {
fn Compile.addCSourceFile
fn (c: ^Compile) addCSourceFile*(path: LazyPath, flags: []str = {}) {
fn Compile.addFrameworkPath
fn (c: ^Compile) addFrameworkPath*(directory: LazyPath) {
fn Compile.addAfterIncludePath
fn (c: ^Compile) addIncludePath*(directory: LazyPath) {
fn Compile.addLibraryPath
fn (c: ^Compile) addLibraryPath*(directory: LazyPath) {
fn Compile.addObject
fn (c: ^Compile) addObject*(object: Compile) {
fn Compile.addObjectFile
fn (c: ^Compile) addObjectFile*(file: LazyPath) {
fn Compile.addSystemIncludePath
fn (c: ^Compile) addSystemIncludePath*(directory: LazyPath) {
fn Compile.addSystemLibraryPath
fn (c: ^Compile) addSystemLibraryPath*(directory: LazyPath) {
fn Compile.linkLibC
fn (c: ^Compile) linkLibC*() {
fn Compile.linkLibCpp
fn (c: ^Compile) linkLibCpp*() {
fn Compile.linkLibrary
fn (c: ^Compile) linkLibrary*(lib: Compile) {
fn Compile.linkSystemLibrary
fn (c: ^Compile) linkSystemLibrary*(name: str) {
fn Compile.setExecCmd
fn (c: ^Compile) setExecCmd*(args: ..str) {
fn Compile.setVersionScript
fn (c: ^Compile) setVersionScript*(source: LazyPath) {
fn Compile.install
fn (c: ^Compile) install*() {
type Module
type Module* = struct {
fn addModule
fn (b: ^Build) addModule*(source: LazyPath): Module {
Creates an umka module.
NOTE: The module has to be installed with the
Module.install
method.
fn Module.addUMI
fn (m: ^Module) addUMI*(): Compile {
Add an UMI library to the module and return its Compile struct. The library is installed automatically with the module.
fn Module.install
fn (m: ^Module) install*() {
Install the module and its UMI (if any).