Files
rocm-systems/opencl/tests/ocltst/module/common/CMakeLists.txt
T
taosang2 76c6dcd558 SWDEV-1 - Add EMU_ENV option
Fix FEAT-39125
Add EMU_ENV option. If it is ON, the building is for
emulation environment, thus some logics can be adjusted
to match emulation environment. If it is OFF, the
building is for regular environment.
Currently only ocltst will use the option. But it can
be used for other modules.

Change-Id: I54e1bc1309e82794b41fca2ae1f01f004138dced
2021-12-03 10:03:00 -05:00

55 γραμμές
1.4 KiB
CMake

set(COMMON_SOURCES
${OCLTST_DIR}/module/common/BaseTestImp.cpp
${OCLTST_DIR}/module/common/OCLTestImp.cpp
${OCLTST_DIR}/module/common/OCLTestListImp.cpp
${OCLTST_DIR}/module/common/OCLTestUtils.cpp
${OCLTST_DIR}/module/common/OCLThread.cpp
${OCLTST_DIR}/module/common/OCLWrapper.cpp
${OCLTST_DIR}/module/common/Timer.cpp)
if(OPENGL_FOUND AND GLEW_FOUND)
set(COMMON_SOURCES
${COMMON_SOURCES}
${OCLTST_DIR}/module/common/OCLGLCommon.cpp
${OCLTST_DIR}/module/common/OCLGLCommonLinux.cpp)
endif()
add_library(Common OBJECT ${COMMON_SOURCES})
set_target_properties(Common PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(Common
PUBLIC
CL_TARGET_OPENCL_VERSION=220)
if(EMU_ENV)
target_compile_definitions(Common
PUBLIC
EMU_ENV=1)
endif()
if(OPENGL_FOUND AND GLEW_FOUND)
target_compile_definitions(Common
PUBLIC
USE_OPENGL=1)
endif()
target_include_directories(Common
PUBLIC
${OPENCL_ICD_LOADER_HEADERS_DIR}
${OCLTST_DIR}/include
${OCLTST_DIR}/module/common
${OCLTST_DIR}/module/include
${PROJECT_SOURCE_DIR}/amdocl) #TODO remove cl_profile_amd.h dependency
if(OPENGL_FOUND AND GLEW_FOUND)
target_include_directories(Common
PUBLIC
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIRS})
endif()