diff --git a/run_unittests.py b/run_unittests.py index 474b87a2b..5fbc34c32 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -2449,7 +2449,7 @@ recommended as it is not supported on some platforms''') testdirlib = os.path.join(testdirbase, 'lib') extra_args = None env = get_fake_env(testdirlib, self.builddir, self.prefix) - if env.detect_c_compiler(False).get_id() != 'msvc': + if env.detect_c_compiler(False).get_id() not in ['msvc', 'clang-cl']: # static libraries are not linkable with -l with msvc because meson installs them # as .a files which unix_args_to_native will not know as it expects libraries to use # .lib as extension. For a DLL the import library is installed as .lib. Thus for msvc diff --git a/test cases/common/124 cpp and asm/meson.build b/test cases/common/124 cpp and asm/meson.build index 916077535..f0970848e 100644 --- a/test cases/common/124 cpp and asm/meson.build +++ b/test cases/common/124 cpp and asm/meson.build @@ -15,7 +15,7 @@ endif sources = ['trivial.cc'] # If the compiler cannot compile assembly, don't use it -if meson.get_compiler('cpp').get_id() != 'msvc' +if not ['msvc', 'clang-cl'].contains(meson.get_compiler('cpp').get_id()) sources += ['retval-' + cpu + '.S'] cpp_args = ['-DUSE_ASM'] message('Using ASM') diff --git a/test cases/common/13 pch/mixed/meson.build b/test cases/common/13 pch/mixed/meson.build index 7f6033dcf..f0c3ecadb 100644 --- a/test cases/common/13 pch/mixed/meson.build +++ b/test cases/common/13 pch/mixed/meson.build @@ -5,8 +5,9 @@ exe = executable( cpp_pch : ['pch/main_pch.cc', 'pch/main.h'], ) +# test pch when only a header is given (not supported by msvc) cc = meson.get_compiler('c') -if cc.get_id() != 'msvc' +if not ['msvc', 'clang-cl'].contains(cc.get_id()) exe2 = executable( 'prog2', files('main.cc', 'func.c'), diff --git a/test cases/common/132 generated assembly/meson.build b/test cases/common/132 generated assembly/meson.build index 6a8744b19..5fb742913 100644 --- a/test cases/common/132 generated assembly/meson.build +++ b/test cases/common/132 generated assembly/meson.build @@ -2,8 +2,8 @@ project('generated assembly', 'c') cc = meson.get_compiler('c') -if cc.get_id() == 'msvc' - error('MESON_SKIP_TEST: assembly files cannot be compiled directly by MSVC') +if ['msvc', 'clang-cl'].contains(cc.get_id()) + error('MESON_SKIP_TEST: assembly files cannot be compiled directly by the compiler') endif cpu = host_machine.cpu_family() diff --git a/test cases/common/190 openmp/meson.build b/test cases/common/190 openmp/meson.build index eb270aba6..018bf24c5 100644 --- a/test cases/common/190 openmp/meson.build +++ b/test cases/common/190 openmp/meson.build @@ -10,6 +10,9 @@ endif if cc.get_id() == 'msvc' and cc.version().version_compare('<17') error('MESON_SKIP_TEST msvc is too old to support OpenMP.') endif +if cc.get_id() == 'clang-cl' + error('MESON_SKIP_TEST clang-cl does not support OpenMP.') +endif if host_machine.system() == 'darwin' error('MESON_SKIP_TEST macOS does not support OpenMP.') endif diff --git a/test cases/common/204 function attributes/meson.build b/test cases/common/204 function attributes/meson.build index e46533f8b..c906b4918 100644 --- a/test cases/common/204 function attributes/meson.build +++ b/test cases/common/204 function attributes/meson.build @@ -19,7 +19,7 @@ project('gcc func attributes', ['c', 'cpp']) c = meson.get_compiler('c') cpp = meson.get_compiler('cpp') -expected_result = c.get_id() != 'msvc' +expected_result = not ['msvc', 'clang-cl'].contains(c.get_id()) # Q: Why is ifunc not in this list or any of the below lists? # A: It's too damn hard to figure out if you actually support it, since it @@ -57,8 +57,6 @@ if c.get_id() != 'intel' attributes += 'weakref' endif -expected_result = c.get_id() != 'msvc' - # These are unsupported on darwin with apple clang 9.1.0 if host_machine.system() != 'darwin' attributes += 'alias' @@ -97,7 +95,7 @@ foreach a : ['dllexport', 'dllimport'] endforeach message('checking get_supported_function_attributes') -if c.get_id() != 'msvc' +if not ['msvc', 'clang-cl'].contains(c.get_id()) multi_expected = attributes else multi_expected = []