diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3acae686da..86b8dfa885 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -187,6 +187,11 @@ target_link_libraries(roctracer_tool roctracer hsa-runtime64::hsa-runtime64 Thre target_link_options(roctracer_tool PRIVATE -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/tracer_tool/exportmap -Wl,--no-undefined) install(TARGETS roctracer_tool LIBRARY DESTINATION lib/${ROCTRACER_NAME}) + +add_library(hip_stats SHARED hip_stats/hip_stats.cpp) +target_compile_definitions(hip_stats PRIVATE __HIP_PLATFORM_AMD__) +target_link_libraries(hip_stats roctracer stdc++fs) +install(TARGETS hip_stats LIBRARY DESTINATION lib/${ROCTRACER_NAME}) endif() option(FILE_REORG_BACKWARD_COMPATIBILITY "Enable File Reorg with backward compatibility" ON) diff --git a/test/hip_stats/hip_stats.cpp b/src/hip_stats/hip_stats.cpp similarity index 100% rename from test/hip_stats/hip_stats.cpp rename to src/hip_stats/hip_stats.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7a123e07cc..817ca5b680 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -35,7 +35,7 @@ find_package(Clang REQUIRED CONFIG ## Add a custom targets to build and run all the tests add_custom_target(mytest) -add_dependencies(mytest roctracer_tool) +add_dependencies(mytest roctracer_tool hip_stats) add_custom_target(check COMMAND ${PROJECT_BINARY_DIR}/run.sh DEPENDS mytest) ## Build MatrixTranspose @@ -141,8 +141,3 @@ file(GLOB files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "golden_traces/tests_trace_ foreach(file ${files}) configure_file(${file} ${PROJECT_BINARY_DIR}/test/${file} COPYONLY) endforeach() - -add_library(hip_stats SHARED EXCLUDE_FROM_ALL hip_stats/hip_stats.cpp) -target_compile_definitions(hip_stats PRIVATE __HIP_PLATFORM_AMD__) -target_link_libraries(hip_stats roctracer) -add_dependencies(mytest hip_stats)