meson.build 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. project(
  2. 'gamemode',
  3. 'c',
  4. default_options : ['c_std=c11'],
  5. version: '0.2',
  6. license: 'BSD',
  7. )
  8. cc = meson.get_compiler('c')
  9. path_prefix = get_option('prefix')
  10. path_bindir = join_paths(path_prefix, get_option('bindir'))
  11. path_datadir = join_paths(path_prefix, get_option('datadir'))
  12. path_includedir = join_paths(path_prefix, get_option('includedir'))
  13. path_libdir = join_paths(path_prefix, get_option('libdir'))
  14. # Find systemd via pkgconfig
  15. dep_systemd = dependency('libsystemd')
  16. # On non glibc systems this might be a stub, i.e. for musl
  17. libdl = cc.find_library('dl', required: false)
  18. # If the path isn't explicitly set, ask systemd for the systemd user unit directory
  19. path_systemd_unit_dir = get_option('with-systemd-user-unit-dir')
  20. if path_systemd_unit_dir == ''
  21. message('Asking pkg-config for systemd\'s directories')
  22. pkgconfig_systemd = dependency('systemd')
  23. path_systemd_unit_dir = pkgconfig_systemd.get_pkgconfig_variable('systemduserunitdir')
  24. endif
  25. subdir('lib')
  26. subdir('daemon')
  27. subdir('example')
  28. subdir('data')
  29. report = [
  30. ' Build configuration:',
  31. ' ====================',
  32. '',
  33. ' prefix: @0@'.format(path_prefix),
  34. ' bindir: @0@'.format(path_bindir),
  35. ' datadir: @0@'.format(path_datadir),
  36. ' libdir: @0@'.format(path_libdir),
  37. ' includedir: @0@'.format(path_includedir),
  38. ' systemd user unit directory: @0@'.format(path_systemd_unit_dir),
  39. ]
  40. # Output some stuff to validate the build config
  41. message('\n\n\n' + '\n'.join(report) + '\n\n')