meson.build 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Libtool like versioning (current.revision.age) for the libraries
  2. # See https://www.sourceware.org/autobook/autobook/autobook_61.html#Library-Versioning
  3. lt_current = '0'
  4. lt_revision = '0'
  5. lt_age = '0'
  6. lt_version = '@0@.@1@.@2@'.format(lt_current, lt_age, lt_revision)
  7. # Main client library to message the daemon
  8. libgamemode = shared_library(
  9. 'gamemode',
  10. sources: [
  11. 'client_impl.c',
  12. ],
  13. dependencies: [
  14. link_lib_common,
  15. dep_dbus,
  16. ],
  17. install: true,
  18. soversion: lt_current,
  19. version: lt_version,
  20. )
  21. gamemode_headers_includes = [
  22. include_directories('.'),
  23. ]
  24. # Small library to automatically use gamemode
  25. libgamemodeauto = library(
  26. 'gamemodeauto',
  27. sources: [
  28. 'client_loader.c',
  29. ],
  30. dependencies: [
  31. libdl,
  32. ],
  33. install: true,
  34. soversion: lt_current,
  35. version: lt_version,
  36. )
  37. # Install the gamemode_client header
  38. gamemode_headers = [
  39. 'gamemode_client.h',
  40. ]
  41. install_headers(
  42. gamemode_headers,
  43. install_dir: path_includedir,
  44. )
  45. # Generate a pkg-config files
  46. pkg = import('pkgconfig')
  47. desc = 'GameMode temporarily applies game specific optimisations to the host OS.'
  48. pkg.generate(
  49. name: 'gamemode',
  50. description: desc,
  51. filebase: 'gamemode',
  52. version: meson.project_version(),
  53. libraries: [
  54. libdl
  55. ],
  56. )
  57. pkg.generate(
  58. name: 'libgamemodeauto',
  59. description: desc,
  60. filebase: 'libgamemodeauto',
  61. libraries: libgamemodeauto,
  62. version: meson.project_version(),
  63. )
  64. # Dependency objects
  65. gamemode_dep = declare_dependency(
  66. include_directories: gamemode_headers_includes,
  67. dependencies: libdl,
  68. )
  69. libgamemodeauto_dep = declare_dependency(
  70. link_with: libgamemodeauto,
  71. )