Skip to content

Commit 695d8da

Browse files
authored
[SYCL] Improve cachability when building with ccache (#21370)
We already had a workaround for `sccache` but `ccache` has the same limitation and we don't use `sccache` anymore in CI. In my experiments for the compiler build step on a completely unchanged module: Before `2m56` After `2m0s` Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
1 parent 9d9ea8d commit 695d8da

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

sycl/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ if(MSVC)
5555
include(CheckLinkerFlag)
5656
check_linker_flag(CXX "LINKER:/DEBUG" LINKER_SUPPORTS_DEBUG)
5757
if(LINKER_SUPPORTS_DEBUG)
58-
# sccache is not compatible with /Zi flag
59-
if (CMAKE_CXX_COMPILER_LAUNCHER STREQUAL "sccache")
58+
# (s)ccache is not compatible with /Zi flag
59+
if (CMAKE_CXX_COMPILER_LAUNCHER STREQUAL "ccache" OR
60+
CMAKE_CXX_COMPILER_LAUNCHER STREQUAL "sccache")
6061
# CMake may put /Zi by default
6162
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
6263
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")

sycl/cmake/modules/BuildUnifiedRuntime.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ if(WIN32)
6262
# FIXME: Unified runtime build fails with /DUNICODE
6363
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /UUNICODE")
6464
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /UUNICODE")
65-
# USE_Z7 forces use of /Z7 instead of /Zi which is broken with sccache
65+
# USE_Z7 forces use of /Z7 instead of /Zi which is broken with (s)ccache
6666
set(USE_Z7 ON)
6767
else()
6868
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error")

0 commit comments

Comments
 (0)