summaryrefslogtreecommitdiff
path: root/tests/meson.build
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-02-23 13:11:22 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2021-05-23 12:56:21 -0400
commitf9c1b6f65bec623d593835c400d2d55d981715c8 (patch)
tree2fbcc56bc165ba6d15268eb2e22588027e2a26d0 /tests/meson.build
parent00bce5569b5e7fd0f6e373857a89996e07bf0725 (diff)
downloadgobject-introspection-f9c1b6f65bec623d593835c400d2d55d981715c8.tar.gz
Make test suite work with cross-related options
Because of skepticism I received in #224, I made this PR which keeps the testsuite and CI improvements but doesn't add any new build options. I hope this would be less controversial: - no new knobs - tests for those using existing build options - CI tests `build_introspection_data = false`
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