addon.gypi 3.2 KB

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