惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
量子位
腾讯CDC
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
The Hacker News
The Hacker News
T
The Exploit Database - CXSecurity.com
B
Blog
S
SegmentFault 最新的问题
P
Privacy & Cybersecurity Law Blog
T
Threatpost
博客园 - 聂微东
T
Tailwind CSS Blog
The Last Watchdog
The Last Watchdog
C
Check Point Blog
N
Netflix TechBlog - Medium
D
DataBreaches.Net
爱范儿
爱范儿
IT之家
IT之家
S
Secure Thoughts
M
MIT News - Artificial intelligence
NISL@THU
NISL@THU
C
Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
有赞技术团队
有赞技术团队
A
Arctic Wolf
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Proofpoint News Feed
Spread Privacy
Spread Privacy
Schneier on Security
Schneier on Security
Simon Willison's Weblog
Simon Willison's Weblog
G
GRAHAM CLULEY
雷峰网
雷峰网
Project Zero
Project Zero
博客园 - Franky
H
Heimdal Security Blog
A
About on SuperTechFans
Security Latest
Security Latest
Webroot Blog
Webroot Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More

PBS activity

Make capypdf a submodule (7f9465b6) · Commits · Inkscape / inkscape · GitLab Draft: Make capypdf a submodule to enable it in the PPA (!7987) · Merge requests · Inkscape / inkscape · GitLab a7a272aeb209d29b500adb09d575af1d89645ffe to f9f9d913e36b14250122d9bc43911b5bb84e958c · PBS / Inkscape · GitLab Make capypdf a submodule (12ee5f11) · Commits · Inkscape / inkscape · GitLab Commits · launchpad-staging · Inkscape / inkscape · GitLab Commits · unmeson · PBS / Inkscape · GitLab Objects can't be moved using arrows keys (#6226) · Issues · Inkscape / inkscape · GitLab Down, left, right arrow keys don't work to move objects (#13628) · Issues · Inkscape / Inbox · GitLab Down, left, right arrow keys don't work to move objects (#13628) · Issues · Inkscape / Inbox · GitLab Draft: Expand tests for boolean operations on paths (!7980) · Merge requests · Inkscape / inkscape · GitLab 1.5-dev: cannot create/open documents after closing window on macOS (#5981) · Issues · Inkscape / inkscape · GitLab Use new Modifiers system for the arc tool (!7961) · Merge requests · Inkscape / inkscape · GitLab Remove dependency on deprecated appdirs module (!730) · Merge requests · Inkscape / extensions · GitLab Commits · appdirs · PBS / extensions · GitLab 1.5-dev: Unable to open the Extension Manager (#6202) · Issues · Inkscape / inkscape · GitLab PBS pushed to project branch capypdf-static at PBS / Inkscape PBS pushed to project branch capypdf-static at PBS / Inkscape Make internal capypdf static (!7947) · Merge requests · Inkscape / inkscape · GitLab Shape builder tool does not detect the interior region (#4477) · Issues · Inkscape / inkscape · GitLab Make (most) tests build and run on Windows (!7940) · Merge requests · Inkscape / inkscape · GitLab Generate AppImage with quick-sharun (a465f4ce) · Commits · PBS / Inkscape · GitLab Commits · sharun · PBS / Inkscape · GitLab 1.5-dev: Split mode state is incorrect in the menu when opening a new document (#6135) · Issues · Inkscape / inkscape · GitLab PBS deleted project branch deadlock-win at PBS / Inkscape 1.5-dev: (Windows) Deadlock on quit, process not exiting sometimes (#6003) · Issues · Inkscape / inkscape · GitLab Fix dark mode on gtk 4.20 (!7932) · Merge requests · Inkscape / inkscape · GitLab Fix some resizing issues on Windows by not setting GTK_CSD (!7931) · Merge requests · Inkscape / inkscape · GitLab Draft: Fix AppImage crashing during save on older distros (!7922) · Merge requests · Inkscape / inkscape · GitLab 19086deebf770c8932b403ee536c8f8562a376f9 to 55362ef7d4c363d9613d70ac7194de7e8e323a34 · PBS / Inkscape · GitLab c74f78ca23ff302b7b59175490b870f1a616b778 to 19086deebf770c8932b403ee536c8f8562a376f9 · PBS / Inkscape · GitLab acf9cb2511a84e64f6009a1f23078da8ff51485a to c74f78ca23ff302b7b59175490b870f1a616b778 · PBS / Inkscape · GitLab Fix objects dialog search crash with missing object ID (!7918) · 合并请求 · Inkscape / inkscape · GitLab "Manage Extensions" throws error with AppImage (#5787) · Issues · Inkscape / inkscape · GitLab ca8baeeb44cbf234ffefa9da10974fb713d1e51a to 1a4da430266ea3d674bc5dc49106bacb6528e099 · PBS / Inkscape · GitLab 84543dab97c1f116e9636f149a031f2256199c87 to c7d8378ccc109bdb2ed30f0c8407725e93ffdd9b · Inkscape / lib2geom · GitLab Update split mode on tab switch (!7915) · Merge requests · Inkscape / inkscape · GitLab inset/offset as app functions so they can be used from CLI (!7914) · Merge requests · Inkscape / inkscape · GitLab Update split mode on tab switch (21bbbaa7) · Commits · PBS / Inkscape · GitLab Commits · split-mode-tab · PBS / Inkscape · GitLab Update split mode on tab switch (7fdf74dd) · Commits · Inkscape / inkscape · GitLab [Regression] Right-aligned text has a new gap in 1.4.4 (#6130) · Issues · Inkscape / inkscape · GitLab 55362ef7d4c363d9613d70ac7194de7e8e323a34 to a2b678d5ad5ae2ee02aa4d7d0ec7a856048190c0 · PBS / Inkscape · GitLab Speed up ungroup on thousands of items (!7908) · Merge requests · Inkscape / inkscape · GitLab AppImage build does not support OpenGL mode (#3428) · Issues · Inkscape / inkscape · GitLab Pressure sensitivity broken in AppImage (#5962) · Issues · Inkscape / inkscape · GitLab 3bd629c13b87c4ab2af3d126f86ddcc8bbf2f149 to ca8baeeb44cbf234ffefa9da10974fb713d1e51a · PBS / Inkscape · GitLab Fix breakage with Ubuntu 26.04 CI (!7904) · 合并请求 · Inkscape / inkscape · GitLab 242c9b14b996730e92eae6015fead1cf3cc2d8e9 to 3bd629c13b87c4ab2af3d126f86ddcc8bbf2f149 · PBS / Inkscape · GitLab Fix breakage with Ubuntu 26.04 CI (c7d8378c) · 提交 · PBS / lib2geom · GitLab Update more reference images (242c9b14) · 提交 · PBS / Inkscape · GitLab 1daba12d820308823d302201e3cf2eafbaac1ac6 to 0aa687aa9bafa055619749a9867e536b80ece385 · PBS / Inkscape · GitLab 647ee7f47a87a5c87285487d3c6029acf635ed01 to 469601f7445709b71dd3b8670333d7e1b49d86fb · PBS / lib2geom · GitLab Use supersampling to reduce fuzz, update reference images (1daba12d) · 提交 · PBS / Inkscape · GitLab Update peppercarrot reference image (cc92988a) · 提交 · PBS / Inkscape · GitLab Fix CJK / Hebrew problems (1ea593ef) · 提交 · PBS / Inkscape · GitLab Add argument file to bypass Windows command length limits (!7899) · 合并请求 · Inkscape / inkscape · GitLab Fix some tests (20705d53) · Commits · PBS / Inkscape · GitLab Update Color API preparing for new Rendering Engine (!7894) · Merge requests · Inkscape / inkscape · GitLab New UX for text in shape and text in path (!7827) · Merge requests · Inkscape / inkscape · GitLab Fix tests in debian packaging (!7838) · Merge requests · Inkscape / inkscape · GitLab Draft: Upgrade to Ubuntu 26.04 (!64) · Merge requests · Inkscape / inkscape-ci-docker · GitLab Draft: Fix breakage with Ubuntu 26.04 CI (!148) · Merge requests · Inkscape / lib2geom · GitLab [DRAFT] Temporarily disable lpe tests (a2995490) · Commits · PBS / Inkscape · GitLab aa6bd703d4a5ed9d81838ec3ed16da623bc742b1 to 2ab70cbfd1a9e6707a14099ea0c0c11ae3134e7f · PBS / Inkscape · GitLab db745239d11d97540b6cae0872ac61ef59008e24 to 647ee7f47a87a5c87285487d3c6029acf635ed01 · PBS / lib2geom · GitLab ed16d3e6e8f776b32b54919d982459479f832325 to aa6bd703d4a5ed9d81838ec3ed16da623bc742b1 · PBS / Inkscape · GitLab Fix breakage with Ubuntu 26.04 CI (db745239) · Commits · PBS / lib2geom · GitLab Commits · resolute · PBS / lib2geom · GitLab Commits · resolute · PBS / Inkscape · GitLab Commits · resolute · PBS / inkscape-ci-docker · GitLab Upgrade to Ubuntu 26.04 (c283b8d1) · Commits · Inkscape / inkscape-ci-docker · GitLab Implement support for all color font formats. 1.5.x (!7565) · Merge requests · Inkscape / inkscape · GitLab Refactor paint server data so the renderer works from data (!7859) · Merge requests · Inkscape / inkscape · GitLab Fix page repainting when document y-axis is flipped (!7861) · Merge requests · Inkscape / inkscape · GitLab Add custom color palette support to bitmap tracing with novel color quantization algorithm (!7862) · Merge requests · Inkscape / inkscape · GitLab PBS deleted project branch various-fixes at PBS / lib2geom Duplicated expression in if statement inside path-intersection.cpp (#27) · Issues · Inkscape / lib2geom · GitLab 2geom.pc.in hardcodes "lib" for libdir (#81) · Issues · Inkscape / lib2geom · GitLab IntPoint / double = IntPoint (should be Point) (#76) · Issues · Inkscape / lib2geom · GitLab EllipticalArc::pointAndDerivatives() returns too many derivatives (#83) · Issues · Inkscape / lib2geom · GitLab b1273d10b17f7c0fa23016c12477577ce667b8cf to 84543dab97c1f116e9636f149a031f2256199c87 · Inkscape / lib2geom · GitLab ad6bc46c3a1186b640711410a05406e07c1b9eae to 290d47f6d9d60d5be0d5a76856339b0ff5695c4d · PBS / Inkscape · GitLab Fix dispatch_pool hang on exit on Windows (!7794) · Merge requests · Inkscape / inkscape · GitLab 4d22039de3d9c2ae1a6337852e55bed06b20193b to f529b2aace8ad98fdcadcb50da810163215512bb · Inkscape / inkscape · GitLab Do not run any build-time tests when building the deb package (!7792) · Merge requests · Inkscape / inkscape · GitLab Make internal capypdf static (bf1e16d7) · Commits · PBS / Inkscape · GitLab Commits · capypdf-static · PBS / Inkscape · GitLab Make internal capypdf static (61bdd93d) · Commits · PBS / Inkscape · GitLab Make internal capypdf static (17be81e7) · Commits · PBS / Inkscape · GitLab Make internal capypdf static (7e09228f) · Commits · PBS / Inkscape · GitLab Make internal capypdf static (0a5473eb) · Commits · PBS / Inkscape · GitLab Make internal capypdf static (e32360c2) · Commits · PBS / Inkscape · GitLab Make internal capypdf static (202e9499) · Commits · PBS / Inkscape · GitLab Make internal capypdf static (64b041bb) · Commits · PBS / Inkscape · GitLab Make internal capypdf static (1a9d977c) · Commits · PBS / Inkscape · GitLab Make internal capypdf static (7a095661) · Commits · PBS / Inkscape · GitLab Make internal capypdf static (b9ac0d79) · Commits · PBS / Inkscape · GitLab Make internal capypdf static (dc2381e3) · Commits · PBS / Inkscape · GitLab Make internal capypdf static (fcb272c3) · Commits · PBS / Inkscape · GitLab Make internal capypdf static (c9323296) · Commits · Inkscape / inkscape · GitLab
Fix breakage with Ubuntu 26.04 CI (6e40e833) · Commits · PBS / lib2geom · GitLab
PBS · 2026-04-19 · via PBS activity
Commit 6e40e833 authored by PBS's avatar PBS
Browse files
* Update CodeCoverage.cmake from upstream to fix warnings.
* Update minimum CMake version of dependent-project.
+114 −32
Original line number Diff line number Diff line
@@ -87,6 +87,9 @@
#     - fix append_coverage_compiler_flags_to_target to correctly add flags
#     - replace "-fprofile-arcs -ftest-coverage" with "--coverage" (equivalent)
#
# 2026-01-20, Michał Sawicz
#     - add `-fprofile-update=atomic` flag, if supported, for concurrent test runs
#
# USAGE:
#
# 1. Copy this file into your cmake modules path.
@@ -140,19 +143,30 @@ include(CMakeParseArguments)
option(CODE_COVERAGE_VERBOSE "Verbose information" FALSE)

# Check prereqs
find_program( GCOV_PATH gcov )
find_program( GCOV_PATH NAMES gcov )
find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl )
find_program( FASTCOV_PATH NAMES fastcov fastcov.py )
find_program( GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat )
find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test)
find_program( GCOVR_PATH NAMES gcovr )
find_program( CPPFILT_PATH NAMES c++filt )

