meson.build 2.42 KB
Newer Older
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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
script_conf = configuration_data()
script_conf.set('libexecdir', session_libexecdir)

script = 'gnome-session'

configure_file(
  input: script + '.in',
  output: script,
  install: true,
  install_dir: session_bindir,
  configuration: script_conf
)

libgsmutil = static_library(
  'gsmutil',
  sources: 'gsm-util.c',
  include_directories: top_inc,
  dependencies: session_deps
)

sources = files(
  'gsm-app.c',
  'gsm-autostart-app.c',
  'gsm-client.c',
  'gsm-dbus-client.c',
  'gsm-fail-whale.c',
  'gsm-inhibitor.c',
  'gdm-log.c',
  'gsm-manager.c',
  'gsm-presence.c',
  'gsm-process-helper.c',
  'gsm-session-fill.c',
  'gsm-session-save.c',
  'gsm-shell-extensions.c',
  'gsm-shell.c',
  'gsm-store.c',
  'gsm-system.c',
  'gsm-systemd.c',
  'gsm-xsmp-client.c',
  'gsm-xsmp-server.c',
  'main.c'
)

dbus_ifaces = [
  ['org.gnome.SessionManager', 'ExportedManager'],
  ['org.gnome.SessionManager.Client', 'ExportedClient'],
  ['org.gnome.SessionManager.ClientPrivate', 'ExportedClientPrivate'],
  ['org.gnome.SessionManager.App', 'ExportedApp'],
  ['org.gnome.SessionManager.Inhibitor', 'ExportedInhibitor'],
  ['org.gnome.SessionManager.Presence', 'ExportedPresence']
]

foreach iface: dbus_ifaces
  sources += gnome.gdbus_codegen(
    iface[0],
    iface[0] + '.xml',
    interface_prefix: iface[0] + '.',
    namespace: 'Gsm',
    annotations: [iface[0], 'org.gtk.GDBus.C.Name', iface[1]]
  )
endforeach

if enable_consolekit
  sources += files('gsm-consolekit.c')
endif

cflags = [
  '-DLOCALE_DIR="@0@"'.format(session_localedir),
  '-DDATA_DIR="@0@"'.format(session_pkgdatadir),
  '-DLIBEXECDIR="@0@"'.format(session_libexecdir)
]

executable(
  meson.project_name() + '-binary',
  sources,
  include_directories: top_inc,
  dependencies: session_bin_deps,
  c_args: cflags,
  link_with: libgsmutil,
  install: true,
  install_dir: session_libexecdir
)

sources = files('gsm-fail-whale-dialog.c')

cflags = '-DLOCALE_DIR="@0@"'.format(session_localedir)

executable(
  meson.project_name() + '-failed',
  sources,
  include_directories: top_inc,
  dependencies: gtk_dep,
  c_args: cflags,
  install: true,
  install_dir: session_libexecdir
)

units = [
  ['test-inhibit', [], session_deps + [gtk_dep]],
  ['test-client-dbus', [], [gio_dep]],
  ['test-process-helper', files('gsm-process-helper.c'), [gio_dep]]
]

foreach unit: units
  executable(
    unit[0],
    [unit[0] + '.c'] + unit[1],
    include_directories: top_inc,
    dependencies: unit[2]
  )
endforeach