Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ project(sonata VERSION ${SONATA_VERSION})
option(EXTLIB_FROM_SUBMODULES "Use Git submodules for header-only dependencies" OFF)
option(SONATA_PYTHON "Build Python extensions" OFF)
option(SONATA_TESTS "Build tests" ON)

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(SONATA_ENABLE_COVERAGE_DEFAULT ON)
else()
set(SONATA_ENABLE_COVERAGE_DEFAULT OFF)
endif()
option(SONATA_ENABLE_COVERAGE "Enable measuring test coverage." ${SONATA_ENABLE_COVERAGE_DEFAULT})

# For `Findcoverage.cmake` and friends.
set(ENABLE_COVERAGE ${SONATA_ENABLE_COVERAGE})

option(SONATA_CXX_WARNINGS "Compile C++ with warnings as errors, for glibcxx turn on assertions" ON)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake)
Expand All @@ -60,12 +71,6 @@ if(SONATA_CXX_WARNINGS)
set(SONATA_COMPILE_OPTIONS ${SONATA_COMPILE_OPTIONS} -Werror -Wp,-D_GLIBCXX_ASSERTIONS)
endif()

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(ENABLE_COVERAGE ON)
else()
set(ENABLE_COVERAGE OFF)
endif()

# =============================================================================
# Dependencies
# =============================================================================
Expand Down