diff --git a/rocclr/CMakeLists.txt b/rocclr/CMakeLists.txt index 0498e200fa..fd0acab0e1 100644 --- a/rocclr/CMakeLists.txt +++ b/rocclr/CMakeLists.txt @@ -5,8 +5,9 @@ cmake_minimum_required(VERSION 3.5) #cmake -DOPENCL_DIR=/path to/opencl .. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") + +# FIXME: Should be option and ON/OFF, not yes/no variable. set(USE_COMGR_LIBRARY "yes") -add_definitions(-DUSE_COMGR_LIBRARY -DCOMGR_DYN_DLL) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_compile_options("-Wno-ignored-attributes") @@ -149,6 +150,15 @@ add_library(amdvdi_static STATIC set_target_properties(amdvdi_static PROPERTIES POSITION_INDEPENDENT_CODE ON) + +if(${USE_COMGR_LIBRARY} MATCHES "yes") + # FIXME: This should not be part of the public interface. Downstream + # users need to add these definitions. This should be defined in a + # config header here so other builds don't need to be aware of this. + target_compile_definitions(oclruntime PUBLIC USE_COMGR_LIBRARY COMGR_DYN_DLL) + target_compile_definitions(amdvdi_static INTERFACE USE_COMGR_LIBRARY COMGR_DYN_DLL) +endif() + target_link_libraries(amdvdi_static PUBLIC Threads::Threads) target_link_libraries(amdvdi_static PUBLIC dl ${ROCT_LIBRARIES} ${ROCR_LIBRARIES} ) diff --git a/rocclr/device/rocm/CMakeLists.txt b/rocclr/device/rocm/CMakeLists.txt index b31673f5a4..de032caad2 100644 --- a/rocclr/device/rocm/CMakeLists.txt +++ b/rocclr/device/rocm/CMakeLists.txt @@ -28,10 +28,9 @@ target_include_directories(oclrocm ${ROCR_INCLUDES}) -# FIXME: Move this to config header. if(${USE_COMGR_LIBRARY} MATCHES "yes") target_compile_definitions(oclrocm - PUBLIC USE_COMGR_LIBRARY) + PRIVATE USE_COMGR_LIBRARY) endif() set_target_properties(oclrocm PROPERTIES POSITION_INDEPENDENT_CODE ON)