Skip to content

Commit 4c203bb

Browse files
authored
[SYCL][libdevice] Add check that ccache is not being used (#7761)
If ccache was being used, this cmake check would set `gcc_bin_dir` to `/usr/lib/ccache` and `gcc_install_dir` to `/usr/lib`. This would cause build failures due to missing headers. See PR #7628 and comment #7628 (comment)
1 parent 7179e83 commit 4c203bb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libdevice/cmake/modules/SYCLLibdevice.cmake

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
3737
# freshly built clang. The system one might be very old.
3838
get_filename_component(gcc_bin_dir ${CMAKE_CXX_COMPILER} DIRECTORY)
3939
get_filename_component(gcc_install_dir ${gcc_bin_dir} DIRECTORY)
40-
# /bin/g++ doesn't need any fixup.
41-
if (NOT gcc_install_dir STREQUAL "/")
40+
# /bin/g++ doesn't need any fixup. We also need to check that ccache is
41+
# not being used.
42+
if (NOT gcc_install_dir STREQUAL "/" AND NOT gcc_bin_dir MATCHES "ccache")
4243
list(APPEND compile_opts "--gcc-toolchain=${gcc_install_dir}")
4344
endif()
4445
endif()

0 commit comments

Comments
 (0)