aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2024-02-17 20:52:06 +0100
committerJay Berkenbilt <ejb@ql.org>2024-02-17 20:55:00 +0100
commit93cf8156b0c356be988edf4c2d22e153be9b2792 (patch)
tree8dade2ae2f37e792f920dab730c8e0832bbfd7a1 /CMakeLists.txt
parentd8f64a8a942bd90b1c74a89e4e59ea2be163e43f (diff)
downloadqpdf-93cf8156b0c356be988edf4c2d22e153be9b2792.tar.zst
Add ENABLE_COVERAGE option to build
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 89a28302..8a3d5f5a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,6 +72,7 @@ CMAKE_DEPENDENT_OPTION(
BUILD_DOC_DIST "Create distribution of manual" ON
"BUILD_DOC_PDF;BUILD_DOC_HTML" OFF)
+option(ENABLE_COVERAGE "Enable coverage reporting" OFF)
option(BUILD_SHARED_LIBS "Build qpdf shared libraries" ON)
option(BUILD_STATIC_LIBS "Build qpdf static libraries" ON)
option(QTEST_COLOR "Whether qtest's output should be in color" ON)
@@ -296,6 +297,11 @@ set(CPACK_RESOURCE_FILE_LICENSE "${qpdf_SOURCE_DIR}/LICENSE.txt")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://qpdf.sourceforge.io/")
set(CPACK_NSIS_MUI_ICON "${qpdf_SOURCE_DIR}/logo/qpdf.ico")
+if(ENABLE_COVERAGE)
+ add_compile_options(--coverage -O0)
+ add_link_options(--coverage)
+endif()
+
include(CPack)
# Install components -- documented in _installation in