summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2019-04-16 10:19:41 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2019-04-16 10:19:41 +0000
commite6f1b364cc1f8181b1ea266914921c55fc61c2ac (patch)
tree45fd0dc382b7d495e7318d83bfc16a7115d5d08e
parent422e5fb188f5164d0d4d871a195b65a51ed515ef (diff)
parente7b0d89aeb4c424de9a79d03103172f1ae56cf3e (diff)
downloadglib-e6f1b364cc1f8181b1ea266914921c55fc61c2ac.tar.gz
Merge branch 'optional_tests' into 'master'
Only build tests if certain conditions are met. See merge request GNOME/glib!774
-rw-r--r--gio/meson.build6
-rw-r--r--glib/meson.build6
-rw-r--r--gobject/meson.build6
-rw-r--r--meson.build6
4 files changed, 20 insertions, 4 deletions
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()