diff --git a/cmake/CodeCoverage.cmake b/cmake/CodeCoverage.cmake index 1803fd8a1..b65b4a10b 100644 --- a/cmake/CodeCoverage.cmake +++ b/cmake/CodeCoverage.cmake @@ -215,6 +215,16 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") if(HAVE_c_fprofile_abs_path) set(COVERAGE_C_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path") endif() + + check_cxx_compiler_flag(-fprofile-update=atomic HAVE_cxx_fprofile_update) + if(HAVE_cxx_fprofile_update) + set(COVERAGE_CXX_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-update=atomic") + endif() + + check_c_compiler_flag(-fprofile-update=atomic HAVE_c_fprofile_update) + if(HAVE_c_fprofile_update) + set(COVERAGE_C_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-update=atomic") + endif() endif() set(CMAKE_Fortran_FLAGS_COVERAGE