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