project( 'claudemon', 'cpp', version : '0.1', meson_version : '>= 1.3.0', default_options : [ 'warning_level=3', 'cpp_std=c++23', 'cpp_rtti=false', ], ) cpp_optional_flags = [ # Redefining explicit to be able to include xkb.h '-Wno-keyword-macro', ] cpp_flags = [ '-DVERSION="' + meson.project_version() + '"' ] if get_option('buildtype') == 'release' # If asserts are disabled parameters and variables used for only that # end up causing warnings cpp_optional_flags += ['-Wno-unused-parameter', '-Wno-unused-variable', '-Wno-unused-but-set-variable'] cpp_flags += '-DNDEBUG' endif cpp = meson.get_compiler('cpp') cpp_flags += cpp.get_supported_arguments(cpp_optional_flags) add_project_arguments(cpp_flags, language: 'cpp') thread_dep = dependency('threads') xcb_dep = [dependency('xcb', version: '>= 1.14'), dependency('xcb-xkb', version: '>= 1.14'), dependency('xcb-event', version: '>= 0.4.0'), dependency('xcb-icccm', version: '>= 0.4.1'), dependency('xcb-keysyms', version: '>= 0.4.0'), dependency('xkbcommon-x11', version: '>= 1.0.3', fallback: ['libxkbcommon', 'xkbcommon-x11'])] xcb_xrm_dep = dependency('xcb-xrm', version: '>= 1.0', required: false) dbus_dep = dependency('sdbus-c++', version: '>= 2.0.0') json_dep = dependency('RapidJSON', version: '>= 1.1.0', fallback: ['rapidjson', 'rapidjson_dep']) dependencies = [ dbus_dep, json_dep, thread_dep, xcb_dep, xcb_xrm_dep, ] sources = [ 'src/args.cc', 'src/args.hh', 'src/dbus_common.cc', 'src/dbus_common.hh', 'src/find_desktop.cc', 'src/find_desktop.hh', 'src/main.cc', 'src/monitor.cc', 'src/monitor.hh', 'src/notify.cc', 'src/notify.hh', 'src/xcb_atoms.cc', 'src/xcb_atoms.hh', 'src/xcb_colors.cc', 'src/xcb_colors.hh', 'src/xcb_connection.cc', 'src/xcb_connection.hh', 'src/xcb_resource.cc', 'src/xcb_resource.hh', 'src/xcb_xkb.cc', 'src/xcb_xkb.hh', ] if xcb_xrm_dep.found() sources += 'src/xcb_resources_xrm.cc' else sources += 'src/xcb_resources_none.cc' endif exe = executable( 'claudemon', sources, install : true, dependencies : dependencies, ) test('basic', exe)