-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-system.cmake
37 lines (34 loc) · 1.3 KB
/
build-system.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function(add_test_app name mutator)
set (sources ${ARGN})
add_executable(${name} ${sources})
target_compile_options(${name} PRIVATE -fembed-bitcode -Wno-literal-conversion)
target_link_options(${name} PRIVATE -fembed-bitcode)
add_executable(${name}_coverage ${sources})
target_compile_options(${name}_coverage PRIVATE -fprofile-instr-generate -fcoverage-mapping -Wno-literal-conversion)
target_link_options(${name}_coverage PRIVATE -fprofile-instr-generate -fcoverage-mapping)
foreach(path ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES})
set (IMPLICIT_HEADERS "-isystem${path} ${IMPLICIT_HEADERS}")
endforeach()
foreach(path ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
set (IMPLICIT_HEADERS "-isystem${path} ${IMPLICIT_HEADERS}")
endforeach()
add_custom_target(${name}_mutation
COMMAND mull-cxx
# -mutators=cxx_
# < -> <=
# -mutators=cxx_boundary
# == -> !=
# -mutators=cxx_comparison
# + -> -
# -mutators=cxx_arithmetic
--mutators=${mutator}
# --ide-reporter-show-killed
--compilation-flags="${IMPLICIT_HEADERS} -I${CMAKE_CURRENT_LIST_DIR}"
--compdb-path=${CMAKE_BINARY_DIR}/compile_commands.json
--strict
--linker=${CMAKE_CXX_COMPILER}
--linker-flags=-fsanitize=address
$<TARGET_FILE:${name}>
VERBATIM
)
endfunction()