@@ -47,20 +47,24 @@ cflags = [
4747add_project_arguments (cc.get_supported_arguments(cflags), language : ' c' )
4848add_project_arguments (' -D_GNU_SOURCE' , language : ' c' )
4949
50+ build_xsetwacom = get_option (' xsetwacom' )
5051
5152# Dependencies
5253pkgconfig = import (' pkgconfig' )
53- dep_protos = []
54- protos = [' xproto' , ' xext' , ' kbproto' , ' inputproto' , ' randrproto' ]
55- foreach proto : protos
56- dep_protos += [dependency (proto)]
57- endforeach
5854dep_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
6468dep_libudev = dependency (' libudev' )
6569dep_m = cc.find_library (' m' )
6670
@@ -282,18 +286,20 @@ if get_option('serial-device-support')
282286 )
283287endif
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
298304executable (
299305 ' pressurecurve' ,
@@ -337,14 +343,16 @@ endif
337343build_unittests = not get_option (' unittests' ).disabled()
338344
339345if 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
0 commit comments