binding.gyp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. {
  2. "targets" : [
  3. {
  4. 'include_dirs': [
  5. "<!(node -e \"require('nan')\")"
  6. ],
  7. 'cflags': [
  8. '-std=c++0x',
  9. '-Wall',
  10. '-pthread',
  11. '-g',
  12. '-zdefs',
  13. '-Werror',
  14. '-Wno-error=deprecated-declarations'
  15. ],
  16. 'ldflags': [
  17. '-g'
  18. ],
  19. "conditions": [
  20. ['OS != "win"', {
  21. 'variables': {
  22. 'pkg_config_grpc': '<!(pkg-config --exists grpc >/dev/null 2>&1 && echo true || echo false)'
  23. },
  24. 'conditions': [
  25. ['pkg_config_grpc == "true"', {
  26. 'link_settings': {
  27. 'libraries': [
  28. '<!@(pkg-config --libs-only-l --static grpc)'
  29. ]
  30. },
  31. 'cflags': [
  32. '<!@(pkg-config --cflags grpc)'
  33. ],
  34. 'libraries': [
  35. '<!@(pkg-config --libs-only-L --static grpc)'
  36. ],
  37. 'ldflags': [
  38. '<!@(pkg-config --libs-only-other --static grpc)'
  39. ]
  40. }, {
  41. 'link_settings': {
  42. 'libraries': [
  43. '-lpthread',
  44. '-lgrpc',
  45. '-lgpr'
  46. ],
  47. },
  48. 'conditions':[
  49. ['OS != "mac"', {
  50. 'link_settings': {
  51. 'libraries': [
  52. '-lrt'
  53. ]
  54. }
  55. }]
  56. ]
  57. }
  58. ]
  59. ]
  60. }],
  61. ['OS == "mac"', {
  62. 'xcode_settings': {
  63. 'MACOSX_DEPLOYMENT_TARGET': '10.9',
  64. 'OTHER_CFLAGS': [
  65. '-std=c++11',
  66. '-stdlib=libc++'
  67. ]
  68. }
  69. }]
  70. ],
  71. "target_name": "grpc",
  72. "sources": [
  73. "ext/byte_buffer.cc",
  74. "ext/call.cc",
  75. "ext/channel.cc",
  76. "ext/completion_queue_async_worker.cc",
  77. "ext/credentials.cc",
  78. "ext/node_grpc.cc",
  79. "ext/server.cc",
  80. "ext/server_credentials.cc",
  81. "ext/timeval.cc"
  82. ]
  83. }
  84. ]
  85. }