Skip to content

FastBuild: Build Pipelines

Dandielo edited this page Feb 6, 2023 · 6 revisions

Overview

Pipelines define a list of steps and tasks to do for each target that was defined in the workspace. Pipelines can be defined for separate tasks and subsets of sources.

For example, you can have the following two pipelines:

  • C++ pipeline to build executables.
  • ShaderCompiler pipeline to compile shader sources (for ex.: .glsl) to SPIR-V.

Both can co-exist and even be run together or separately.

Definition: Pipeline structures
.Pipeline =
[
    .PipelineName = String /* required */
    .PipelinePlatform = String /* required */
    .PipelineToolchain = String /* required */
    .PipelineArchitecture = String /* required */

    .PipelineSteps = String[] /* required, default: ['Build', 'Link', 'Test'] */
    .PipelineTasks = PipelineTask[] /* required, various defaults */

    .PipelineAllowUnityBuilds = Boolean /* optional, default: false */

    .PipelineVSInfo = PieplineVSInfo /* optional, vs-only */
]

.PipelineTask =
[
    .Step = String /* required */
    .Type = ChoiceOf{ 'Compile', 'Link', 'Test' } /* required */

    .AllowUnityBuilds = Boolean /* optional */

    .TaskRequires = String[] /* optional */

    .TaskCompiler = String /* optional */
    .TaskCompilerFamily = String /* optional, compiler default */

    .TaskInputPattern = String[] /* optional, IBT default */
    .TaskInputAllowNoFiles = Boolean /* optional, default: false */
    .TaskCustomOptions = String /* optional */

    .CompilerOutputExtension = String /* optional or compiler default */
]

.PieplineVSInfo =
[
    .VSEnabled = Boolean /* required */
    .VSToolset = String /* required */
    .VSSuffix = String /* optional */
]

There are currently two default pipelines available to be used, modified or extended uppon.

  • .Pipeline_Windows_x64
  • .Pipeline_Linux_x64

Availability

For a pipeline to be available and enabled, it needs to have access to the given toolchain and platform. Additionally, the targeted architecture needs to be supported by both. If a Platform supports two architectures, but a compiler supports only one of them, only that pair will work.

For example, if a pipeline targets Windows using the Clang toolchain for the x86_64 architecture it will not be enabled unless IBT was successful in finding a clang installation that matches the required toolchain.

In most cases you would use a single toolchain for each platform / target device you are supporting. However, you could also utilize the ability to change pipeline steps and just run specific parts of other toolchains for validation.

For example, this would allow you to quickly validate compilation for Clang and non-unity builds on Windows but also skip the expensive linking step.

Details

v1.2.0 definitions
.Task_BuildSources =
[
    .Step = 'Build'
    .Type = 'Compile'

    .AllowUnityBuilds = true

    .TaskInputPattern = { '*.cpp', '*.cxx' }
]

.Task_BuildResources =
[
    .Step = 'Build'
    .Type = 'Compile'

    .AllowUnityBuilds = false

    .TaskRequires = { 'SDK-Windows-10' }

    .TaskCompiler = 'win10-resource-compiler'
    .TaskCompilerFamily = 'WinRC'

    .TaskInputPattern = { '*.rc' }
    .TaskInputAllowNoFiles = true
    .TaskCustomOptions = ' "%1"'

    .CompilerOutputExtension = '.res'
]

.Task_LinkExecutable =
[
    .Step = 'Link'
    .Type = 'Link'
]

.Task_TestExecutable =
[
    .Step = 'Test'
    .Type = 'Test'

    .TaskRequires = { 'Debug' }
]

.Pipeline_Windows_x64_v142 =
[
    .PipelineName = 'x64-v142'

    .PipelinePlatform = 'Windows'
    .PipelineToolchain = 'msvc-x64-v142'
    .PipelineArchitecture = 'x64'

    .PipelineAllowUnityBuilds = false

    .PipelineSteps = {
        'Build'
        'Link'
        'Test'
    }

    .PipelineTasks = {
        .Task_BuildSources
        .Task_BuildResources
        .Task_LinkExecutable
        .Task_TestExecutable
    }

    .PipelineVSInfo =
    [
        .VSEnabled = true
        .VSToolset = 'v142'
        .VSSuffix = ''
    ]
]

.Pipeline_Windows_x64_v143 =
[
    Using( .Pipeline_Windows_x64_v142 )

    .PipelineName = 'x64'
    .PipelineToolchain = 'msvc-x64-v143'

    .PipelineVSInfo =
    [
        .VSEnabled = true
        .VSToolset = 'v143'
        .VSSuffix = ''
    ]
]

.Pipeline_Linux_x64_gcc12 =
[
    .PipelineName = 'x64'

    .PipelinePlatform = 'Linux'
    .PipelineToolchain = 'gcc-12.0.0'
    .PipelineArchitecture = 'x64'

    .PipelineAllowUnityBuilds = false

    .PipelineSteps = {
        'Build'
        'Link'
    }

    .PipelineTasks = {
        .Task_BuildSources
        .Task_LinkExecutable
    }
]

// Default pipelines
.Pipeline_Windows_x64 = .Pipeline_Windows_x64_v143
.Pipeline_Windows_UWP = .Pipeline_Windows_UWP_v143
.Pipeline_Linux_x64 = .Pipeline_Linux_x64_gcc12

// Default pipeline list
.BuildPipelines = {
    .Pipeline_Windows_x64
    .Pipeline_Linux_x64
}

Pipeline definitions

Pipeline: Windows-x64

This pipeline defaults to the Visual Studio 2019 toolset (v142) and defines four tasks:

  • .Task_BuildSources - Used to compile C++ sources. (.cxx and .cpp)
  • .Task_BuildResources - Used to build Windows SDK resource files. (.rc)
  • .Task_LinkExecutable - Used to link libraries and object files into binaries. (Outputs .dll or .exe)
  • .Task_TestExecutable - Used to run the previously build executable od DLL. (Debug config only)

It comes with three steps: Build, Link and Test

Pipeline: Linux-x64

This pipeline defaults to the Visual Studio 2019 toolset (v142) and defines two tasks:

  • .Task_BuildSources - Used to compile C++ sources. (.cxx and .cpp)
  • .Task_LinkExecutable - Used to link libraries and object files into binaries. (Outputs target executable)

It comes with two steps: Build and Link

Clone this wiki locally