meson.build 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. project('clevis', 'c', license: 'GPL3+',
  2. version: '19',
  3. default_options: 'c_std=c99'
  4. )
  5. libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
  6. sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir'))
  7. bindir = join_paths(get_option('prefix'), get_option('bindir'))
  8. data = configuration_data()
  9. data.set('libexecdir', libexecdir)
  10. data.set('sysconfdir', sysconfdir)
  11. data.set('bindir', bindir)
  12. add_project_arguments(
  13. '-Wall',
  14. '-Wextra',
  15. '-Werror',
  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-parameter',
  30. '-Wno-unknown-pragmas',
  31. '-D_DEFAULT_SOURCE',
  32. '-D_POSIX_C_SOURCE=200112L',
  33. '-DBINDIR="' + bindir + '"',
  34. '-DCLEVIS_USER="' + get_option('user') + '"',
  35. '-DCLEVIS_GROUP="' + get_option('group') + '"',
  36. language: 'c'
  37. )
  38. jansson = dependency('jansson', version: '>=2.10', required: false)
  39. jose = dependency('jose', version: '>=8')
  40. a2x = find_program('a2x', required: false)
  41. bins = []
  42. mans = []
  43. subdir('src')
  44. install_data(bins, install_dir: bindir)
  45. if a2x.found()
  46. foreach m : mans
  47. custom_target(m.split('/')[-1], input: m + '.adoc', output: m.split('/')[-1],
  48. command: [a2x, '-f', 'manpage', '-D', meson.current_build_dir(), '@INPUT@'],
  49. install_dir: join_paths(get_option('mandir'), 'man' + m.split('.')[-1]),
  50. install: true
  51. )
  52. endforeach
  53. else
  54. warning('Will not build man pages due to missing dependencies!')
  55. endif