Skip to content

Commit

Permalink
[CMake] Add -fprofile-update=atomic to coverage flags
Browse files Browse the repository at this point in the history
This is to avoid corruption when running multi-threaded tests.
See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68080.
  • Loading branch information
amadio committed Jun 16, 2023
1 parent 59f4471 commit 5c1452e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ set(CMAKE_ARGS $ENV{CMAKE_ARGS} ${CMAKE_ARGS})

if(COVERAGE)
find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
list(PREPEND CMAKE_ARGS "-DCMAKE_CXX_FLAGS=--coverage")
list(PREPEND CMAKE_ARGS "-DCMAKE_CXX_FLAGS=--coverage -fprofile-update=atomic")
endif()

if(MEMCHECK)
Expand Down

0 comments on commit 5c1452e

Please sign in to comment.