From 606037de2f8159e653e43906db62dc1dd4fce2dd Mon Sep 17 00:00:00 2001 From: Kent Russell Date: Tue, 21 Apr 2020 11:09:39 -0400 Subject: [PATCH] Make thunk lib type be defined by cmake Make the hsakmt library take the value from CMake regarding static/shared KFDTest automatically grabs the right one due to it checking the normal shared folders. Tested locally (and via automation by the time that this is merged) Also set the default to building SOs if BUILD_SHARED_LIBS is not defined Change-Id: I7f8b76a7e60f3b41e5981f472b388301ae09e2c6 Signed-off-by: Kent Russell [ROCm/ROCR-Runtime commit: ddd38deab7e4eb4a665c16182155ff4708f009b7] --- projects/rocr-runtime/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/rocr-runtime/CMakeLists.txt b/projects/rocr-runtime/CMakeLists.txt index aa2c4c609c..1b1b66dd81 100644 --- a/projects/rocr-runtime/CMakeLists.txt +++ b/projects/rocr-runtime/CMakeLists.txt @@ -32,6 +32,11 @@ set ( HSAKMT_TARGET "${HSAKMT}" ) project ( ${HSAKMT_TARGET} VERSION 1.9.0) +if ( NOT DEFINED BUILD_SHARED_LIBS ) + set ( BUILD_SHARED_LIBS "on" ) +endif() +set ( BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS} CACHE BOOL "Build shared library (.so) or not.") + # Optionally, build HSAKMT with ccache. set(ROCM_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build") if (ROCM_CCACHE_BUILD) @@ -119,7 +124,7 @@ include_directories ( ${CMAKE_CURRENT_SOURCE_DIR}/include ) include_directories ( ${CMAKE_CURRENT_SOURCE_DIR}/src ) ## Add the library -add_library ( ${HSAKMT_TARGET} SHARED ${HSAKMT_SRC} ) +add_library ( ${HSAKMT_TARGET} ${HSAKMT_SRC} ) target_compile_options(${HSAKMT_TARGET} PRIVATE ${HSAKMT_C_FLAGS}) set_property(TARGET ${HSAKMT_TARGET} PROPERTY LINK_FLAGS ${HSAKMT_LINK_FLAGS})