Skip to content

Commit

Permalink
Abort testing on unsupported dialect flags (#1158)
Browse files Browse the repository at this point in the history
* Abort testing on unsupported dialect flags

* Fix dialect testing check in clang-cuda.

* Revert injecting flags from CMake, make a special case for clang-cuda.
  • Loading branch information
wmaxey committed Nov 29, 2023
1 parent ad93a00 commit f8fe8a9
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions libcudacxx/test/utils/libcudacxx/test/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ def configure_compile_flags(self):

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

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

Expand Down Expand Up @@ -761,10 +762,20 @@ 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)

extraflags = []
if self.cxx.type == 'clang':
extraflags = ['-Wno-unknown-cuda-version']

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

self.cxx.flags += [stdflag]

if not std:
# There is no dialect flag. This happens with older MSVC.
if self.cxx.type == 'nvcc':
Expand Down

0 comments on commit f8fe8a9

Please sign in to comment.