1
0

meson.build 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. project('jose', 'c', license: 'APL2',
  2. version: '11',
  3. default_options: [
  4. 'c_std=gnu99',
  5. 'prefix=/usr',
  6. 'warning_level=2',
  7. 'werror=true'
  8. ]
  9. )
  10. licensedir = join_paths(get_option('prefix'), 'share', 'licenses', meson.project_name())
  11. if build_machine.system() == 'freebsd'
  12. licensedir += '-'+meson.project_version()
  13. endif
  14. add_project_arguments(
  15. '-I' + meson.current_source_dir(),
  16. '-I' + meson.current_build_dir(),
  17. '-Wstrict-aliasing',
  18. '-Wchar-subscripts',
  19. '-Wformat-security',
  20. '-Wmissing-declarations',
  21. '-Wmissing-prototypes',
  22. '-Wnested-externs',
  23. '-Wpointer-arith',
  24. '-Wshadow',
  25. '-Wsign-compare',
  26. '-Wstrict-prototypes',
  27. '-Wtype-limits',
  28. '-Wunused-function',
  29. '-Wno-missing-field-initializers',
  30. '-Wno-unused-command-line-argument',
  31. '-Wno-unused-parameter',
  32. '-Wno-unknown-pragmas',
  33. language: 'c'
  34. )
  35. zlib = dependency('zlib')
  36. threads = dependency('threads')
  37. jansson = dependency('jansson', version: '>=2.10')
  38. libcrypto = dependency('libcrypto', version: '>=1.0.2')
  39. a2x = find_program('a2x', required: false)
  40. mans = []
  41. licenses = ['COPYING']
  42. subdir('jose')
  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. requires_private: [ 'zlib', 'libcrypto' ],
  55. libraries: libjose,
  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. else
  67. warning('Will not build man pages due to missing dependencies!')
  68. endif