Skip to content

Commit 7eccec3

Browse files
[SYCL][Cmake] Add SYCL_LIBDEVICE_GCC_TOOLCHAIN variable (#7771)
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.
1 parent 971808a commit 7eccec3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libdevice/cmake/modules/SYCLLibdevice.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ set(compile_opts
3232
-sycl-std=2020
3333
)
3434

35+
set(SYCL_LIBDEVICE_GCC_TOOLCHAIN "" CACHE PATH "Path to GCC installation")
36+
37+
if (NOT SYCL_LIBDEVICE_GCC_TOOLCHAIN STREQUAL "")
38+
list(APPEND compile_opts "--gcc-toolchain=${SYCL_LIBDEVICE_GCC_TOOLCHAIN}")
39+
endif()
40+
3541
if ("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD)
3642
string(APPEND sycl_targets_opt ",nvptx64-nvidia-cuda")
3743
list(APPEND compile_opts

0 commit comments

Comments
 (0)