With code coverage

April 11, 2026 ยท View on GitHub

Dependencies

ModernCore requires the following libraries:

Core Dependencies

  • cairo
  • lcms2
  • libexif
  • libheif
  • libjpeg
  • libjxl
  • liblz4
  • libpng
  • libraw
  • librsvg
  • libsixel
  • libtiff
  • libwebp
  • OpenEXR
  • pugixml
  • zlib (zlib-ng recommended)

iv Dependencies

  • Vulkan
  • wayland-client
  • wayland-protocols
  • xkbcommon

Build Dependencies

  • CMake
  • C++ compiler
  • Python
  • shaderc (only required when building iv)

Build Recommendations

  • ninja
  • clang
  • mold
  • ccache

Test Dependencies

  • Catch2 3.x
  • LLVM tools (for coverage: llvm-profdata, llvm-cov)

Building

# Debug build
cmake --preset debug
ninja -C build

# Release build
cmake --preset release
ninja -C build-release

# Static release
cmake --preset static
ninja -C build-static

# With profiler (Tracy)
cmake --preset profile
ninja -C build-profile

# With ThreadSanitizer
cmake --preset tsan
ninja -C build-tsan

# With code coverage
cmake --preset coverage
ninja -C build-coverage

Manual Configuration

cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
ninja -C build

Build Options

OptionDefaultDescription
MARCH_NATIVEONEnable -march=native for SIMD
BUILD_SHARED_LIBSONBuild shared libraries
BUILD_IVONBuild iv Wayland image viewer (requires Vulkan and Wayland)
BUILD_MCOREOFFBuild legacy mcore binary
BUILD_TESTSON when top-levelEnable unit testing (requires Catch2)
TRACY_ENABLEOFFEnable Tracy profiler
COVERAGEOFFEnable code coverage
SANITIZE""Sanitizer flags (e.g., thread)

Examples

# Portable build (no native CPU optimizations, require AVX2 + FMA)
cmake --preset release -DMARCH_NATIVE=OFF -DCMAKE_CXX_FLAGS="-march=x86-64-v3"

# Show coverage
cmake --preset coverage
ninja -C build-coverage coverage-report

Testing

# Run tests
ninja -C build test

Installation

cmake --install build --prefix /usr/local

Note: Installation requires proper permissions and path configuration. The executables can also be run directly from the build directory without installation.

Platform Notes

ModernCore is developed on current versions of libraries and requires:

  • C++20 compiler support
  • Vulkan 1.4 (for iv)
  • Wayland compositor (for iv)
  • Terminal with Kitty graphics protocol support (for vv full functionality)

Building only vv

If you are only interested in the terminal image viewer vv and don't have Vulkan or Wayland installed, you can skip building iv:

cmake --preset release -DBUILD_IV=OFF
ninja -C build-release

This removes the requirement for Vulkan, wayland-client, wayland-protocols, xkbcommon, and shaderc.