summaryrefslogtreecommitdiff
path: root/tests/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'tests/meson.build')
-rw-r--r--tests/meson.build36
1 files changed, 22 insertions, 14 deletions
diff --git a/tests/meson.build b/tests/meson.build
index b240749e..d5b76342 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -45,13 +45,17 @@ test_install_dir = join_paths(get_option('datadir'), 'gobject-introspection-1.0'
install_data(installed_sources, install_dir: test_install_dir)
+# Will be overridden to newly built one in common-case regular, non-cross
+# build.
+test_girscanner = find_program('g-ir-scanner', native: true, required : false)
+test_gircompiler = find_program('g-ir-compiler', native: false, required : false)
+
# Generate everything.h and everything.c:
test_everything_files = custom_target('everything',
output: ['everything.h', 'everything.c'],
depends: typelibs,
command: [
- python,
- girscanner,
+ test_girscanner,
'--quiet',
'--generate-typelib-tests=Everything,@OUTPUT0@,@OUTPUT1@',
'--function-decoration=_GI_TEST_EXTERN',
@@ -103,14 +107,15 @@ test_typelibs = []
# well. Though, this could work differently altogether. Instead one could
# generate appropriate pkg-config files and point PKG_CONFIG_PATH to them,
# leaving all invocations of g-ir-scanner as is.
-if glib_dep.type_name() == 'pkgconfig'
- test_gir_files += custom_target('gir-everything',
+if (glib_dep.type_name() == 'pkgconfig' and
+ test_girscanner.found() and
+ get_option('build_introspection_data') == true)
+ test_gir_files += [custom_target('gir-everything',
input: test_everything_sources + test_everything_headers,
output: 'Everything-1.0.gir',
depends: [everything_lib] + typelibs,
command: [
- python,
- girscanner,
+ test_girscanner,
'--quiet',
'--output=@OUTPUT@',
'--no-libtool',
@@ -128,15 +133,14 @@ if glib_dep.type_name() == 'pkgconfig'
extra_giscanner_args,
'@INPUT@',
]
- )
+ )]
- test_gir_files += custom_target('gir-gimarshallingtests',
+ test_gir_files += [custom_target('gir-gimarshallingtests',
input: test_marshalling_sources + test_marshalling_headers,
output: 'GIMarshallingTests-1.0.gir',
depends: [gimarshallingtests_lib] + typelibs,
command: [
- python,
- girscanner,
+ test_girscanner,
'--quiet',
'--output=@OUTPUT@',
'--no-libtool',
@@ -155,14 +159,14 @@ if glib_dep.type_name() == 'pkgconfig'
extra_giscanner_args,
'@INPUT@',
]
- )
+ )]
foreach gir : test_gir_files
test_typelibs += custom_target('generate-typelib-@0@'.format(gir).underscorify(),
input: gir,
output: '@BASENAME@.typelib',
depends: [gobject_gir, ],
- command: [gircompiler, '-o', '@OUTPUT@', '@INPUT@',
+ command: [test_gircompiler, '-o', '@OUTPUT@', '@INPUT@',
'--includedir', join_paths(build_root, 'gir'),
'--includedir', meson.current_build_dir()
],
@@ -183,6 +187,10 @@ if glib_dep.type_name() == 'pkgconfig'
endif
subdir('offsets')
-subdir('warn')
+if get_option('build_introspection_data') == true
+ subdir('warn')
+endif
subdir('scanner')
-subdir('repository')
+if get_option('build_introspection_data') == true
+ subdir('repository')
+endif