binding.gyp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. {
  2. 'targets': [
  3. {
  4. 'target_name': 'uws',
  5. 'sources': [
  6. 'src/Extensions.cpp',
  7. 'src/Group.cpp',
  8. 'src/Networking.cpp',
  9. 'src/Hub.cpp',
  10. 'src/Node.cpp',
  11. 'src/WebSocket.cpp',
  12. 'src/HTTPSocket.cpp',
  13. 'src/Socket.cpp',
  14. 'src/addon.cpp'
  15. ],
  16. 'conditions': [
  17. ['OS=="linux"', {
  18. 'cflags_cc': [ '-std=c++11', '-DUSE_LIBUV' ],
  19. 'cflags_cc!': [ '-fno-exceptions', '-std=gnu++0x', '-fno-rtti' ],
  20. 'cflags!': [ '-fno-omit-frame-pointer' ],
  21. 'ldflags!': [ '-rdynamic' ],
  22. 'ldflags': [ '-s' ]
  23. }],
  24. ['OS=="mac"', {
  25. 'xcode_settings': {
  26. 'MACOSX_DEPLOYMENT_TARGET': '10.7',
  27. 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
  28. 'CLANG_CXX_LIBRARY': 'libc++',
  29. 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
  30. 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
  31. 'GCC_THREADSAFE_STATICS': 'YES',
  32. 'GCC_OPTIMIZATION_LEVEL': '3',
  33. 'GCC_ENABLE_CPP_RTTI': 'YES',
  34. 'OTHER_CFLAGS!': [ '-fno-strict-aliasing' ],
  35. 'OTHER_CPLUSPLUSFLAGS': [ '-DUSE_LIBUV' ]
  36. }
  37. }],
  38. ['OS=="win"', {
  39. 'cflags_cc': [ '/DUSE_LIBUV' ],
  40. 'cflags_cc!': []
  41. }]
  42. ]
  43. },
  44. {
  45. 'target_name': 'action_after_build',
  46. 'type': 'none',
  47. 'dependencies': [ 'uws' ],
  48. 'conditions': [
  49. ['OS!="win"', {
  50. 'actions': [
  51. {
  52. 'action_name': 'move_lib',
  53. 'inputs': [
  54. '<@(PRODUCT_DIR)/uws.node'
  55. ],
  56. 'outputs': [
  57. 'uws'
  58. ],
  59. 'action': ['cp', '<@(PRODUCT_DIR)/uws.node', 'uws_<!@(node -p process.platform)_<!@(node -p process.versions.modules).node']
  60. }
  61. ]}
  62. ],
  63. ['OS=="win"', {
  64. 'actions': [
  65. {
  66. 'action_name': 'move_lib',
  67. 'inputs': [
  68. '<@(PRODUCT_DIR)/uws.node'
  69. ],
  70. 'outputs': [
  71. 'uws'
  72. ],
  73. 'action': ['copy', '<@(PRODUCT_DIR)/uws.node', 'uws_<!@(node -p process.platform)_<!@(node -p process.versions.modules).node']
  74. }
  75. ]}
  76. ]
  77. ]
  78. }
  79. ]
  80. }