# Copyright (c) Advanced Micro Devices, Inc. # SPDX-License-Identifier: MIT set(UNIT_TEST_OBJECTS $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $<$:$> $<$:$> ) list(APPEND UNIT_TEST_OBJECTS $) list(APPEND UNIT_TEST_OBJECTS $) list(APPEND UNIT_TEST_OBJECTS $) list(APPEND UNIT_TEST_OBJECTS $) list(APPEND UNIT_TEST_OBJECTS $) list(APPEND UNIT_TEST_OBJECTS $) list(APPEND UNIT_TEST_OBJECTS $) list( APPEND UNIT_TEST_OBJECTS $<$:$> ) set(_rocprofsys_have_sdk_pmc_tests FALSE) if( (ROCPROFSYS_ROCM_VERSION_MAJOR GREATER 6) OR ( ROCPROFSYS_ROCM_VERSION_MAJOR EQUAL 6 AND ROCPROFSYS_ROCM_VERSION_MINOR GREATER_EQUAL 4 ) ) set(_rocprofsys_have_sdk_pmc_tests TRUE) endif() list( APPEND UNIT_TEST_OBJECTS $<$:$> ) add_executable(rocprof-sys-unit-tests ${UNIT_TEST_OBJECTS}) target_link_libraries( rocprof-sys-unit-tests PRIVATE rocprofiler-systems-googletest-library rocprofiler-systems-common-library rocprofiler-systems-core-library rocprofiler-systems::rocprofiler-systems-binary $<$:rocprofiler-systems::rocprofiler-systems-bin-common> rocprofiler-systems::rocprofiler-systems-interface-library ) target_include_directories( rocprof-sys-unit-tests PRIVATE ${PROJECT_SOURCE_DIR}/source/lib/rocprof-sys ${PROJECT_SOURCE_DIR}/source/lib ) # Do NOT link rocprofiler-systems-object-library into unit tests. # It contains library.cpp whose static initializers instantiate thread_data / # thread_deleter, causing a TSan deadlock during atexit. get_target_property(_ut_libs rocprof-sys-unit-tests LINK_LIBRARIES) if(_ut_libs MATCHES "rocprofiler-systems-object-library") message( FATAL_ERROR "rocprof-sys-unit-tests must NOT link rocprofiler-systems-object-library. " ) endif()