Skip to content

Commit

Permalink
Properly querry CMAKE_CUDA_COMPILER_LAUNCHER for ccache support (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco authored Jun 30, 2023
1 parent eb78562 commit 2429e82
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion libcudacxx/.upstream-tests/test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ config.configuration_variant = "libcudacxx"
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.use_target = bool("@LIBCUDACXX_TARGET_TRIPLE@")
config.use_ccache = True
config.generate_coverage = False
config.target_info = "@LIBCUDACXX_TARGET_INFO@"
config.test_linker_flags = "@LIBCUDACXX_TEST_LINKER_FLAGS@"
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/.upstream-tests/utils/libcudacxx/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def _basicCmd(self, source_files, out, mode=CM_Default, flags=[],
if self.use_ccache \
and not mode == self.CM_Link \
and not mode == self.CM_PreProcess:
cmd += ['sccache']
cmd += [os.environ.get('CMAKE_CUDA_COMPILER_LAUNCHER')]
cmd += [self.path] + ([self.first_arg] if self.first_arg != '' else [])
if out is not None:
cmd += ['-o', out]
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/.upstream-tests/utils/libcudacxx/test/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def configure_no_execute(self):
self.config.available_features.add('no_execute')

def configure_ccache(self):
use_ccache_default = os.environ.get('LIBCUDACXX_USE_CCACHE') is not None
use_ccache_default = os.environ.get('CMAKE_CUDA_COMPILER_LAUNCHER') is not None
use_ccache = self.get_lit_bool('use_ccache', use_ccache_default)
if use_ccache:
self.cxx.use_ccache = True
Expand Down
1 change: 0 additions & 1 deletion libcudacxx/libcxx/test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ config.configuration_variant = "@LIBCXX_LIT_VARIANT@"
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.use_target = bool("@LIBCXX_TARGET_TRIPLE@")
config.use_ccache = True
config.sysroot = "@LIBCXX_SYSROOT@"
config.gcc_toolchain = "@LIBCXX_GCC_TOOLCHAIN@"
config.generate_coverage = @LIBCXX_GENERATE_COVERAGE@
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/libcxx/utils/libcxx/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def _basicCmd(self, source_files, out, mode=CM_Default, flags=[],
if self.use_ccache \
and not mode == self.CM_Link \
and not mode == self.CM_PreProcess:
cmd += ['sccache']
cmd += [os.environ.get('CMAKE_CXX_COMPILER_LAUNCHER')]
cmd += [self.path] + ([self.first_arg] if self.first_arg != '' else [])
if out is not None:
cmd += ['-o', out]
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/libcxx/utils/libcxx/test/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def configure_no_execute(self):
self.config.available_features.add('no_execute')

def configure_ccache(self):
use_ccache_default = os.environ.get('LIBCXX_USE_CCACHE') is not None
use_ccache_default = os.environ.get('CMAKE_CXX_COMPILER_LAUNCHER') is not None
use_ccache = self.get_lit_bool('use_ccache', use_ccache_default)
if use_ccache:
self.cxx.use_ccache = True
Expand Down

0 comments on commit 2429e82

Please sign in to comment.