if(NOT GCOV_PATH)
    message(FATAL_ERROR "gcov not found! Aborting...")
endif() # NOT GCOV_PATH

if(LCOV_PATH)
    set(lcov_message "Found Lcov: ${LCOV_PATH}")
    execute_process(COMMAND ${LCOV_PATH} "--version" OUTPUT_VARIABLE LCOV_VERSION_OUTPUT)
    if("${LCOV_VERSION_OUTPUT}" MATCHES "lcov: LCOV version ([0-9]+\\.[0-9]+(\\.[0-9]+)?)(-[0-9])?\n")
        set(LCOV_VERSION "${CMAKE_MATCH_1}")
        string(APPEND lcov_message " (found version ${LCOV_VERSION})")
    endif()
    message(STATUS "${lcov_message}")
endif()

# Check supported compiler (Clang, GNU and Flang)
get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
list(REMOVE_ITEM LANGUAGES NONE)
foreach(LANG ${LANGUAGES})
  if("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
    if("${CMAKE_${LANG}_COMPILER_VERSION}" VERSION_LESS 3)
@@ -166,24 +180,83 @@ endforeach()

set(COVERAGE_COMPILER_FLAGS "-g --coverage"
    CACHE INTERNAL "")

# This is necessary because older versions of ccache don't yet have these:
# https://github.com/ccache/ccache/commit/2737d79e282de72d1b29128f437173e4892ced5e
# https://github.com/ccache/ccache/pull/1408
function(_coverage_atomic_update_flag out_var lang)
    set(_atomic_update_flag "-fprofile-update=atomic")
    set(_coverage_uses_ccache OFF)
    foreach(_launcher IN LISTS CMAKE_${lang}_COMPILER_LAUNCHER)
        if(_launcher MATCHES "ccache(\\.exe)?$")
            # Check that ccache version is less than 4.10.
            execute_process(COMMAND ${_launcher} --version OUTPUT_VARIABLE CACHE_VERSION_OUTPUT)
            if("${CACHE_VERSION_OUTPUT}" MATCHES "ccache version ([0-9]+\\.[0-9]+\\.[0-9]+)")
                if("${CMAKE_MATCH_1}" VERSION_LESS "4.10.0")
                    set(_coverage_uses_ccache ON)
                    break()
                endif()
            endif()
        endif()
    endforeach()
    if(_coverage_uses_ccache)
        set(_atomic_update_flag "--ccache-skip -fprofile-update=atomic")
    endif()
    set(${out_var} "${_atomic_update_flag}" PARENT_SCOPE)
endfunction()

set(COVERAGE_CXX_COMPILER_FLAGS ${COVERAGE_COMPILER_FLAGS})
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
    include(CheckCXXCompilerFlag)
    check_cxx_compiler_flag(-fprofile-abs-path HAVE_fprofile_abs_path)
    if(HAVE_fprofile_abs_path)
        set(COVERAGE_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path")
    check_cxx_compiler_flag(-fprofile-abs-path HAVE_cxx_fprofile_abs_path)
    if(HAVE_cxx_fprofile_abs_path)
        set(COVERAGE_CXX_COMPILER_FLAGS "${COVERAGE_CXX_COMPILER_FLAGS} -fprofile-abs-path")
    endif()
    check_cxx_compiler_flag(-fprofile-update=atomic HAVE_cxx_fprofile_update_atomic)
    if(HAVE_cxx_fprofile_update_atomic)
        _coverage_atomic_update_flag(COVERAGE_ATOMIC_UPDATE_FLAG CXX)
        set(COVERAGE_CXX_COMPILER_FLAGS "${COVERAGE_CXX_COMPILER_FLAGS} ${COVERAGE_ATOMIC_UPDATE_FLAG}")
    endif()
endif()

set(COVERAGE_C_COMPILER_FLAGS ${COVERAGE_COMPILER_FLAGS})
if(CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang)")
    include(CheckCCompilerFlag)
    check_c_compiler_flag(-fprofile-abs-path HAVE_c_fprofile_abs_path)
    if(HAVE_c_fprofile_abs_path)
        set(COVERAGE_C_COMPILER_FLAGS "${COVERAGE_C_COMPILER_FLAGS} -fprofile-abs-path")
    endif()
    check_c_compiler_flag(-fprofile-update=atomic HAVE_c_fprofile_update_atomic)
    if(HAVE_c_fprofile_update_atomic)
        _coverage_atomic_update_flag(COVERAGE_ATOMIC_UPDATE_FLAG C)
        set(COVERAGE_C_COMPILER_FLAGS "${COVERAGE_C_COMPILER_FLAGS} ${COVERAGE_ATOMIC_UPDATE_FLAG}")
    endif()
endif()

set(COVERAGE_Fortran_COMPILER_FLAGS ${COVERAGE_COMPILER_FLAGS})
if(CMAKE_Fortran_COMPILER_ID MATCHES "(GNU|Clang)")
    include(CheckFortranCompilerFlag)
    check_fortran_compiler_flag(-fprofile-abs-path HAVE_fortran_fprofile_abs_path)
    if(HAVE_fortran_fprofile_abs_path)
        set(COVERAGE_Fortran_COMPILER_FLAGS "${COVERAGE_Fortran_COMPILER_FLAGS} -fprofile-abs-path")
    endif()
    check_fortran_compiler_flag(-fprofile-update=atomic HAVE_fortran_fprofile_update_atomic)
    if(HAVE_fortran_fprofile_update_atomic)
        _coverage_atomic_update_flag(COVERAGE_ATOMIC_UPDATE_FLAG Fortran)
        set(COVERAGE_Fortran_COMPILER_FLAGS "${COVERAGE_Fortran_COMPILER_FLAGS} ${COVERAGE_ATOMIC_UPDATE_FLAG}")
    endif()
endif()

set(CMAKE_Fortran_FLAGS_COVERAGE
    ${COVERAGE_COMPILER_FLAGS}
    ${COVERAGE_Fortran_COMPILER_FLAGS}
    CACHE STRING "Flags used by the Fortran compiler during coverage builds."
    FORCE )
set(CMAKE_CXX_FLAGS_COVERAGE
    ${COVERAGE_COMPILER_FLAGS}
    ${COVERAGE_CXX_COMPILER_FLAGS}
    CACHE STRING "Flags used by the C++ compiler during coverage builds."
    FORCE )
set(CMAKE_C_FLAGS_COVERAGE
    ${COVERAGE_COMPILER_FLAGS}
    ${COVERAGE_C_COMPILER_FLAGS}
    CACHE STRING "Flags used by the C compiler during coverage builds."
    FORCE )
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
@@ -206,10 +279,6 @@ if(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG))
    message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading")
endif() # NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG)

if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
    link_libraries(gcov)
endif()

# Defines a target for running and collection code coverage information
# Builds dependencies, runs the given executable and outputs reports.
# NOTE! The executable should always have a ZERO as exit code otherwise
@@ -221,6 +290,8 @@ endif()
#     DEPENDENCIES testrunner                     # Dependencies to build first
#     BASE_DIRECTORY "../"                        # Base directory for report
#                                                 #  (defaults to PROJECT_SOURCE_DIR)
#     DATA_DIRECTORY "./"                         # Data directory
#                                                 #  (defaults to PROJECT_BINARY_DIR)
#     EXCLUDE "src/dir1/*" "src/dir2/*"           # Patterns to exclude (can be relative
#                                                 #  to BASE_DIRECTORY, with CMake 3.4+)
#     NO_DEMANGLE                                 # Don't demangle C++ symbols
@@ -229,7 +300,7 @@ endif()
function(setup_target_for_coverage_lcov)

    set(options NO_DEMANGLE SONARQUBE)
    set(oneValueArgs BASE_DIRECTORY NAME)
    set(oneValueArgs BASE_DIRECTORY DATA_DIRECTORY NAME)
    set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS GENHTML_ARGS)
    cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

