From 8d00f1aa591d61986ea44d27a86c592136bb9007 Mon Sep 17 00:00:00 2001 From: Arun Sunil Date: Fri, 9 Oct 2020 13:55:49 -0700 Subject: [PATCH] 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 --- rocrtst/suites/test_common/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rocrtst/suites/test_common/CMakeLists.txt b/rocrtst/suites/test_common/CMakeLists.txt index e31094b404..9e136ad2b0 100755 --- a/rocrtst/suites/test_common/CMakeLists.txt +++ b/rocrtst/suites/test_common/CMakeLists.txt @@ -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()