From 696d8fae9e4bdd470e2346731d9df0546f65a830 Mon Sep 17 00:00:00 2001 From: Ranjith Ramakrishnan Date: Mon, 25 Mar 2024 15:02:18 -0700 Subject: [PATCH] Static package generation for hsa Generate static package by combining binary and dev components. Binary and dev component dependencies are added to the static package dependencies No dependency to rocprofiler-register Package name will have suffix static-dev/devel Change-Id: I2f9680f13dbffc9eb7ced9fa9b28e360c47ebcca Signed-off-by: Chris Freehill --- runtime/hsa-runtime/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/runtime/hsa-runtime/CMakeLists.txt b/runtime/hsa-runtime/CMakeLists.txt index 1020f30388..991f9b17c2 100644 --- a/runtime/hsa-runtime/CMakeLists.txt +++ b/runtime/hsa-runtime/CMakeLists.txt @@ -288,18 +288,20 @@ endif() ## Link dependencies. target_link_libraries ( ${CORE_RUNTIME_TARGET} PRIVATE hsakmt::hsakmt PkgConfig::drm) target_link_libraries ( ${CORE_RUNTIME_TARGET} PRIVATE elf::elf dl pthread rt ) - -find_package(rocprofiler-register) -if(rocprofiler-register_FOUND) +# For static package rocprofiler-register dependency is not required +if( BUILD_SHARED_LIBS ) + find_package(rocprofiler-register) + if(rocprofiler-register_FOUND) target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HSA_ROCPROFILER_REGISTER=1 HSA_VERSION_MAJOR=${VERSION_MAJOR} HSA_VERSION_MINOR=${VERSION_MINOR} HSA_VERSION_PATCH=${VERSION_PATCH}) target_link_libraries(${CORE_RUNTIME_TARGET} PRIVATE rocprofiler-register::rocprofiler-register) set(HSA_DEP_ROCPROFILER_REGISTER ON) -else() + else() set(HSA_DEP_ROCPROFILER_REGISTER OFF) -endif() + endif() # end rocprofiler-register_FOUND +endif()#end BUILD_SHARED_LIBS ## Set the VERSION and SOVERSION values set_property ( TARGET ${CORE_RUNTIME_TARGET} PROPERTY VERSION "${SO_VERSION_STRING}" ) @@ -406,5 +408,3 @@ if( NOT ${BUILD_SHARED_LIBS} ) DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CORE_RUNTIME_NAME} COMPONENT dev) endif() - -