Browse Source

meson: Add option to build without kyua for tests (#175)

TingPing 2 years ago
parent
commit
706273c746
2 changed files with 10 additions and 7 deletions
  1. 7
    7
      meson.build
  2. 3
    0
      meson_options.txt

+ 7
- 7
meson.build View File

@@ -84,15 +84,15 @@ pkgconf_exe = executable('pkgconf',
84 84
   link_with : libpkgconf,
85 85
   install : true)
86 86
 
87
+if get_option('tests')
88
+  kyua_exe = find_program('kyua')
89
+  atf_sh_exe = find_program('atf-sh')
90
+  test('kyua', kyua_exe, args : ['--config=none', 'test', '--kyuafile=' + join_paths(meson.build_root(), 'Kyuafile'), '--build-root=' + meson.build_root()])
87 91
 
88
-kyua_exe = find_program('kyua')
89
-atf_sh_exe = find_program('atf-sh')
90
-test('kyua', kyua_exe, args : ['--config=none', 'test', '--kyuafile=' + join_paths(meson.build_root(), 'Kyuafile'), '--build-root=' + meson.build_root()])
91
-
92
-
93
-configure_file(input : 'Kyuafile.in', output : 'Kyuafile', configuration : cdata)
94
-subdir('tests')
95 92
 
93
+  configure_file(input : 'Kyuafile.in', output : 'Kyuafile', configuration : cdata)
94
+  subdir('tests')
95
+endif
96 96
 
97 97
 install_man('man/pkgconf.1')
98 98
 install_man('man/pkg.m4.7')

+ 3
- 0
meson_options.txt View File

@@ -0,0 +1,3 @@
1
+option('tests', type: 'boolean', value: true,
2
+  description: 'Build tests which depends upon the kyua framework'
3
+)