project('xlease', 'c', default_options: [ 'buildtype=debugoptimized', 'c_std=gnu99', ], version: '0.99.901', meson_version: '>= 0.42.0', ) cc = meson.get_compiler('c') if cc.get_id() == 'gcc' or cc.get_id() == 'clang' test_wflags = [ '-Wall', '-Wpointer-arith', '-Wmissing-declarations', '-Wformat=2', '-Wstrict-prototypes', '-Wmissing-prototypes', '-Wnested-externs', '-Wbad-function-cast', '-Wold-style-definition', '-Wunused', '-Wuninitialized', '-Wshadow', '-Wmissing-noreturn', '-Wmissing-format-attribute', '-Wredundant-decls', '-Werror=implicit', '-Werror=nonnull', '-Werror=init-self', '-Werror=main', '-Werror=missing-braces', '-Werror=sequence-point', '-Werror=return-type', '-Werror=trigraphs', '-Werror=array-bounds', '-Werror=write-strings', '-Werror=address', '-Werror=int-to-pointer-cast', '-Werror=pointer-to-int-cast', ] else test_wflags = [] endif common_wflags = [] foreach wflag: test_wflags if cc.has_argument(wflag) common_wflags += [ wflag ] endif endforeach add_global_arguments(common_wflags, language : 'c') xcb_xrandr_dep = [ dependency('xcb', version : '>= 1.12'), dependency('xcb-randr', version : '>= 1.12') ] e = executable( 'xlease', 'xlease.c', dependencies: xcb_xrandr_dep, install: true, )