Coverage: Fix coverage enabled build on macOS
@@ -170,7 +170,10 @@ endif (HAS_CFLAG_MAYBE_UNINITIALIZED)
if (ENABLE_COVERAGE)
set (COMMON_FLAGS "${COMMON_FLAGS} -fprofile-arcs -ftest-coverage")
- set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -lgcov")
+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
+ if (NOT APPLE)
+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lgcov")
+ endif (NOT APPLE)
endif (ENABLE_COVERAGE)
set (CXX_EXTRA_FLAGS "${CXX_EXTRA_FLAGS} -Wno-missing-field-initializers")
