aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-03-28 12:54:46 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-03-28 14:47:55 +0530
commitebadef0fdf4bd7da38c3905224fabe482e1f9c88 (patch)
tree6605bb321855b8a038fe254c2f6a8fb6a7d412e6
parent52e1b0a3c9097d3fc647785d3cee180de0272a5c (diff)
downloadmeson-ebadef0fdf4bd7da38c3905224fabe482e1f9c88.zip
meson-ebadef0fdf4bd7da38c3905224fabe482e1f9c88.tar.gz
meson-ebadef0fdf4bd7da38c3905224fabe482e1f9c88.tar.bz2
tests/common/127: Fix test on MinGW 64-bit
Instead of hard-coding whether the symbol should be underscored, detect it.
-rw-r--r--test cases/common/127 cpp and asm/meson.build5
-rw-r--r--test cases/common/127 cpp and asm/symbol-underscore.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/test cases/common/127 cpp and asm/meson.build b/test cases/common/127 cpp and asm/meson.build
index ac7adb3..9160775 100644
--- a/test cases/common/127 cpp and asm/meson.build
+++ b/test cases/common/127 cpp and asm/meson.build
@@ -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'
diff --git a/test cases/common/127 cpp and asm/symbol-underscore.h b/test cases/common/127 cpp and asm/symbol-underscore.h
index 508cf50..d0f3ef9 100644
--- a/test cases/common/127 cpp and asm/symbol-underscore.h
+++ b/test cases/common/127 cpp and asm/symbol-underscore.h
@@ -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