Skip to content

Commit

Permalink
Fix dialect testing check in clang-cuda.
Browse files Browse the repository at this point in the history
  • Loading branch information
wmaxey committed Nov 28, 2023
1 parent 67f3f0a commit 7bff6eb
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions libcudacxx/test/utils/libcudacxx/test/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,8 @@ def configure_compile_flags(self):

def configure_default_compile_flags(self):
nvcc_host_compiler = self.get_lit_conf('nvcc_host_compiler')
cxx_additional_flags = self.get_lit_conf('test_compiler_flags')

if nvcc_host_compiler and self.cxx.type == 'nvcc':
self.cxx.compile_flags += ['-ccbin={0}'.format(nvcc_host_compiler)]

Expand Down Expand Up @@ -761,14 +763,15 @@ def configure_default_compile_flags(self):

if std:
# We found a dialect flag.
stdflag = '-std={0}'.format(std)
if self.cxx.type == 'msvc':
self.cxx.compile_flags += ['/std:{0}'.format(std)]
else:
self.cxx.compile_flags += ['-std={0}'.format(std)]
stdflag = '/std:{0}'.format(std)

# Do a check with the user/config flag to ensure that the flag is supported.
if not self.cxx.hasCompileFlag([stdflag] + cxx_additional_flags.split(' ')):
raise OSError("Configured compiler does not support flag {0}".format(stdflag))

# Do a check with a user/config flag to ensure that the flag is supported.
if not self.cxx.hasCompileFlag(self.cxx.compile_flags):
raise OSError("Configured compiler does not support flag {0}".format(self.cxx.compile_flags))
self.cxx.flags += [stdflag]

if not std:
# There is no dialect flag. This happens with older MSVC.
Expand Down

0 comments on commit 7bff6eb

Please sign in to comment.