mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-04 11:38:53 +08:00
Fix CMake configuration for coverage tests on Mac OS
This commit is contained in:
+15
-6
@@ -35,12 +35,21 @@ if(SUPPORT_STDIOSTREAM)
|
|||||||
add_definitions(-DSUPPORT_STDIOSTREAM)
|
add_definitions(-DSUPPORT_STDIOSTREAM)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS_COVERAGE
|
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang"))
|
||||||
"--coverage -fprofile-arcs -ftest-coverage -fno-default-inline -fno-inline -fno-inline-small-functions -fno-elide-constructors"
|
set(CMAKE_CXX_FLAGS_COVERAGE
|
||||||
CACHE STRING "Flags used by the C++ compiler during coverage builds" FORCE)
|
"--coverage -ftest-coverage -fdiagnostics-absolute-paths -O0 -fprofile-arcs -fno-inline-functions -fno-elide-constructors"
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
CACHE STRING "Flags used by the C++ compiler during coverage builds" FORCE)
|
||||||
"--coverage -ftest-coverage -lgcov"
|
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
||||||
CACHE STRING "Flags used for linking binaries during coverage builds" FORCE)
|
"-ftest-coverage -fdiagnostics-absolute-paths"
|
||||||
|
CACHE STRING "Flags used for linking binaries during coverage builds" FORCE)
|
||||||
|
else()
|
||||||
|
set(CMAKE_CXX_FLAGS_COVERAGE
|
||||||
|
"--coverage -fprofile-arcs -ftest-coverage -O0 -fno-default-inline -fprofile-abs-path -fno-inline -fno-inline-small-functions -fno-elide-constructors"
|
||||||
|
CACHE STRING "Flags used by the C++ compiler during coverage builds" FORCE)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
||||||
|
"--coverage -ftest-coverage -lgcov"
|
||||||
|
CACHE STRING "Flags used for linking binaries during coverage builds" FORCE)
|
||||||
|
endif()
|
||||||
mark_as_advanced(CMAKE_CXX_FLAGS_COVERAGE CMAKE_C_FLAGS_COVERAGE CMAKE_EXE_LINKER_FLAGS_COVERAGE)
|
mark_as_advanced(CMAKE_CXX_FLAGS_COVERAGE CMAKE_C_FLAGS_COVERAGE CMAKE_EXE_LINKER_FLAGS_COVERAGE)
|
||||||
|
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
|
|||||||
Reference in New Issue
Block a user