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.

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