You can configure the BuildZri program execution via two approches: editing the configuration file or providing CLI arguments.
buildzri.config.json file holds all build configurations of the particular C++ project. This file
is mandatory to start compilation with the BuildZri tool.
Defines the standard C++ version. i.e.,:
Project version. i.e.,:
BZ_VERSION global variable receives this value before the compilation
process. The version string won't be validated, so you use any preferred version number format.
Binary file output of the C++ project. BuildZri automatically appends
.exe to this value on Windows.
Directories to be included into the compiler execution for searching for header files.
Source files to be included into the compiler execution. Supports wildcard definitions with the Python glob syntax.
Additional compiler flags for each compiler implementation. Check the following documentations to learn more about compiler flags:
- GNU C/C++ compiler flags: manual
- Apple Clang LLVM compiler flags: manual
- Microsoft Visual C++ compiler flags: manual
C/C++ preprocessor macro defnitions.
Command-line arguments help you to change the build tool execution behavior without changing the configuration file.
Prints build tool progress into the console. This CLI argument is helpful for diagnosing errors in the pre-compilation stages.
Global variables can be used to change the configuration values dynamically before the compilation process.
You can use global variables with
options configuration keys.
Global variables come with the following syntax.
BuildZri supports the following global variables:
Project version from the configuration file.
Operating system shortname:
The current machine's CPU architecture. This value is obtained with the
Python code snippet.
Shortname of the
BZ_ARCHL value. i.e.,: This variable will return
x64 instead of
The latest commit hash of the Git repository. This value is extracted by using the following Git command via the Python script:
BuildZri is a cross-platform C/C++ build tool, so how to define configuration values for each operating system? Cross-platform configuration objects typically accept the following properties:
*: For all operating systems
linux: For GNU/Linux platforms
darwin: For macOS
windows: For Windows
You can define configurations for each operating system by using the above properties.
For example, the following JSON snippet set platform-specific macros for each operating system and set one generic macro for all operating systems:
This cross-platform definition syntax works with