Skip to content

Commit 087f135

Browse files
committed
Add coverage option for Asan builds.
1 parent 6940488 commit 087f135

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ option (WITH_OFX "compile with ofx support (needs LibOFX)" ON)
5454
option (WITH_PYTHON "enable python plugin and bindings" OFF)
5555
option (ENABLE_BINRELOC "compile with binary relocation support" ON)
5656
option (DISABLE_NLS "do not use Native Language Support" OFF)
57+
option (COVERAGE "Instrument an Asan build for coverage reporting" OFF)
5758
# ############################################################
5859

5960
# These are also settable from the command line in a similar way.
@@ -623,6 +624,9 @@ elseif(UNIX)
623624
set(ASAN_DYNAMIC_LIB_ENV "LD_PRELOAD=${PRELOADS};ASAN_OPTIONS=${ASAN_OPTIONS}")
624625
endif ()
625626
set(ASAN_BUILD_OPTIONS -fsanitize=address -fsanitize=undefined)
627+
if (COVERAGE)
628+
list(APPEND ASAN_BUILD_OPTIONS --coverage)
629+
endif()
626630
set(ASAN_COMPILE_OPTIONS -g ${ASAN_BUILD_OPTIONS})
627631
add_compile_options("$<$<CONFIG:Asan>:${ASAN_COMPILE_OPTIONS}>")
628632
add_link_options("$<$<CONFIG:Asan>:${ASAN_BUILD_OPTIONS}>")

0 commit comments

Comments
 (0)