meson.build 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. project('clevis', 'c', license: 'GPL3+', version: '11',
  2. default_options: 'c_std=c99')
  3. libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
  4. sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir'))
  5. bindir = join_paths(get_option('prefix'), get_option('bindir'))
  6. data = configuration_data()
  7. data.set('libexecdir', libexecdir)
  8. data.set('sysconfdir', sysconfdir)
  9. data.set('bindir', bindir)
  10. add_project_arguments(
  11. '-Wall',
  12. '-Wextra',
  13. '-Werror',
  14. '-Wstrict-aliasing',
  15. '-Wchar-subscripts',
  16. '-Wformat-security',
  17. '-Wmissing-declarations',
  18. '-Wmissing-prototypes',
  19. '-Wnested-externs',
  20. '-Wpointer-arith',
  21. '-Wshadow',
  22. '-Wsign-compare',
  23. '-Wstrict-prototypes',
  24. '-Wtype-limits',
  25. '-Wunused-function',
  26. '-Wno-missing-field-initializers',
  27. '-Wno-unused-parameter',
  28. '-Wno-unknown-pragmas',
  29. '-D_POSIX_C_SOURCE=200112L',
  30. '-DBINDIR="' + bindir + '"',
  31. '-DCLEVIS_USER="' + get_option('user') + '"',
  32. '-DCLEVIS_GROUP="' + get_option('group') + '"',
  33. language: 'c'
  34. )
  35. jansson = dependency('jansson', version: '>=2.10', required: false)
  36. jose = dependency('jose', version: '>=8')
  37. a2x = find_program('a2x', required: false)
  38. bins = []
  39. mans = []
  40. subdir('src')
  41. install_data(bins, install_dir: bindir)
  42. if a2x.found()
  43. foreach m : mans
  44. custom_target(m.split('/')[-1], input: m + '.adoc', output: m.split('/')[-1],
  45. command: [a2x, '-f', 'manpage', '-D', meson.current_build_dir(), '@INPUT@'],
  46. install_dir: join_paths(get_option('mandir'), 'man' + m.split('.')[-1]),
  47. install: true
  48. )
  49. endforeach
  50. else
  51. warning('Will not build man pages due to missing dependencies!')
  52. endif