| 1 |
|
| 2 |
set(CMAKE_BUILD_TYPE Debug) |
| 3 |
configure_file(tst_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/tst_config.h @ONLY) |
| 4 |
|
| 5 |
include_directories( |
| 6 |
${CMAKE_CURRENT_SOURCE_DIR} |
| 7 |
${CMAKE_CURRENT_BINARY_DIR} |
| 8 |
${CMAKE_CURRENT_SOURCE_DIR}/../../ |
| 9 |
${CMAKE_CURRENT_SOURCE_DIR}/../../src |
| 10 |
${CMAKE_CURRENT_BINARY_DIR}/../../src/ |
| 11 |
${CMAKE_CURRENT_SOURCE_DIR}/../../src/track |
| 12 |
) |
| 13 |
|
| 14 |
if (Boost_FILESYSTEM_FOUND) |
| 15 |
if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") |
| 16 |
set(LIBUTIL_LIBRARY "util") |
| 17 |
endif() |
| 18 |
|
| 19 |
include_directories( |
| 20 |
${Boost_INCLUDE_DIRS} |
| 21 |
) |
| 22 |
endif() |
| 23 |
|
| 24 |
# tst_inject isn't asan-safe, so include it before we enable sanitizers |
| 25 |
add_subdirectory(no_asan) |
| 26 |
|
| 27 |
if (ECM_FOUND) |
| 28 |
include(ECMEnableSanitizers) |
| 29 |
endif() |
| 30 |
|
| 31 |
add_executable(tst_trace tst_trace.cpp ../../src/interpret/dwarfdiecache.cpp ../../src/interpret/demangler.cpp) |
| 32 |
set_target_properties(tst_trace PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${BIN_INSTALL_DIR}") |
| 33 |
target_link_libraries(tst_trace |
| 34 |
PRIVATE |
| 35 |
heaptrack_unwind |
| 36 |
Threads::Threads |
| 37 |
${LIBDW_LIBRARIES} |
| 38 |
tsl::robin_map |
| 39 |
) |
| 40 |
target_include_directories(tst_trace PRIVATE ${LIBDW_INCLUDE_DIRS} ) |
| 41 |
|
| •42 |
#add_test(NAME tst_trace COMMAND tst_trace) |
| 43 |
|
| 44 |
configure_file(tst_heaptrack_interpret.cmake.sh ${CMAKE_CURRENT_BINARY_DIR}/tst_heaptrack_interpret.sh @ONLY) |
| •45 |
#add_test(NAME tst_heaptrack_interpret COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tst_heaptrack_interpret.sh) |
| 46 |
|
| 47 |
if (Boost_FILESYSTEM_FOUND) |
| 48 |
add_executable(tst_libheaptrack |
| 49 |
tst_libheaptrack.cpp |
| 50 |
../../src/track/libheaptrack.cpp) |
| 51 |
set_target_properties(tst_libheaptrack PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${BIN_INSTALL_DIR}") |
| 52 |
target_link_libraries(tst_libheaptrack |
| 53 |
LINK_PRIVATE |
| 54 |
${CMAKE_DL_LIBS} |
| 55 |
${CMAKE_THREAD_LIBS_INIT} |
| 56 |
${LIBUTIL_LIBRARY} |
| 57 |
heaptrack_unwind |
| 58 |
rt |
| 59 |
${Boost_FILESYSTEM_LIBRARY} |
| 60 |
) |
| 61 |
add_test(NAME tst_libheaptrack COMMAND tst_libheaptrack) |
| 62 |
|
| 63 |
add_executable(tst_io tst_io.cpp) |
| 64 |
set_target_properties(tst_io PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${BIN_INSTALL_DIR}") |
| 65 |
target_link_libraries(tst_io |
| 66 |
${Boost_FILESYSTEM_LIBRARY} |
| 67 |
) |
| 68 |
add_test(NAME tst_io COMMAND tst_io) |
| 69 |
|
| 70 |
if (TARGET heaptrack_gui_private) |
| 71 |
find_package(Qt6 ${QT_MIN_VERSION} CONFIG OPTIONAL_COMPONENTS Test) |
| 72 |
if (Qt6Test_FOUND) |
| 73 |
add_executable(tst_parser tst_parser.cpp) |
| 74 |
set_target_properties(tst_parser PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${BIN_INSTALL_DIR}") |
| 75 |
target_link_libraries(tst_parser |
| 76 |
${Boost_FILESYSTEM_LIBRARY} |
| 77 |
heaptrack_gui_private |
| 78 |
Qt6::Test |
| 79 |
) |
| 80 |
add_test(NAME tst_parser COMMAND tst_parser) |
| 81 |
endif() |
| 82 |
endif() |
| 83 |
endif() |