C++ Build System Deep Dive

The recommended approach to build the project is as out-of-source build in the build folder. This project comes with a Makefile that provides a set of commands that help with developer workflows. You can see some of the commands if you want to add some of the more advanced commands.

For a base build you just have to run:

cmake -Bbuild

This by default configures without any of the extra build tasks (such as building shaders) and compiles without the optional dependencies. The table below provides more detail.




Enables local installation (which won’t require admin privileges)


This is the path for your package manager if you use it such as vcpkg


Enable if you wish to build and run the tests (must have deps installed.


Enable if you wish to build the docs (must have docs deps installed)


Option to build the single header file using “quom” utility


Allows you to pass extra config flags to compiler


Disables the install step in the cmake file (useful for android build)


Enables android build which includes and excludes relevant libraries

Compile Flags




Ensure the return value of createPipeline is processed as ResultValue instead of Result


Sets the default api version to use for vulkan kompute api


Major version to use for the Vulkan API


Minor version to use for the Vulkan API


Enables the build with SPDLOG and FMT dependencies (must be installed)


Does not define the SPDLOG_ macros if these are to be overridden


The level for the log level on compile level (whether spdlog is enabled)


Flag to enable android imports in kompute (enabled with -DKOMPUTE_OPT_ANDROID_BUILD)


Enable release build (enabled by cmake release build)


Enable debug build including debug flags (enabled by cmake debug build)


Disable the debug Vulkan layers, mainly used for android builds


Disable the shader utils and skip adding glslang as dependency


Given Kompute is expected to be used across a broad range of architectures and hardware, it will be important to make sure we are able to minimise dependencies.

Required dependencies

The only required dependency in the build is Vulkan. More specifically, the header files vulkan.h and vulkan.hpp, which are both part of the Vulkan SDK. If you haven’t installed the Vulkan SDK yet, you can download it here.

Optional dependencies

SPDLOG is the preferred logging library, however by default Vulkan Kompute runs without SPDLOG by overriding the macros. It also provides an easy way to override the macros if you prefer to bring your own logging framework. The macro override is the following:

#ifndef KOMPUTE_LOG_OVERRIDE // Use this if you want to define custom macro overrides
#if KOMPUTE_SPDLOG_ENABLED // Use this if you want to enable SPDLOG
#include <spdlog/spdlog.h>
// ... Otherwise it adds macros that use std::cout (and only print first element)

You can choose to build with or without SPDLOG by using the cmake flag KOMPUTE_OPT_ENABLE_SPDLOG.

Finally, remember that you will still need to set both the compile time log level with SPDLOG_ACTIVE_LEVEL, and the runtime log level with spdlog::set_level(spdlog::level::debug);.