Add comgr macros to public definition export
This should allow the cmake build for the opencl runtime to work without manually adding these definitions. The PAL build also adds these as private defines in its build, so change rocm to match. This should probably be including these a config header to benefit other builds, but this will at least avoid some clutter in the opencl build for now. Change-Id: I1044984b87ba3fc72e280e255ceea2dd9e3337ff
This commit is contained in:
zatwierdzone przez
Matthew Arsenault
rodzic
350d54e198
commit
c60d7d860d
@@ -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} )
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user