summaryrefslogtreecommitdiff
path: root/meson.build
blob: b8ba5966770d58a701eb5e8164d1828294a666c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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', 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)