Skip to content

Commit 70fd24b

Browse files
authored
Merge pull request #45 from bgilbert/tests
meson: add option to disable tests
2 parents 846a368 + b426151 commit 70fd24b

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

meson.build

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,15 @@ else
7474
# --wrap-mode=nofallback works
7575
uthash = dependency('uthash')
7676
endif
77-
check = dependency(
78-
'check',
79-
default_options : [
80-
'warning_level=0',
81-
],
82-
version : '>=0.9.6',
83-
)
77+
if get_option('tests')
78+
check = dependency(
79+
'check',
80+
default_options : [
81+
'warning_level=0',
82+
],
83+
version : '>=0.9.6',
84+
)
85+
endif
8486

8587
# options
8688
cfg = configuration_data()
@@ -218,9 +220,11 @@ custom_target(
218220
)
219221

220222
# tests
221-
check_dicom = executable(
222-
'check_dicom',
223-
'tests/check_dicom.c',
224-
dependencies : [check, libdicom_dep],
225-
)
226-
test('check_dicom', check_dicom)
223+
if get_option('tests')
224+
check_dicom = executable(
225+
'check_dicom',
226+
'tests/check_dicom.c',
227+
dependencies : [check, libdicom_dep],
228+
)
229+
test('check_dicom', check_dicom)
230+
endif

meson_options.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ option(
33
type : 'string',
44
description : 'suffix to append to the package version string',
55
)
6+
option(
7+
'tests',
8+
type : 'boolean',
9+
value : true,
10+
description : 'build tests',
11+
)

0 commit comments

Comments
 (0)