binding.gyp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {
  2. 'variables': {
  3. 'target_arch%': '<!(node -e \"var os = require(\'os\'); console.log(os.arch());\")>'
  4. },
  5. 'targets': [{
  6. 'target_name': 'sodium',
  7. 'sources': [
  8. 'src/crypto_aead.cc',
  9. 'src/crypto_sign.cc',
  10. 'src/crypto_sign_ed25519.cc',
  11. 'src/crypto_box.cc',
  12. 'src/crypto_box_curve25519xsalsa20poly1305.cc',
  13. 'src/sodium_runtime.cc',
  14. 'src/crypto_auth.cc',
  15. 'src/crypto_auth_algos.cc',
  16. 'src/crypto_core.cc',
  17. 'src/crypto_scalarmult_curve25519.cc',
  18. 'src/crypto_scalarmult.cc',
  19. 'src/crypto_sign.cc',
  20. 'src/crypto_secretbox_xsalsa20poly1305.cc',
  21. 'src/crypto_secretbox.cc',
  22. 'src/sodium.cc',
  23. 'src/crypto_stream.cc',
  24. 'src/crypto_streams.cc',
  25. 'src/helpers.cc',
  26. 'src/randombytes.cc',
  27. 'src/crypto_pwhash.cc',
  28. 'src/crypto_hash.cc',
  29. 'src/crypto_hash_sha256.cc',
  30. 'src/crypto_hash_sha512.cc',
  31. 'src/crypto_shorthash.cc',
  32. 'src/crypto_shorthash_siphash24.cc',
  33. 'src/crypto_generichash.cc',
  34. 'src/crypto_generichash_blake2b.cc',
  35. 'src/crypto_onetimeauth.cc',
  36. 'src/crypto_onetimeauth_poly1305.cc'
  37. ],
  38. 'include_dirs': [
  39. 'src/include',
  40. 'deps/build/include',
  41. "<!(node -e \"require('nan')\")"
  42. ],
  43. 'cflags': ['-fPIC'],
  44. 'configurations': {
  45. 'Debug': {
  46. 'msvs_settings': {
  47. 'VCCLCompilerTool': {
  48. 'DisableSpecificWarnings': ['4244', '4267']
  49. },
  50. },
  51. },
  52. 'Release': {
  53. 'msvs_settings': {
  54. 'VCCLCompilerTool': {
  55. 'DisableSpecificWarnings': ['4244','4267']
  56. },
  57. },
  58. },
  59. },
  60. 'conditions': [
  61. ['OS=="mac"', {
  62. 'libraries': [
  63. '../deps/build/lib/libsodium.a'
  64. ],
  65. 'variables': {
  66. 'osx_min_version': "<!(sw_vers -productVersion | awk -F \'.\' \'{print $1 \".\" $2}\')"
  67. },
  68. "xcode_settings": {
  69. 'MACOSX_DEPLOYMENT_TARGET': '<(osx_min_version)',
  70. 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
  71. 'OTHER_CFLAGS': ['-arch x86_64 -O2 -g -flto -mmacosx-version-min=<(osx_min_version) -fPIC'],
  72. 'OTHER_LDFLAGS': ['-arch x86_64 -mmacosx-version-min=<(osx_min_version) -flto']
  73. }
  74. }],
  75. ['OS=="win"', {
  76. 'libraries': [
  77. '../deps/build/lib/libsodium.lib'
  78. ]
  79. }],
  80. ['OS=="linux"', {
  81. 'libraries': [
  82. '../deps/build/lib/libsodium.a'
  83. ]
  84. }]
  85. ]
  86. }]
  87. }