From 62b8e7269e72193dd93fe9ececba682ff9e09372 Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Tue, 13 Dec 2022 15:20:14 -0800 Subject: [PATCH] [SYCL][Cmake] Add SYCL_LIBDEVICE_GCC_TOOLCHAIN variable To be used when we want libdevice built against non-system STL (e.g. if we're using non-system GCC) as clang doesn't use gcc in PATH to determine which STL to use. --- libdevice/cmake/modules/SYCLLibdevice.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libdevice/cmake/modules/SYCLLibdevice.cmake b/libdevice/cmake/modules/SYCLLibdevice.cmake index 080e2e575e540..e2fd70a6226b5 100644 --- a/libdevice/cmake/modules/SYCLLibdevice.cmake +++ b/libdevice/cmake/modules/SYCLLibdevice.cmake @@ -32,6 +32,12 @@ set(compile_opts -sycl-std=2020 ) +set(SYCL_LIBDEVICE_GCC_TOOLCHAIN "" CACHE PATH "Path to GCC installation") + +if (NOT SYCL_LIBDEVICE_GCC_TOOLCHAIN STREQUAL "") + list(APPEND compile_opts "--gcc-toolchain=${SYCL_LIBDEVICE_GCC_TOOLCHAIN}") +endif() + if ("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD) string(APPEND sycl_targets_opt ",nvptx64-nvidia-cuda") list(APPEND compile_opts