Builder

Builds and executes Zig subcommands.

Constructors

this
this(bool useCpp)

Creates a builder for Zig cc or c++.

Members

Functions

addArg
Builder addArg(string arg)

Adds a compiler flag, ignoring source files and target options.

addArgs
Builder addArgs(string[] args)

Adds multiple compiler flags.

build
string[] build()

Builds the Zig command with sanitizer flags if needed.

buildLibrary
int buildLibrary(string libpath, bool isShared)

Builds a static or dynamic library with Zig build-lib.

execute
int execute()

Executes the Zig command, printing flags in debug mode.

file
Builder file(string file)

Adds a source file, enabling C++ mode for .cpp/.cxx/.cc/.c++ files.

files
Builder files(string[] files)

Adds multiple source files.

setCpu
Builder setCpu(string cpu)

Sets CPU features.

setTargetTriple
Builder setTargetTriple(string triple)

Sets the target triple, transforming Apple and GNU-style triples.

Meta