addon.gypi 3.7 KB

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