diff options
| author | Joel Klinghed <the_jk@opera.com> | 2026-01-12 23:06:20 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@opera.com> | 2026-01-12 23:06:20 +0100 |
| commit | dfeb19b0a83b8ce57d28bf94a4f8d129993d1064 (patch) | |
| tree | d352908df286058059e306c350d89a07c67049eb /meson.build | |
Initial commit
Diffstat (limited to 'meson.build')
| -rw-r--r-- | meson.build | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..0146e90 --- /dev/null +++ b/meson.build @@ -0,0 +1,94 @@ +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')] + +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') + +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) |
