CMake
Dependencies
- Ubuntu/Debian
- Arch
- macOS
- Windows
sudo apt install cmake clang llvm lcov
Note: 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.
sudo pacman -S cmake clang llvm lcov
brew install cmake llvm lcov
choco install lcov
Note: You may have to add %ChocolateyInstall%\lib\lcov\tools\bin
to your PATH variable for it to be found.
Version requirements
Additional Windows version requirement
- Visual Studio 2022 >= 17
Make sure to select "Develop Desktop C++ applications" in the Visual Studio Installer and enable the following individual components:
- "C++ Clang Compiler for Windows"
- "C++ CMake Tools for Windows"
- "MSBuild support for LLVM (clang-cl) toolset"
Windows Limitations
- C/C++ projects cannot depend on shared libraries
- Continuous code coverage is not supported
In order to get font colors and glyphs to render properly install the Windows Terminal
from the Microsoft Store and run cifuzz
in the Developer PowerShell for VS 2022
.
Initialize a 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()