meson.build 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. project('parson', 'c',
  2. version : '1.4.0', # !!! also increment lib_so_version !!!
  3. license : 'MIT',
  4. meson_version : '>=0.46.0',
  5. default_options : [
  6. 'c_std=c89', 'optimization=2',
  7. 'warning_level=2'
  8. ]
  9. )
  10. parson_sources = ['parson.c']
  11. parson_inc = include_directories('.')
  12. lib_so_version = '0'
  13. parson_shared_lib = shared_library(
  14. meson.project_name(),
  15. sources: parson_sources,
  16. soversion: lib_so_version,
  17. install: true
  18. )
  19. parson_static_lib = static_library(
  20. meson.project_name(),
  21. sources: parson_sources,
  22. install: true
  23. )
  24. install_headers('parson.h', subdir : 'parson')
  25. parson_shared_dep = declare_dependency(
  26. include_directories : parson_inc,
  27. link_with : parson_shared_lib
  28. )
  29. parson_static_dep = declare_dependency(
  30. include_directories : parson_inc,
  31. link_with : parson_static_lib
  32. )
  33. pkgconfig = import('pkgconfig')
  34. # will create a pkg config for the shared lib only
  35. pkgconfig.generate(parson_shared_lib,
  36. version: meson.project_version(),
  37. filebase: meson.project_name(),
  38. name: meson.project_name(),
  39. description: 'Lightweight JSON library written in C.',
  40. )