aboutsummaryrefslogtreecommitdiff
path: root/test cases/common/111 has header symbol/meson.build
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-11-09 10:27:28 -0500
committerGitHub <noreply@github.com>2016-11-09 10:27:28 -0500
commitcf7b50364f5fec9c4b7ea520b31cfd5a1bb443d7 (patch)
tree5290c7d5220725ebfaa0192c5f403f7f633c98fe /test cases/common/111 has header symbol/meson.build
parentf7431fd5dba1f59ce70b07d7074999d1e7442887 (diff)
parent30392a3a8a2f14ee1b3b7e3f66be9728b6a6b52e (diff)
downloadmeson-cf7b50364f5fec9c4b7ea520b31cfd5a1bb443d7.zip
meson-cf7b50364f5fec9c4b7ea520b31cfd5a1bb443d7.tar.gz
meson-cf7b50364f5fec9c4b7ea520b31cfd5a1bb443d7.tar.bz2
Merge pull request #1006 from centricular/cpp-has-header-symbol
A bunch of fixes for compiler checks with C++
Diffstat (limited to 'test cases/common/111 has header symbol/meson.build')
-rw-r--r--test cases/common/111 has header symbol/meson.build32
1 files changed, 23 insertions, 9 deletions
diff --git a/test cases/common/111 has header symbol/meson.build b/test cases/common/111 has header symbol/meson.build
index e0afb42..b5c865f 100644
--- a/test cases/common/111 has header symbol/meson.build
+++ b/test cases/common/111 has header symbol/meson.build
@@ -1,18 +1,32 @@
-project('has header symbol', 'c')
+project('has header symbol', 'c', 'cpp')
cc = meson.get_compiler('c')
+cpp = meson.get_compiler('cpp')
-assert (cc.has_header_symbol('stdio.h', 'int'), 'base types should always be available')
-assert (cc.has_header_symbol('stdio.h', 'printf'), 'printf function not found')
-assert (cc.has_header_symbol('stdio.h', 'FILE'), 'FILE structure not found')
-assert (cc.has_header_symbol('limits.h', 'INT_MAX'), 'INT_MAX define not found')
-assert (not cc.has_header_symbol('limits.h', 'guint64'), 'guint64 is not defined in limits.h')
-assert (not cc.has_header_symbol('stdlib.h', 'FILE'), 'FILE structure is defined in stdio.h, not stdlib.h')
-assert (not cc.has_header_symbol('stdlol.h', 'printf'), 'stdlol.h shouldn\'t exist')
-assert (not cc.has_header_symbol('stdlol.h', 'int'), 'shouldn\'t be able to find "int" with invalid header')
+foreach comp : [cc, cpp]
+ assert (comp.has_header_symbol('stdio.h', 'int'), 'base types should always be available')
+ assert (comp.has_header_symbol('stdio.h', 'printf'), 'printf function not found')
+ assert (comp.has_header_symbol('stdio.h', 'FILE'), 'FILE structure not found')
+ assert (comp.has_header_symbol('limits.h', 'INT_MAX'), 'INT_MAX define not found')
+ assert (not comp.has_header_symbol('limits.h', 'guint64'), 'guint64 is not defined in limits.h')
+ assert (not comp.has_header_symbol('stdlib.h', 'FILE'), 'FILE structure is defined in stdio.h, not stdlib.h')
+ assert (not comp.has_header_symbol('stdlol.h', 'printf'), 'stdlol.h shouldn\'t exist')
+ assert (not comp.has_header_symbol('stdlol.h', 'int'), 'shouldn\'t be able to find "int" with invalid header')
+endforeach
# This is likely only available on Glibc, so just test for it
if cc.has_function('ppoll')
assert (not cc.has_header_symbol('poll.h', 'ppoll'), 'ppoll should not be accessible without _GNU_SOURCE')
assert (cc.has_header_symbol('poll.h', 'ppoll', prefix : '#define _GNU_SOURCE'), 'ppoll should be accessible with _GNU_SOURCE')
endif
+
+assert (cpp.has_header_symbol('iostream', 'std::iostream'), 'iostream not found in iostream.h')
+assert (cpp.has_header_symbol('vector', 'std::vector'), 'vector not found in vector.h')
+assert (not cpp.has_header_symbol('limits.h', 'std::iostream'), 'iostream should not be defined in limits.h')
+
+boost = dependency('boost', required : false)
+if boost.found()
+ assert (cpp.has_header_symbol('boost/math/quaternion.hpp', 'boost::math::quaternion', dependencies : boost), 'quaternion not found')
+else
+ assert (not cpp.has_header_symbol('boost/math/quaternion.hpp', 'boost::math::quaternion', dependencies : boost), 'quaternion found?!')
+endif