From 2a9572dda0ef8065969bc41fca3cf56c32cf5dcc Mon Sep 17 00:00:00 2001 From: Kent Russell Date: Thu, 12 Sep 2024 12:28:11 -0400 Subject: [PATCH] hsakmt: Fix BUILD_SHARED_LIBS usage If BUILD_SHARED_LIBS doesn't get set at all, other projects importing hsakmt may have an inconsistent state regarding SHARED vs STATIC. Instead of setting the option and setting it as an option(), just detect the variable and use it Change-Id: I9d5a5fc6049ca5351f5e7c63d38ee9bfcb89bdad Signed-off-by: Kent Russell --- libhsakmt/hsakmt-config.cmake.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libhsakmt/hsakmt-config.cmake.in b/libhsakmt/hsakmt-config.cmake.in index da7aaac912..31383cb357 100644 --- a/libhsakmt/hsakmt-config.cmake.in +++ b/libhsakmt/hsakmt-config.cmake.in @@ -12,10 +12,8 @@ include( CMakeFindDependencyMacro ) # If the option is ON link other dependent libraries dynamically # If the option is OFF, then link libdrm and libdrm_amdgpu statically -option(BUILD_SHARED_LIBS "Build using shared libraries" ON) - -if(BUILD_SHARED_LIBS) +if(@BUILD_SHARED_LIBS@) include( "${CMAKE_CURRENT_LIST_DIR}/@HSAKMT_TARGET@Targets.cmake" ) else() include( "${CMAKE_CURRENT_LIST_DIR}/@HSAKMT_STATIC_DRM_TARGET@Targets.cmake" ) -endif() \ No newline at end of file +endif()