You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
4.6 KiB

  1. {
  2. "variables": {
  3. # may be redefined in command line on configuration stage
  4. # "BUILD_LIBRDKAFKA%": "<!(echo ${BUILD_LIBRDKAFKA:-1})"
  5. "BUILD_LIBRDKAFKA%": "<!(node ./util/get-env.js BUILD_LIBRDKAFKA 1)",
  6. },
  7. "targets": [
  8. {
  9. "target_name": "node-librdkafka",
  10. 'sources': [
  11. 'src/binding.cc',
  12. 'src/callbacks.cc',
  13. 'src/common.cc',
  14. 'src/config.cc',
  15. 'src/connection.cc',
  16. 'src/errors.cc',
  17. 'src/kafka-consumer.cc',
  18. 'src/producer.cc',
  19. 'src/topic.cc',
  20. 'src/workers.cc',
  21. 'src/admin.cc'
  22. ],
  23. "include_dirs": [
  24. "<!(node -e \"require('nan')\")",
  25. "<(module_root_dir)/"
  26. ],
  27. 'conditions': [
  28. [
  29. 'OS=="win"',
  30. {
  31. 'actions': [
  32. {
  33. 'action_name': 'nuget_librdkafka_download',
  34. 'inputs': [
  35. 'deps/windows-install.py'
  36. ],
  37. 'outputs': [
  38. 'deps/precompiled/librdkafka.lib',
  39. 'deps/precompiled/librdkafkacpp.lib'
  40. ],
  41. 'message': 'Getting librdkafka from nuget',
  42. 'action': ['python', '<@(_inputs)']
  43. }
  44. ],
  45. 'cflags_cc' : [
  46. '-std=c++14'
  47. ],
  48. 'msvs_settings': {
  49. 'VCLinkerTool': {
  50. 'AdditionalDependencies': [
  51. 'librdkafka.lib',
  52. 'librdkafkacpp.lib'
  53. ],
  54. 'AdditionalLibraryDirectories': [
  55. '../deps/precompiled/'
  56. ]
  57. },
  58. 'VCCLCompilerTool': {
  59. 'AdditionalOptions': [
  60. '/GR'
  61. ],
  62. 'AdditionalUsingDirectories': [
  63. 'deps/precompiled/'
  64. ],
  65. 'AdditionalIncludeDirectories': [
  66. 'deps/librdkafka/src',
  67. 'deps/librdkafka/src-cpp'
  68. ]
  69. }
  70. },
  71. 'include_dirs': [
  72. 'deps/include'
  73. ]
  74. },
  75. {
  76. 'conditions': [
  77. [ "<(BUILD_LIBRDKAFKA)==1",
  78. {
  79. "dependencies": [
  80. "deps/librdkafka.gyp:librdkafka"
  81. ],
  82. "include_dirs": [
  83. "deps/librdkafka/src",
  84. "deps/librdkafka/src-cpp"
  85. ],
  86. 'conditions': [
  87. [
  88. 'OS=="linux"',
  89. {
  90. "libraries": [
  91. "../build/deps/librdkafka.so",
  92. "../build/deps/librdkafka++.so",
  93. "-Wl,-rpath='$$ORIGIN/../deps'",
  94. ],
  95. }
  96. ],
  97. [
  98. 'OS=="mac"',
  99. {
  100. "libraries": [
  101. "../build/deps/librdkafka.dylib",
  102. "../build/deps/librdkafka++.dylib",
  103. ],
  104. }
  105. ]
  106. ],
  107. },
  108. # Else link against globally installed rdkafka and use
  109. # globally installed headers. On Debian, you should
  110. # install the librdkafka1, librdkafka++1, and librdkafka-dev
  111. # .deb packages.
  112. {
  113. "libraries": ["-lrdkafka", "-lrdkafka++"],
  114. "include_dirs": [
  115. "/usr/include/librdkafka",
  116. "/usr/local/include/librdkafka",
  117. "/opt/include/librdkafka",
  118. ],
  119. },
  120. ],
  121. [
  122. 'OS=="linux"',
  123. {
  124. 'cflags_cc' : [
  125. '-std=c++14'
  126. ],
  127. 'cflags_cc!': [
  128. '-fno-rtti'
  129. ]
  130. }
  131. ],
  132. [
  133. 'OS=="mac"',
  134. {
  135. 'xcode_settings': {
  136. 'MACOSX_DEPLOYMENT_TARGET': '10.11',
  137. 'GCC_ENABLE_CPP_RTTI': 'YES',
  138. 'OTHER_LDFLAGS': [
  139. '-L/usr/local/opt/openssl/lib'
  140. ],
  141. 'OTHER_CPLUSPLUSFLAGS': [
  142. '-I/usr/local/opt/openssl/include',
  143. '-std=c++14'
  144. ],
  145. },
  146. }
  147. ]
  148. ]
  149. }
  150. ]
  151. ]
  152. }
  153. ]
  154. }