From b38317cb3cd7f4e6b257463c14fc6ebece2ae138 Mon Sep 17 00:00:00 2001 From: Jason Tang Date: Thu, 8 Oct 2020 11:02:06 -0400 Subject: [PATCH] Add COMGR_DYN_DLL to device/rocm/CMakeLists.txt Now rocm/rocdevice.cpp also includes comgrctx.hpp, and we don't want to statically link against comgr when buidling shared libs. Change-Id: Ic330bd860559b3e07b776c951afe6126b0f43f7d --- rocclr/device/rocm/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rocclr/device/rocm/CMakeLists.txt b/rocclr/device/rocm/CMakeLists.txt index 07678622b7..2d56983f59 100644 --- a/rocclr/device/rocm/CMakeLists.txt +++ b/rocclr/device/rocm/CMakeLists.txt @@ -40,9 +40,11 @@ if (BUILD_HMM) endif() if(USE_COMGR_LIBRARY) - target_compile_definitions(oclrocm - PRIVATE USE_COMGR_LIBRARY) + if(${BUILD_SHARED_LIBS}) + target_compile_definitions(oclrocm PRIVATE USE_COMGR_LIBRARY COMGR_DYN_DLL) + else() + target_compile_definitions(oclrocm PRIVATE USE_COMGR_LIBRARY) + endif() endif() set_target_properties(oclrocm PROPERTIES POSITION_INDEPENDENT_CODE ON) -