bbs_build

Introduction

bbs_build is a wrapper script that simplifies invocation of the cmake and provides simple command line interface to the BBS build system.

More specifically, the tool handles the following aspects of the build process:

  1. Creates/selects the build directory for current build configuration.

  2. Selects the compiler and sets up arguments passed to the compiler.

  3. Sets a compiler configuration under Windows OS.

  4. Sets/passes necesssary parameters to the cmake.

bbs_build knowns the environment variables set by the bbs_build_env and will pick up those parameters from the environment if they are not specified in the command line.

Command line

Note

The code samples below assume that the path to the bbs_build script is added to the PATH environment variable.

Full set of supported parameters can be listed by running:

bbs_build --help

Commands

configure

Perform Cmake configuration step. During this step the build directory is created and low-level build system make files are generated.

build

Perform build step. During this step the BDE libraries and (optionally) test drivers are compiled, linked and (optionally) test drivers are executed.

install

Perform installation step. During this step the build artefacts are installed into user specified location.

Common parameters

--build_dir BUILD_DIR

Path to the build directory.

Note

If the parameter is not specfied, the value is taken from the BDE_CMAKE_BUILD_DIR environment variable. If environment variable is not set, the build system generates the name using the current platform, compiler, and ufid. The generated build directory looks like: ./_build/unix-linux-x86_64-2.6.32-gcc-5.4.0-opt_exc_mt_cpp11

-j N, --jobs N

Specify number of jobs to run in parallel.

-v, --verbose

Produce verbose output.

-h, --help

Print the help page.

Parameters for configure command

Those parameters are used by configure command.

-u UFID, --ufid UFID

Unified Flag IDentifier (e.g. “opt_64_cpp17”).

Note

If the parameter is not specified, the value is taken from the BDE_CMAKE_UFID environment variable.

-G GENERATOR

Select the build system for compilation.

Note

If the parameter is not specified, the script will choose the low-level build system (default is ninja).

--toolchain TOOLCHAIN

Path to the CMake toolchain file. See CMake Toolchains for more details on the format of the Cmake toolchain file.

Note

If the parameter is not specified, the script will try to find the generic compiler toolchain file or use the CMake defaults, if no toolchain file is found.

--compiler COMPILER

Specifies the compiler (Windows only). Currently supported compilers are: msvc-2019, msvc-2017, msvc-2015, and msvc-2013. Latest detected version will be set as a default.

--refroot REFROOT

Path to the distribution refroot.

Note

If the parameter is not specified, the value is taken from the DISTRIBUTION_REFROOT environment variable.

--prefix PREFIX

The path prefix in which to look for dependencies for this buils. If --refroot is specified, this prefix is relative to the refroot (default=”/opt/bb”).

Note

This parameter also defines the installation prefix for install command.

--clean

Clean the specified build directory before configuration.

Important

Compiler-specific configuration is generated only on initial configuration and cached by the build system. User must use empty (clean) build directory when switching compilers.

Parameters for build command

--targets TARGET_LIST

Specifies the list of comma separated build targets. There are targets for package groups (bsl/bsl.t), packages (bdlt/bdlt.t) and individual components (ball_log/ball_log.t) and well as high-level target for building everything (all/all.t)

--test {build, run}

Selects whether to build or run the tests. Tests are not built by default. build step.

--timeout TIMEOUT

Specifies the maximum time to run a single test driver. The test driver is terminated if it does not complete within the specified timeout (in seconds).

-k, --keep-going

Continues as much as possible after an error.

Note

Supported by ‘ninja’ and ‘make’ build systems.

--xml-report

Generate xml report when running tests. Reports can be found in the <build_dir>/Testing folder.

Parameters for install command

--component COMPONENT

The name of the component to install. This flag should be used only by the builds helper that do BDE library packaging. When not specified, the command installs headers and libraries for all UORs defined in the repo.

--install_dir INSTALL_DIR

Path to the top level installation directory.