Commit 4565f789 authored by jannick.wolters's avatar jannick.wolters
Browse files

patched code coverage issue with unity build


Former-commit-id: 79cb2b7f
parent 22fe2422
...@@ -16,7 +16,8 @@ set( CMAKE_CXX_STANDARD_REQUIRED ON ) ...@@ -16,7 +16,8 @@ set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( KITRT_RELEASE_OPTIONS -march=native -w ) set( KITRT_RELEASE_OPTIONS -march=native -w )
set( KITRT_RELWITHDEBINFO_OPTIONS -march=native -pg -no-pie ) set( KITRT_RELWITHDEBINFO_OPTIONS -march=native -pg -no-pie )
set( KITRT_DEBUG_OPTIONS -Wall -Wextra -Wpedantic ) set( KITRT_DEBUG_OPTIONS -Wall -Wextra -Wpedantic )
if( BUILD_UNITY AND NOT CODE_COV ) if( BUILD_UNITY AND NOT BUILD_CODE_COV )
message( STATUS "Unity build enabled" )
set( CMAKE_UNITY_BUILD ON ) set( CMAKE_UNITY_BUILD ON )
set( CMAKE_UNITY_BUILD_BATCH_SIZE 0 ) set( CMAKE_UNITY_BUILD_BATCH_SIZE 0 )
endif() endif()
...@@ -117,6 +118,8 @@ if( BUILD_TESTING ) ...@@ -117,6 +118,8 @@ if( BUILD_TESTING )
else() else()
message( FATAL_ERROR "Code coverage is currently only supported for gcc!" ) message( FATAL_ERROR "Code coverage is currently only supported for gcc!" )
endif() endif()
else()
target_link_libraries( unit_tests Catch )
endif() endif()
target_compile_options( unit_tests PUBLIC "$<$<CONFIG:RELWITHDEBINFO>:${KITRT_RELWITHDEBINFO_OPTIONS}>" ) target_compile_options( unit_tests PUBLIC "$<$<CONFIG:RELWITHDEBINFO>:${KITRT_RELWITHDEBINFO_OPTIONS}>" )
target_compile_options( unit_tests PUBLIC "$<$<CONFIG:RELEASE>:${KITRT_RELEASE_OPTIONS}>" ) target_compile_options( unit_tests PUBLIC "$<$<CONFIG:RELEASE>:${KITRT_RELEASE_OPTIONS}>" )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment