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