meson.build 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. project('jose', 'c', license: 'APL2',
  2. version: '14',
  3. default_options: [
  4. 'c_std=gnu99',
  5. 'prefix=/usr',
  6. 'warning_level=2',
  7. 'werror=true'
  8. ],
  9. meson_version: '>=0.47.0',
  10. )
  11. licensedir = join_paths(get_option('prefix'), 'share', 'licenses', meson.project_name())
  12. if host_machine.system() == 'freebsd'
  13. licensedir += '-'+meson.project_version()
  14. endif
  15. add_project_arguments(
  16. '-Wstrict-aliasing',
  17. '-Wchar-subscripts',
  18. '-Wformat-security',
  19. '-Wmissing-declarations',
  20. '-Wmissing-prototypes',
  21. '-Wnested-externs',
  22. '-Wpointer-arith',
  23. '-Wshadow',
  24. '-Wsign-compare',
  25. '-Wstrict-prototypes',
  26. '-Wtype-limits',
  27. '-Wunused-function',
  28. '-Wno-missing-field-initializers',
  29. '-Wno-unused-command-line-argument',
  30. '-Wno-unused-parameter',
  31. '-Wno-unknown-pragmas',
  32. language: 'c'
  33. )
  34. zlib = dependency('zlib')
  35. threads = dependency('threads')
  36. jansson = dependency('jansson', version: '>=2.10')
  37. libcrypto = dependency('libcrypto', version: '>=1.0.2')
  38. a2x = find_program('a2x', required: get_option('docs'))
  39. jq = find_program('jq', required: false)
  40. mans = []
  41. licenses = ['COPYING']
  42. subdir('include')
  43. subdir('doc')
  44. subdir('lib')
  45. subdir('cmd')
  46. subdir('tests')
  47. install_data(licenses, install_dir: licensedir)
  48. pkg = import('pkgconfig')
  49. pkg.generate(
  50. description: 'Library for managing JOSE objects',
  51. version: meson.project_version(),
  52. filebase: meson.project_name(),
  53. name: 'José Library',
  54. libraries_private: [ zlib, libcrypto ],
  55. libraries: libjose_lib,
  56. requires: jansson,
  57. )
  58. if a2x.found()
  59. foreach m : mans
  60. custom_target(m.split('/')[-1], input: m + '.adoc', output: m.split('/')[-1],
  61. command: [a2x, '-f', 'manpage', '-D', meson.current_build_dir(), '@INPUT@'],
  62. install_dir: join_paths(get_option('mandir'), 'man' + m.split('.')[-1]),
  63. install: true
  64. )
  65. endforeach
  66. elif get_option('docs').auto()
  67. warning('Will not build man pages due to missing dependencies!')
  68. endif
  69. if not jq.found()
  70. message('jq not found (unrequired but recommended)')
  71. endif