Adjust more tests which need to know compiler type

pull/4250/head
Jon Turney 6 years ago
parent d35034b21b
commit bb0bbfc2ab
No known key found for this signature in database
GPG Key ID: C7C86F0370285C81
  1. 2
      run_unittests.py
  2. 2
      test cases/common/124 cpp and asm/meson.build
  3. 3
      test cases/common/13 pch/mixed/meson.build
  4. 4
      test cases/common/132 generated assembly/meson.build
  5. 3
      test cases/common/190 openmp/meson.build
  6. 6
      test cases/common/204 function attributes/meson.build

@ -2449,7 +2449,7 @@ recommended as it is not supported on some platforms''')
testdirlib = os.path.join(testdirbase, 'lib') testdirlib = os.path.join(testdirbase, 'lib')
extra_args = None extra_args = None
env = get_fake_env(testdirlib, self.builddir, self.prefix) 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 # 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 # 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 # .lib as extension. For a DLL the import library is installed as .lib. Thus for msvc

@ -15,7 +15,7 @@ endif
sources = ['trivial.cc'] sources = ['trivial.cc']
# If the compiler cannot compile assembly, don't use it # 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'] sources += ['retval-' + cpu + '.S']
cpp_args = ['-DUSE_ASM'] cpp_args = ['-DUSE_ASM']
message('Using ASM') message('Using ASM')

@ -5,8 +5,9 @@ exe = executable(
cpp_pch : ['pch/main_pch.cc', 'pch/main.h'], 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') cc = meson.get_compiler('c')
if cc.get_id() != 'msvc' if not ['msvc', 'clang-cl'].contains(cc.get_id())
exe2 = executable( exe2 = executable(
'prog2', 'prog2',
files('main.cc', 'func.c'), files('main.cc', 'func.c'),

@ -2,8 +2,8 @@ project('generated assembly', 'c')
cc = meson.get_compiler('c') cc = meson.get_compiler('c')
if cc.get_id() == 'msvc' if ['msvc', 'clang-cl'].contains(cc.get_id())
error('MESON_SKIP_TEST: assembly files cannot be compiled directly by MSVC') error('MESON_SKIP_TEST: assembly files cannot be compiled directly by the compiler')
endif endif
cpu = host_machine.cpu_family() cpu = host_machine.cpu_family()

@ -10,6 +10,9 @@ endif
if cc.get_id() == 'msvc' and cc.version().version_compare('<17') if cc.get_id() == 'msvc' and cc.version().version_compare('<17')
error('MESON_SKIP_TEST msvc is too old to support OpenMP.') error('MESON_SKIP_TEST msvc is too old to support OpenMP.')
endif endif
if cc.get_id() == 'clang-cl'
error('MESON_SKIP_TEST clang-cl does not support OpenMP.')
endif
if host_machine.system() == 'darwin' if host_machine.system() == 'darwin'
error('MESON_SKIP_TEST macOS does not support OpenMP.') error('MESON_SKIP_TEST macOS does not support OpenMP.')
endif endif

@ -19,7 +19,7 @@ project('gcc func attributes', ['c', 'cpp'])
c = meson.get_compiler('c') c = meson.get_compiler('c')
cpp = meson.get_compiler('cpp') 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? # 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 # 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' attributes += 'weakref'
endif endif
expected_result = c.get_id() != 'msvc'
# These are unsupported on darwin with apple clang 9.1.0 # These are unsupported on darwin with apple clang 9.1.0
if host_machine.system() != 'darwin' if host_machine.system() != 'darwin'
attributes += 'alias' attributes += 'alias'
@ -97,7 +95,7 @@ foreach a : ['dllexport', 'dllimport']
endforeach endforeach
message('checking get_supported_function_attributes') message('checking get_supported_function_attributes')
if c.get_id() != 'msvc' if not ['msvc', 'clang-cl'].contains(c.get_id())
multi_expected = attributes multi_expected = attributes
else else
multi_expected = [] multi_expected = []

Loading…
Cancel
Save