meson.build 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. project('clevis', 'c', license: 'GPL3+', version: '15',
  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_DEFAULT_SOURCE',
  30. '-D_POSIX_C_SOURCE=200112L',
  31. '-DBINDIR="' + bindir + '"',
  32. '-DCLEVIS_USER="' + get_option('user') + '"',
  33. '-DCLEVIS_GROUP="' + get_option('group') + '"',
  34. language: 'c'
  35. )
  36. jansson = dependency('jansson', version: '>=2.10', required: false)
  37. jose = dependency('jose', version: '>=8')
  38. a2x = find_program('a2x', required: false)
  39. bins = []
  40. mans = []
  41. subdir('src')
  42. install_data(bins, install_dir: bindir)
  43. if a2x.found()
  44. foreach m : mans
  45. custom_target(m.split('/')[-1], input: m + '.adoc', output: m.split('/')[-1],
  46. command: [a2x, '-f', 'manpage', '-D', meson.current_build_dir(), '@INPUT@'],
  47. install_dir: join_paths(get_option('mandir'), 'man' + m.split('.')[-1]),
  48. install: true
  49. )
  50. endforeach
  51. else
  52. warning('Will not build man pages due to missing dependencies!')
  53. endif