tests/common/127: Fix test on MinGW 64-bit

Instead of hard-coding whether the symbol should be underscored,
detect it.
This commit is contained in:
Nirbheek Chauhan 2017-03-28 12:54:46 +05:30
parent 52e1b0a3c9
commit ebadef0fdf
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,6 @@
project('c++ and assembly test', 'cpp')
cpp = meson.get_compiler('cpp')
cpu = host_machine.cpu_family()
supported_cpus = ['arm', 'x86', 'x86_64']
@ -8,6 +9,10 @@ if not supported_cpus.contains(cpu)
error('MESON_SKIP_TEST unsupported cpu:' + cpu)
endif
if cpp.symbols_have_underscore_prefix()
add_project_arguments('-DMESON_TEST__UNDERSCORE_SYMBOL', language : 'cpp')
endif
sources = ['trivial.cc']
# If the compiler cannot compile assembly, don't use it
if meson.get_compiler('cpp').get_id() != 'msvc'

View File

@ -1,4 +1,4 @@
#if defined(__WIN32__) || defined(__APPLE__)
#if defined(MESON_TEST__UNDERSCORE_SYMBOL)
# define SYMBOL_NAME(name) _##name
#else
# define SYMBOL_NAME(name) name