addon.gypi 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. {
  2. 'variables' : {
  3. 'node_engine_include_dir%': 'deps/v8/include',
  4. 'node_host_binary%': 'node'
  5. },
  6. 'target_defaults': {
  7. 'type': 'loadable_module',
  8. 'win_delay_load_hook': 'true',
  9. 'product_prefix': '',
  10. 'conditions': [
  11. [ 'node_engine=="chakracore"', {
  12. 'variables': {
  13. 'node_engine_include_dir%': 'deps/chakrashim/include'
  14. },
  15. }]
  16. ],
  17. 'include_dirs': [
  18. '<(node_root_dir)/include/node',
  19. '<(node_root_dir)/src',
  20. '<(node_root_dir)/deps/openssl/config',
  21. '<(node_root_dir)/deps/openssl/openssl/include',
  22. '<(node_root_dir)/deps/uv/include',
  23. '<(node_root_dir)/deps/zlib',
  24. '<(node_root_dir)/<(node_engine_include_dir)'
  25. ],
  26. 'defines!': [
  27. 'BUILDING_UV_SHARED=1', # Inherited from common.gypi.
  28. 'BUILDING_V8_SHARED=1', # Inherited from common.gypi.
  29. ],
  30. 'defines': [
  31. 'NODE_GYP_MODULE_NAME=>(_target_name)',
  32. 'USING_UV_SHARED=1',
  33. 'USING_V8_SHARED=1',
  34. # Warn when using deprecated V8 APIs.
  35. 'V8_DEPRECATION_WARNINGS=1'
  36. ],
  37. 'target_conditions': [
  38. ['_type=="loadable_module"', {
  39. 'product_extension': 'node',
  40. 'defines': [
  41. 'BUILDING_NODE_EXTENSION'
  42. ],
  43. 'xcode_settings': {
  44. 'OTHER_LDFLAGS': [
  45. '-undefined dynamic_lookup'
  46. ],
  47. },
  48. }],
  49. ['_type=="static_library"', {
  50. # set to `1` to *disable* the -T thin archive 'ld' flag.
  51. # older linkers don't support this flag.
  52. 'standalone_static_library': '<(standalone_static_library)'
  53. }],
  54. ['_type!="executable"', {
  55. 'conditions': [
  56. [ 'OS=="android"', {
  57. 'cflags!': [ '-fPIE' ],
  58. }]
  59. ]
  60. }],
  61. ['_win_delay_load_hook=="true"', {
  62. # If the addon specifies `'win_delay_load_hook': 'true'` in its
  63. # binding.gyp, link a delay-load hook into the DLL. This hook ensures
  64. # that the addon will work regardless of whether the node/iojs binary
  65. # is named node.exe, iojs.exe, or something else.
  66. 'conditions': [
  67. [ 'OS=="win"', {
  68. 'defines': [ 'HOST_BINARY=\"<(node_host_binary)<(EXECUTABLE_SUFFIX)\"', ],
  69. 'sources': [
  70. '<(node_gyp_dir)/src/win_delay_load_hook.cc',
  71. ],
  72. 'msvs_settings': {
  73. 'VCLinkerTool': {
  74. 'DelayLoadDLLs': [ '<(node_host_binary)<(EXECUTABLE_SUFFIX)' ],
  75. # Don't print a linker warning when no imports from either .exe
  76. # are used.
  77. 'AdditionalOptions': [ '/ignore:4199' ],
  78. },
  79. },
  80. }],
  81. ],
  82. }],
  83. ],
  84. 'conditions': [
  85. [ 'OS=="mac"', {
  86. 'defines': [
  87. '_DARWIN_USE_64_BIT_INODE=1'
  88. ],
  89. 'xcode_settings': {
  90. 'DYLIB_INSTALL_NAME_BASE': '@rpath'
  91. },
  92. }],
  93. [ 'OS=="aix"', {
  94. 'ldflags': [
  95. '-Wl,-bimport:<(node_exp_file)'
  96. ],
  97. }],
  98. [ 'OS=="zos"', {
  99. 'cflags': [
  100. '-q64',
  101. '-Wc,DLL',
  102. '-qlonglong',
  103. '-qenum=int',
  104. '-qxclang=-fexec-charset=ISO8859-1'
  105. ],
  106. 'defines': [
  107. '_ALL_SOURCE=1',
  108. 'MAP_FAILED=-1',
  109. '_UNIX03_SOURCE=1'
  110. ],
  111. 'ldflags': [
  112. '-q64',
  113. '<(node_exp_file)'
  114. ],
  115. }],
  116. [ 'OS=="win"', {
  117. 'conditions': [
  118. ['node_engine=="chakracore"', {
  119. 'library_dirs': [ '<(node_root_dir)/$(ConfigurationName)' ],
  120. 'libraries': [ '<@(node_engine_libs)' ],
  121. }],
  122. ],
  123. 'libraries': [
  124. '-lkernel32.lib',
  125. '-luser32.lib',
  126. '-lgdi32.lib',
  127. '-lwinspool.lib',
  128. '-lcomdlg32.lib',
  129. '-ladvapi32.lib',
  130. '-lshell32.lib',
  131. '-lole32.lib',
  132. '-loleaut32.lib',
  133. '-luuid.lib',
  134. '-lodbc32.lib',
  135. '-lDelayImp.lib',
  136. '-l"<(node_lib_file)"'
  137. ],
  138. 'msvs_disabled_warnings': [
  139. # warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>'
  140. # needs to have dll-interface to be used by
  141. # clients of class 'node::ObjectWrap'
  142. 4251
  143. ],
  144. }, {
  145. # OS!="win"
  146. 'defines': [
  147. '_LARGEFILE_SOURCE',
  148. '_FILE_OFFSET_BITS=64'
  149. ],
  150. }],
  151. [ 'OS in "freebsd openbsd netbsd solaris android" or \
  152. (OS=="linux" and target_arch!="ia32")', {
  153. 'cflags': [ '-fPIC' ],
  154. }],
  155. ]
  156. }
  157. }