@@ -263,15 +334,21 @@ function(setup_target_for_coverage_lcov)
        set(GENHTML_EXTRA_ARGS "--demangle-cpp")
    endif()

    if(DEFINED Coverage_DATA_DIRECTORY)
        set(LCOV_DATA_DIRECTORY ${Coverage_DATA_DIRECTORY})
    else()
        set(LCOV_DATA_DIRECTORY ${PROJECT_BINARY_DIR})
    endif()

    # Setting up commands which will be run to generate coverage data.
    # Cleanup lcov
    set(LCOV_CLEAN_CMD
        ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -directory .
        ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory ${LCOV_DATA_DIRECTORY}
        -b ${BASEDIR} --zerocounters
    )
    # Create baseline to make sure untouched files show up in the report
    set(LCOV_BASELINE_CMD
        ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d . -b
        ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d ${LCOV_DATA_DIRECTORY} -b
        ${BASEDIR} -o ${Coverage_NAME}.base
    )
    # Run tests
@@ -280,7 +357,7 @@ function(setup_target_for_coverage_lcov)
    )
    # Capturing lcov counters and generating report
    set(LCOV_CAPTURE_CMD
        ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory . -b
        ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory ${LCOV_DATA_DIRECTORY} -b
        ${BASEDIR} --capture --output-file ${Coverage_NAME}.capture
    )
    # add baseline counters
