meson.build 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. flags = '-Wl,--version-script=' + meson.current_source_dir() + '/libjose.map'
  2. code = 'int main() { return 0; }'
  3. cc = meson.get_compiler('c')
  4. if not cc.links(code, args: flags, name: '-Wl,--version-script=...')
  5. flags = [ '-export-symbols-regex=^jose_.*' ]
  6. endif
  7. libjose_lib = shared_library('jose',
  8. 'misc.c', 'misc.h',
  9. 'cfg.c',
  10. 'io.c',
  11. 'b64.c',
  12. 'hsh.c', 'hsh.h',
  13. 'hooks.c', 'hooks.h',
  14. 'jwk.c',
  15. 'jws.c',
  16. 'jwe.c',
  17. 'zlib/deflate.c',
  18. 'openssl/aescbch.c',
  19. 'openssl/aesgcm.c',
  20. 'openssl/aesgcmkw.c',
  21. 'openssl/aeskw.c',
  22. 'openssl/compat.c', 'openssl/compat.h',
  23. 'openssl/dir.c',
  24. 'openssl/ec.c',
  25. 'openssl/ecdh.c',
  26. 'openssl/ecdhes.c',
  27. 'openssl/ecmr.c',
  28. 'openssl/ecdsa.c',
  29. 'openssl/hash.c',
  30. 'openssl/hmac.c',
  31. 'openssl/jwk.c',
  32. 'openssl/lock.c',
  33. 'openssl/misc.c', 'openssl/misc.h',
  34. 'openssl/oct.c',
  35. 'openssl/pbes2.c',
  36. 'openssl/rsa.c',
  37. 'openssl/rsaes.c',
  38. 'openssl/rsassa.c',
  39. include_directories: incdir,
  40. dependencies: [zlib, jansson, libcrypto, threads],
  41. version: '0.0.0',
  42. link_args: flags,
  43. install: true
  44. )
  45. libjose_dep = declare_dependency(
  46. include_directories: incdir,
  47. dependencies: jansson,
  48. link_with: libjose_lib
  49. )