You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

meson.build 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # Project definition
  2. project('rawrtc', 'c',
  3. version: '0.4.0',
  4. default_options: ['c_std=c99'],
  5. meson_version: '>=0.48.0')
  6. # Set compiler warning flags
  7. compiler = meson.get_compiler('c')
  8. compiler_args = compiler.get_supported_arguments([
  9. '-Wall',
  10. '-Wmissing-declarations',
  11. '-Wmissing-prototypes',
  12. '-Wstrict-prototypes',
  13. '-Wbad-function-cast',
  14. '-Wsign-compare',
  15. '-Wnested-externs',
  16. '-Wshadow',
  17. '-Waggregate-return',
  18. '-Wcast-align',
  19. '-Wextra',
  20. '-Wold-style-definition',
  21. '-Wdeclaration-after-statement',
  22. '-Wuninitialized',
  23. '-Wshorten-64-to-32',
  24. '-pedantic',
  25. ])
  26. add_project_arguments(compiler_args, language: 'c')
  27. # Configuration
  28. configuration = configuration_data()
  29. # Dependency: OpenSSL
  30. openssl_dep = dependency('openssl',
  31. version: '>=1.0.2',
  32. required: true)
  33. # Dependency: re
  34. # Note: We need to force using our own fork until re has accepted all our patches
  35. re_dep = dependency('librawrre',
  36. version: '>=0.6.0',
  37. fallback: ['re', 're_dep'],
  38. required: true)
  39. # Dependency: rew
  40. rew_dep = dependency('librawrrew',
  41. version: '>=0.5.0',
  42. fallback: ['rew', 'rew_dep'],
  43. required: true)
  44. # Dependency: rawrtcc
  45. rawrtcc_dep = dependency('rawrtcc',
  46. version: '>=0.1.1',
  47. fallback: ['rawrtcc', 'rawrtcc_dep'],
  48. required: true)
  49. # Dependency: rawrtcdc
  50. rawrtcdc_dep = dependency('rawrtcdc',
  51. version: '>=0.1.2',
  52. fallback: ['rawrtcdc', 'rawrtcdc_dep'],
  53. required: true)
  54. # Dependencies list
  55. dependencies = [
  56. openssl_dep,
  57. re_dep,
  58. rew_dep,
  59. rawrtcc_dep,
  60. rawrtcdc_dep,
  61. ]
  62. # Options
  63. configuration.set10('RAWRTC_HAVE_SCTP_REDIRECT_TRANSPORT', get_option('sctp_redirect_transport'))
  64. # Version
  65. version = meson.project_version()
  66. version_array = version.split('.')
  67. configuration.set_quoted('RAWRTC_VERSION', version)
  68. configuration.set('RAWRTC_VERSION_MAJOR', version_array[0])
  69. configuration.set('RAWRTC_VERSION_MINOR', version_array[1])
  70. configuration.set('RAWRTC_VERSION_PATCH', version_array[2])
  71. # Set debug level
  72. configuration.set('RAWRTC_DEBUG_LEVEL', get_option('debug_level'))
  73. # Includes
  74. include_dir = include_directories('include')
  75. subdir('include')
  76. # Sources
  77. subdir('src')
  78. # Build library
  79. rawrtc = library(meson.project_name(), sources,
  80. dependencies: dependencies,
  81. include_directories: include_dir,
  82. install: true,
  83. version: version)
  84. # Generate pkg-config file
  85. pkg = import('pkgconfig')
  86. pkg.generate(rawrtc,
  87. name: meson.project_name(),
  88. description: 'A WebRTC and ORTC library with a small footprint.',
  89. url: 'https://github.com/rawrtc/rawrtc')
  90. # Declare dependency
  91. rawrtc_dep = declare_dependency(
  92. include_directories: include_dir,
  93. link_with: rawrtc)
  94. # Tools (optional)
  95. if get_option('build_tools')
  96. subdir('tools')
  97. endif