Skip to content

Commit 2e93b9f

Browse files
[clr] Only enable comgr dynamic loading if it is a shared lib. (#1065)
Prior we were enabling dynamic loading mode if BUILD_SHARED_LIBS, but this is not correct. We should only be loading dynamically if the amd_comgr library itself is shared. Background: we have a configuration where we use a static linked comgr stub in order to achieve LLVM isolation (it dynamically loads the comgr and compiler into a dedicated link namespace) in an otherwise dynamic linked clr.
1 parent 3cfdfe3 commit 2e93b9f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

projects/clr/rocclr/cmake/ROCclrLC.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ if (NOT amd_comgr_FOUND)
3636
lib/cmake/amd_comgr)
3737
endif()
3838

39+
get_target_property(_amd_comgr_lib_type amd_comgr TYPE)
3940
target_compile_definitions(rocclr PUBLIC WITH_LIGHTNING_COMPILER USE_COMGR_LIBRARY)
40-
if(BUILD_SHARED_LIBS)
41+
if(_amd_comgr_lib_type STREQUAL "SHARED_LIBRARY")
4142
target_compile_definitions(rocclr PUBLIC COMGR_DYN_DLL)
4243
endif()
4344
target_link_libraries(rocclr PUBLIC amd_comgr)

0 commit comments

Comments
 (0)