pipetap_sources = [
  'main.vala',
  'application.vala',
  'gui/window.vala',
  'gui/main_bar.vala',
  'gui/slider_overlay.vala',
  'gui/settings.vala',
  'logic/ctrl.vala',
  'logic/wireplumber.vala',
  'dbus.vala',
  'dbus-iface.vala',
]

wp_api = gnome.generate_vapi(
  'wireplumber-0.5',
  sources: ['Wp-0.5.gir'],
  metadata_dirs: srcdir,
  packages: ['gio-2.0', 'gobject-2.0', 'glib-2.0'],
)

# That's for WirePlumber
add_project_arguments(['--vapidir', meson.current_build_dir()], language: 'vala')

pipetap_deps = [
  config_dep,
  dependency('gio-2.0'),
  dependency('gtk4'),
  dependency('libadwaita-1', version: '>= 1.4'),
  dependency('gtk4-layer-shell-0'),
  dependency('wireplumber-0.5'),
  wp_api,
]

blueprints = custom_target(
  'blueprints',
  input: files(
    'gtk/help-overlay.blp',
    'gui/main_bar.blp',
    'gui/slider_overlay.blp',
    'gui/window.blp',
  ),
  output: '.',
  command: [
    find_program('blueprint-compiler'),
    'batch-compile',
    '@OUTPUT@',
    '@CURRENT_SOURCE_DIR@',
    '@INPUT@',
  ],
)

pipetap_sources += gnome.compile_resources(
  'pipetap-resources',
  'pipetap.gresource.xml',
  c_name: 'pipetap',
  dependencies: blueprints,
)

executable(
  'pipetap',
  pipetap_sources,
  dependencies: pipetap_deps,
  include_directories: config_inc,
  install: true,
)
