From 36353266bf15cbffd2b32531737697401abfdb35 Mon Sep 17 00:00:00 2001 From: gobhardw Date: Thu, 18 May 2023 15:03:48 +0530 Subject: [PATCH] Fixing broken profiler v2 from build directory Change-Id: Ice4f49519953a4cce0ac116535f402ff94adf9d1 --- src/api/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt index 22adc12cd7..c300be9656 100644 --- a/src/api/CMakeLists.txt +++ b/src/api/CMakeLists.txt @@ -245,6 +245,14 @@ set_target_properties(rocprofiler-v2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/v2 VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) + +# Add custom command to copy the v2 library to buil-dir as well +add_custom_command(TARGET rocprofiler-v2 POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/v2/librocprofiler64.so.2 ${CMAKE_BINARY_DIR} +) +# Add custom target to trigger the copy command +add_custom_target(copy_v2_library DEPENDS rocprofiler-v2) + target_compile_definitions(rocprofiler-v2 # As ROCR hsa_api_trace header file is not usable unless AMD_INTERNAL_BUILD is defined PRIVATE AMD_INTERNAL_BUILD