@@ -302,7 +379,7 @@ function(setup_target_for_coverage_lcov)
        # Generate SonarQube output
        set(GCOVR_XML_CMD
            ${GCOVR_PATH} --sonarqube ${Coverage_NAME}_sonarqube.xml -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS}
            ${GCOVR_EXCLUDE_ARGS} --object-directory=${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}
            ${GCOVR_EXCLUDE_ARGS} --object-directory=${PROJECT_BINARY_DIR}
        )
        set(GCOVR_XML_CMD_COMMAND
            COMMAND ${GCOVR_XML_CMD}
@@ -371,19 +448,19 @@ function(setup_target_for_coverage_lcov)
        WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
        DEPENDS ${Coverage_DEPENDENCIES}
        VERBATIM # Protect arguments to commands
        COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
        COMMENT "Resetting code coverage counters to zero. Processing code coverage counters and generating report."
    )

    # Show where to find the lcov info report
    add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
        COMMAND ;
        COMMAND true
        COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info."
        ${GCOVR_XML_CMD_COMMENT}
    )

    # Show info where to find the report
    add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
        COMMAND ;
        COMMAND true
        COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
    )

@@ -476,7 +553,7 @@ function(setup_target_for_coverage_gcovr_xml)

    # Show info where to find the report
    add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
        COMMAND ;
        COMMAND true
        COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml."
    )
