CMakeLists.txt: Fix issue with rocrtst

Fix for issue where rocrtst could not be built if out directory 
was outside the src (WORK_ROOT) directory due to hard-coded 
relative path for OPENCL_INC_DIR.

Change-Id: Icb93de2266d568e9c2437166e34c88ec526fb45c


[ROCm/ROCR-Runtime commit: 8d00f1aa59]
This commit is contained in:
Arun Sunil
2020-10-09 13:55:49 -07:00
parent 2c1f448744
commit 8c495a73de
@@ -97,7 +97,11 @@ else()
endif()
if(NOT EXISTS "${OPENCL_INC_DIR}/opencl-c.h")
set(OPENCL_INC_DIR "${OPENCL_DIR}/../../../external/llvm-project/clang/lib/Headers/")
if(DEFINED ENV{WORK_ROOT})
set(OPENCL_INC_DIR "$ENV{WORK_ROOT}/external/llvm-project/clang/lib/Headers/")
else()
set(OPENCL_INC_DIR "${OPENCL_DIR}/../../../external/llvm-project/clang/lib/Headers/")
endif()
if(NOT EXISTS "${OPENCL_INC_DIR}/opencl-c.h")
message(WARNING "opencl-c.h not found.")
endif()