[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.
Tá an tiomantas seo le fáil i:
Stella Laurenzo
2025-09-19 16:10:15 -07:00
tiomanta ag GitHub
tuismitheoir 3cfdfe30b2
tiomantas 2e93b9f6cb
+2 -1
Féach ar an gComhad
@@ -36,8 +36,9 @@ if (NOT amd_comgr_FOUND)
lib/cmake/amd_comgr)
endif()
get_target_property(_amd_comgr_lib_type amd_comgr TYPE)
target_compile_definitions(rocclr PUBLIC WITH_LIGHTNING_COMPILER USE_COMGR_LIBRARY)
if(BUILD_SHARED_LIBS)
if(_amd_comgr_lib_type STREQUAL "SHARED_LIBRARY")
target_compile_definitions(rocclr PUBLIC COMGR_DYN_DLL)
endif()
target_link_libraries(rocclr PUBLIC amd_comgr)