Skip to content

Commit 3ce73a6

Browse files
committed
meson.build: allow disabling the xsetwacom build
xsetwacom pulls in the xorgproto and Xlib dependencies, so let's make this optional for the (niche) case of where we really only want the driver built. Since this is a rather niche case let's make it a boolean true/false option instead of a feature with "auto".
1 parent 6f8ed05 commit 3ce73a6

File tree

2 files changed

+43
-30
lines changed

2 files changed

+43
-30
lines changed

meson.build

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,24 @@ cflags = [
4747
add_project_arguments(cc.get_supported_arguments(cflags), language : 'c')
4848
add_project_arguments('-D_GNU_SOURCE', language : 'c')
4949

50+
build_xsetwacom = get_option('xsetwacom')
5051

5152
# Dependencies
5253
pkgconfig = import('pkgconfig')
53-
dep_protos = []
54-
protos = ['xproto', 'xext', 'kbproto', 'inputproto', 'randrproto']
55-
foreach proto : protos
56-
dep_protos += [dependency(proto)]
57-
endforeach
5854
dep_xserver = dependency('xorg-server', version: '>= 1.13.0')
59-
xlibs = ['x11', 'xi', 'xrandr', 'xinerama']
60-
dep_xlibs = []
61-
foreach xlib : xlibs
62-
dep_xlibs += [dependency(xlib)]
63-
endforeach
55+
if build_xsetwacom
56+
dep_protos = []
57+
protos = ['xproto', 'xext', 'kbproto', 'inputproto', 'randrproto']
58+
foreach proto : protos
59+
dep_protos += [dependency(proto)]
60+
endforeach
61+
62+
xlibs = ['x11', 'xi', 'xrandr', 'xinerama']
63+
dep_xlibs = []
64+
foreach xlib : xlibs
65+
dep_xlibs += [dependency(xlib)]
66+
endforeach
67+
endif
6468
dep_libudev = dependency('libudev')
6569
dep_m = cc.find_library('m')
6670

@@ -282,18 +286,20 @@ if get_option('serial-device-support')
282286
)
283287
endif
284288

285-
xsetwacom_deps = [dep_xlibs, dep_protos, dep_m]
286-
src_xsetwacom = [
287-
config_ver_h,
288-
'tools/xsetwacom.c',
289-
]
290-
executable(
291-
'xsetwacom',
292-
src_xsetwacom,
293-
dependencies: xsetwacom_deps,
294-
include_directories: [dir_include],
295-
install: true,
296-
)
289+
if build_xsetwacom
290+
xsetwacom_deps = [dep_xlibs, dep_protos, dep_m]
291+
src_xsetwacom = [
292+
config_ver_h,
293+
'tools/xsetwacom.c',
294+
]
295+
executable(
296+
'xsetwacom',
297+
src_xsetwacom,
298+
dependencies: xsetwacom_deps,
299+
include_directories: [dir_include],
300+
install: true,
301+
)
302+
endif
297303

298304
executable(
299305
'pressurecurve',
@@ -337,14 +343,16 @@ endif
337343
build_unittests = not get_option('unittests').disabled()
338344

339345
if build_unittests
340-
xsetwacom_test = executable(
341-
'xsetwacom-test',
342-
src_xsetwacom + ['test/wacom-test-suite.c', 'test/wacom-test-suite.h'],
343-
c_args: ['-DENABLE_TESTS', '-Wno-unused-function'],
344-
dependencies: xsetwacom_deps,
345-
include_directories: [dir_include, dir_src, dir_src_test],
346-
)
347-
test('xsetwacom-tests', xsetwacom_test)
346+
if build_xsetwacom
347+
xsetwacom_test = executable(
348+
'xsetwacom-test',
349+
src_xsetwacom + ['test/wacom-test-suite.c', 'test/wacom-test-suite.h'],
350+
c_args: ['-DENABLE_TESTS', '-Wno-unused-function'],
351+
dependencies: xsetwacom_deps,
352+
include_directories: [dir_include, dir_src, dir_src_test],
353+
)
354+
test('xsetwacom-tests', xsetwacom_test)
355+
endif
348356

349357
# Rebuild the driver with -DENABLE_TESTS to enable all the various
350358
# local tests in the files. This is built as a module (like the

meson_options.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,8 @@ option('wacom-gobject',
4848
value: 'auto',
4949
description: 'Build the Wacom GObject library and associated tools [default: auto]'
5050
)
51+
option('xsetwacom',
52+
type: 'boolean',
53+
value: 'true',
54+
description: 'Build the xsetwacom tool [default: true]'
55+
)

0 commit comments

Comments
 (0)