meson.build 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. project(
  2. 'scufcont',
  3. 'c',
  4. version: '0.0.1',
  5. default_options: {
  6. 'buildtype': 'release'
  7. }
  8. )
  9. cc = meson.get_compiler('c')
  10. c_args = [
  11. '-std=c99',
  12. '-Wall',
  13. '-Wextra',
  14. '-pedantic'
  15. ]
  16. cmocka_dep = dependency('cmocka')
  17. scufcont_include = include_directories('include')
  18. scufcont_lib = library(
  19. 'scufcont',
  20. 'src/DString.c',
  21. 'src/scufcont.c',
  22. include_directories: [
  23. scufcont_include
  24. ],
  25. c_args: [
  26. c_args,
  27. '-D_SCUFCONT_VERSION="' + meson.project_version() + '"',
  28. ]
  29. )
  30. scufcont_dep = declare_dependency(
  31. compile_args: [
  32. c_args,
  33. '-D_SCUFCONT_VERSION="' + meson.project_version() + '"',
  34. ],
  35. include_directories: scufcont_include,
  36. link_with: scufcont_lib,
  37. version: meson.project_version()
  38. )
  39. if meson.is_subproject()
  40. meson.override_dependency('scufcont', scufcont_dep)
  41. endif
  42. if get_option('SCUFCONT_BUILD_TESTS') == true
  43. subdir('tests')
  44. endif
  45. darray_prepro = custom_target(
  46. 'DArray_prepro',
  47. output: 'DArray_prepro.h',
  48. input: 'include/scufcont/DArray.h',
  49. command: [ cc.cmd_array(), c_args, '-E', '-o', '@OUTPUT@', '@INPUT@' ],
  50. )