1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-31 00:03:07 +03:00

cmake: Use -fprofile-update=atomic to avoid coverage files corruption from threads

The gcc should be able to select this automatically based on the presence of
-pthread is present on the commandline, but given that we link the tests static,
we do not have this?

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2024-03-08 10:20:38 +01:00
parent 64ef3fefb4
commit 81f9b00005

View File

@ -164,7 +164,7 @@ foreach(LANG ${LANGUAGES})
endif()
endforeach()
set(COVERAGE_COMPILER_FLAGS "-g --coverage"
set(COVERAGE_COMPILER_FLAGS "-g --coverage -fprofile-update=atomic"
CACHE INTERNAL "")
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")