summaryrefslogtreecommitdiff
path: root/tests/scanner
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-12-31 21:19:58 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-12-31 21:26:42 +0100
commit1153d04f3a9cc47e98bfaa8e23d228df683cf8e7 (patch)
tree093c54d956c6d1bacf29b39810a05d4dbc0c1c52 /tests/scanner
parent395aac62d164ee7b353080f9eae22000cfc1180b (diff)
downloadgobject-introspection-1153d04f3a9cc47e98bfaa8e23d228df683cf8e7.tar.gz
meson: build libregress with cairo support
The cairo dependency fallback code is copied from pygobject. I assume that will work for msvc users (cairo is disabled by default anyway)
Diffstat (limited to 'tests/scanner')
-rw-r--r--tests/scanner/meson.build32
1 files changed, 25 insertions, 7 deletions
diff --git a/tests/scanner/meson.build b/tests/scanner/meson.build
index c63570b4..43b25274 100644
--- a/tests/scanner/meson.build
+++ b/tests/scanner/meson.build
@@ -71,13 +71,20 @@ custom_c_args = cc.get_supported_arguments([
'-Wno-old-style-definition',
'-Wno-missing-field-initializers',
])
-# FIXME: build with cairo
-custom_c_args += ['-D_GI_DISABLE_CAIRO']
+
+if with_cairo
+ regress_deps = [cairo_dep, cairo_gobject_dep]
+ regress_c_args = []
+else
+ regress_deps = []
+ regress_c_args = ['-D_GI_DISABLE_CAIRO']
+endif
+
regress_lib = shared_library('regress-1.0',
sources: ['regress.c', 'annotation.c', 'foo.c', 'drawable.c'],
include_directories : [configinc, include_directories('..')],
- c_args: gi_hidden_visibility_cflags + custom_c_args,
- dependencies: [gobject_dep, gio_dep],
+ c_args: gi_hidden_visibility_cflags + regress_c_args + custom_c_args,
+ dependencies: [gobject_dep, gio_dep] + regress_deps,
)
if glib_dep.type_name() == 'pkgconfig'
@@ -244,8 +251,13 @@ if glib_dep.type_name() == 'pkgconfig'
]
)
- # FIXME: build with cairo and add to 'test_girs'
- custom_target('gir-regress',
+ if with_cairo
+ regress_scanner_cairo_args = ['--include=cairo-1.0']
+ else
+ regress_scanner_cairo_args = ['-D_GI_DISABLE_CAIRO',]
+ endif
+
+ regress_gir = custom_target('gir-regress',
input: ['regress.c', 'regress.h', 'annotation.c', 'annotation.h',
'foo.c', 'foo.h', 'drawable.c', 'drawable.h'],
output: 'Regress-1.0.gir',
@@ -268,10 +280,16 @@ if glib_dep.type_name() == 'pkgconfig'
'-L', meson.current_build_dir(),
'-I', meson.current_source_dir(),
'-I', join_paths(meson.current_source_dir(), '..'),
- '-D_GI_DISABLE_CAIRO',
+ ] + regress_scanner_cairo_args + [
'@INPUT@',
]
)
+
+ # The reference gir is generated with cairo support, so we can only compare
+ # things if we build with cairo as well
+ if with_cairo
+ test_girs += regress_gir
+ endif
endif
foreach gir : test_girs