meson.build 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 host_machine.system() == 'freebsd'
  5. if not cc.links(code, args: flags + ',--undefined-version' , name: '-Wl,--version-script=...')
  6. flags = [ '-export-symbols-regex=^jose_.*' ]
  7. endif
  8. else
  9. if not cc.links(code, args: flags, name: '-Wl,--version-script=...')
  10. flags = [ '-export-symbols-regex=^jose_.*' ]
  11. endif
  12. endif
  13. libjose_lib = shared_library('jose',
  14. 'misc.c', 'misc.h',
  15. 'cfg.c',
  16. 'io.c',
  17. 'b64.c',
  18. 'hsh.c', 'hsh.h',
  19. 'hooks.c', 'hooks.h',
  20. 'jwk.c',
  21. 'jws.c',
  22. 'jwe.c',
  23. 'zlib/deflate.c',
  24. 'openssl/aescbch.c',
  25. 'openssl/aesgcm.c',
  26. 'openssl/aesgcmkw.c',
  27. 'openssl/aeskw.c',
  28. 'openssl/compat.c', 'openssl/compat.h',
  29. 'openssl/dir.c',
  30. 'openssl/ec.c',
  31. 'openssl/ecdh.c',
  32. 'openssl/ecdhes.c',
  33. 'openssl/ecmr.c',
  34. 'openssl/ecdsa.c',
  35. 'openssl/hash.c',
  36. 'openssl/hmac.c',
  37. 'openssl/jwk.c',
  38. 'openssl/lock.c',
  39. 'openssl/misc.c', 'openssl/misc.h',
  40. 'openssl/oct.c',
  41. 'openssl/pbes2.c',
  42. 'openssl/rsa.c',
  43. 'openssl/rsaes.c',
  44. 'openssl/rsassa.c',
  45. include_directories: incdir,
  46. dependencies: [zlib, jansson, libcrypto, threads],
  47. version: '0.0.0',
  48. link_args: flags,
  49. install: true
  50. )
  51. libjose_dep = declare_dependency(
  52. include_directories: incdir,
  53. dependencies: jansson,
  54. link_with: libjose_lib
  55. )