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:
parent
52e1b0a3c9
commit
ebadef0fdf
|
@ -1,5 +1,6 @@
|
||||||
project('c++ and assembly test', 'cpp')
|
project('c++ and assembly test', 'cpp')
|
||||||
|
|
||||||
|
cpp = meson.get_compiler('cpp')
|
||||||
cpu = host_machine.cpu_family()
|
cpu = host_machine.cpu_family()
|
||||||
|
|
||||||
supported_cpus = ['arm', 'x86', 'x86_64']
|
supported_cpus = ['arm', 'x86', 'x86_64']
|
||||||
|
@ -8,6 +9,10 @@ if not supported_cpus.contains(cpu)
|
||||||
error('MESON_SKIP_TEST unsupported cpu:' + cpu)
|
error('MESON_SKIP_TEST unsupported cpu:' + cpu)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if cpp.symbols_have_underscore_prefix()
|
||||||
|
add_project_arguments('-DMESON_TEST__UNDERSCORE_SYMBOL', language : 'cpp')
|
||||||
|
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 meson.get_compiler('cpp').get_id() != 'msvc'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#if defined(__WIN32__) || defined(__APPLE__)
|
#if defined(MESON_TEST__UNDERSCORE_SYMBOL)
|
||||||
# define SYMBOL_NAME(name) _##name
|
# define SYMBOL_NAME(name) _##name
|
||||||
#else
|
#else
|
||||||
# define SYMBOL_NAME(name) name
|
# define SYMBOL_NAME(name) name
|
||||||
|
|
Loading…
Reference in New Issue