build: make tests optional
authorSimon Zeni <simon@bl4ckb0ne.ca>
Thu, 28 Jul 2022 10:18:33 +0000 (06:18 -0400)
committerSimon Ser <contact@emersion.fr>
Thu, 18 Aug 2022 09:58:41 +0000 (09:58 +0000)
Building the project as a meson subproject, meson inherits the warning level
from the parent project. Making the tests optional bypasses that issue and
reduces build time.

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Simon Ser <contact@emersion.fr>
meson.build
meson_options.txt

index b3e164c..d918afa 100644 (file)
@@ -34,6 +34,7 @@ config = configuration_data()
 config.set10('UDEV', get_option('udev'))
 with_freedreno_kgsl = get_option('freedreno-kgsl')
 with_install_tests = get_option('install-test-programs')
+with_tests = get_option('tests')
 
 if ['freebsd', 'dragonfly', 'netbsd'].contains(host_machine.system())
   dep_pthread_stubs = dependency('pthread-stubs', version : '>= 0.4')
@@ -391,4 +392,6 @@ if with_man_pages
   subdir('man')
 endif
 subdir('data')
-subdir('tests')
+if with_tests
+  subdir('tests')
+endif
index f5d066f..e487676 100644 (file)
@@ -134,3 +134,9 @@ option(
   value : false,
   description : 'Enable support for using udev instead of mknod.',
 )
+option(
+  'tests',
+  type : 'boolean',
+  value : true,
+  description : 'Build test programs.',
+)