endfunction() # setup_target_for_coverage_gcovr_xml
@@ -544,7 +621,7 @@ function(setup_target_for_coverage_gcovr_html)
    # Running gcovr
    set(GCOVR_HTML_CMD
        ${GCOVR_PATH} --html ${Coverage_NAME}/index.html --html-details -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS}
        ${GCOVR_EXCLUDE_ARGS} --object-directory=${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}
        ${GCOVR_EXCLUDE_ARGS} --object-directory=${PROJECT_BINARY_DIR}
    )

    if(CODE_COVERAGE_VERBOSE)
@@ -577,7 +654,7 @@ function(setup_target_for_coverage_gcovr_html)

    # Show info where to find the report
    add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
        COMMAND ;
        COMMAND true
        COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
    )

@@ -726,17 +803,22 @@ function(setup_target_for_coverage_fastcov)
endfunction() # setup_target_for_coverage_fastcov

function(append_coverage_compiler_flags)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
    set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
    message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}")
    foreach(LANG ${LANGUAGES})
        set(CMAKE_${LANG}_FLAGS "${CMAKE_${LANG}_FLAGS} ${CMAKE_${LANG}_FLAGS_COVERAGE}" PARENT_SCOPE)
        message(STATUS "Appending code coverage compiler flags for ${LANG}: ${CMAKE_${LANG}_FLAGS_COVERAGE}")
    endforeach()
    if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
        link_libraries(gcov)
    endif()
endfunction() # append_coverage_compiler_flags

# Setup coverage for specific library
function(append_coverage_compiler_flags_to_target name)
    separate_arguments(_flag_list NATIVE_COMMAND "${COVERAGE_COMPILER_FLAGS}")
    target_compile_options(${name} PRIVATE ${_flag_list})
    if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
    foreach(LANG ${LANGUAGES})
        separate_arguments(_flag_list NATIVE_COMMAND "${CMAKE_${LANG}_FLAGS_COVERAGE}")
        target_compile_options(${name} PRIVATE $<$<COMPILE_LANGUAGE:${LANG}>:${_flag_list}>)
    endforeach()
    if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
        target_link_libraries(${name} PRIVATE gcov)
    endif()
endfunction()
+4 −4
Original line number Diff line number Diff line
cmake_minimum_required(VERSION 3.1)
project(test_dep_2geom CXX C)
set(CMAKE_CXX_STANDARD 17)
cmake_minimum_required(VERSION 3.12)
project(test_dep_2geom CXX)
set(CMAKE_CXX_STANDARD 20)

option(2GEOM_AS_SUBPROJECT "include 2geom as subproject" OFF)