Skip to main content

CMake

Dependencies

warning

Ubuntu 23.10 (Mantic Minotaur) ships with a broken lcov package, see this issue. You can install lcov from source or use the version from noble.

Install dependencies
sudo apt install cmake clang llvm lcov

Ubuntu versions >=24.04 also require libclang-rt-dev:

Install libclang-rt-dev
sudo apt install libclang-rt-dev

Version requirements

info

Running CI Fuzz with LLVM versions <= 16 on Linux can cause fuzzing runs to randomly crash. Have a look at the troubleshooting guide for instructions to fix this issue.

Initialize your project

Initialize CI Fuzz in the root directory of your CMake project with the following command:

cifuzz init

Add the following commands before any add_library or add_executable directives to your top level CMakeLists.txt file:

find_package(cifuzz NO_SYSTEM_ENVIRONMENT_PATH)
enable_fuzz_testing()

Example projects