diff --git a/gio/meson.build b/gio/meson.build index 4e5e021e9..f0e08b40f 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -994,4 +994,8 @@ if enable_systemtap endif subdir('fam') -subdir('tests') +# Don’t build the tests unless we can run them (either natively or in an exe wrapper) +build_tests = not meson.is_cross_build() or (meson.is_cross_build() and meson.has_exe_wrapper()) +if build_tests + subdir('tests') +endif \ No newline at end of file diff --git a/glib/meson.build b/glib/meson.build index df8be8e6d..40b58047d 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -459,4 +459,8 @@ if enable_systemtap install : true) endif -subdir('tests') +# Don’t build the tests unless we can run them (either natively or in an exe wrapper) +build_tests = not meson.is_cross_build() or (meson.is_cross_build() and meson.has_exe_wrapper()) +if build_tests + subdir('tests') +endif \ No newline at end of file diff --git a/gobject/meson.build b/gobject/meson.build index db8d3c4e9..81dcffda5 100644 --- a/gobject/meson.build +++ b/gobject/meson.build @@ -166,4 +166,8 @@ if enable_systemtap install : true) endif -subdir('tests') +# Don’t build the tests unless we can run them (either natively or in an exe wrapper) +build_tests = not meson.is_cross_build() or (meson.is_cross_build() and meson.has_exe_wrapper()) +if build_tests + subdir('tests') +endif \ No newline at end of file diff --git a/meson.build b/meson.build index 85433fb3b..621e35059 100644 --- a/meson.build +++ b/meson.build @@ -2045,7 +2045,11 @@ subdir('gthread') subdir('gmodule') subdir('gio') subdir('fuzzing') -subdir('tests') +# Don’t build the tests unless we can run them (either natively or in an exe wrapper) +build_tests = not meson.is_cross_build() or (meson.is_cross_build() and meson.has_exe_wrapper()) +if build_tests + subdir('tests') +endif # xgettext is optional (on Windows for instance) if find_program('xgettext', required : get_option('nls')).found()