From 321e3b99c1a8d54c8475f5ae998452069cc5eb71 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 18 May 2023 14:03:58 +0800 Subject: [PATCH] Fix standalone build (#415) (#437) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/intel/opencl-clang/issues/406 Fixes https://github.com/intel/opencl-clang/issues/374 (cherry picked from commit 529a9188114bcbd8ed753d2276942384fa50d7a1) Co-authored-by: FrantiĊĦek Zatloukal --- cl_headers/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt index 788adff8..86df76f6 100644 --- a/cl_headers/CMakeLists.txt +++ b/cl_headers/CMakeLists.txt @@ -1,5 +1,9 @@ set(CL_HEADERS_LIB cl_headers) -set(CLANG_COMMAND $ ) +if(USE_PREBUILT_LLVM) + find_program(CLANG_COMMAND clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) +else() + set(CLANG_COMMAND $) +endif() if(LLVM_USE_HOST_TOOLS AND NOT OPENCL_CLANG_BUILD_EXTERNAL) build_native_tool(clang CLANG_COMMAND) endif()