|
1 | 1 | {
|
2 | 2 | 'target_defaults': {
|
3 | 3 | 'type': 'loadable_module',
|
| 4 | + 'win_delay_load_hook': 'false', |
4 | 5 | 'product_prefix': '',
|
| 6 | + |
5 | 7 | 'include_dirs': [
|
6 | 8 | '<(node_root_dir)/src',
|
7 | 9 | '<(node_root_dir)/deps/uv/include',
|
|
13 | 15 | 'product_extension': 'node',
|
14 | 16 | 'defines': [ 'BUILDING_NODE_EXTENSION' ],
|
15 | 17 | }],
|
| 18 | + |
16 | 19 | ['_type=="static_library"', {
|
17 | 20 | # set to `1` to *disable* the -T thin archive 'ld' flag.
|
18 | 21 | # older linkers don't support this flag.
|
19 | 22 | 'standalone_static_library': '<(standalone_static_library)'
|
20 | 23 | }],
|
| 24 | + |
| 25 | + ['_win_delay_load_hook=="true"', { |
| 26 | + # If the has the 'win_delay_load_hook' option set to 'true', link a |
| 27 | + # delay-load hook into the DLL. That hook ensures that the addon |
| 28 | + # will work regardless of whether the node/iojs binary is named |
| 29 | + # 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 | + }], |
21 | 46 | ],
|
22 | 47 |
|
23 | 48 | 'conditions': [
|
|
29 | 54 | },
|
30 | 55 | }],
|
31 | 56 | [ 'OS=="win"', {
|
32 |
| - 'sources': [ |
33 |
| - 'src/win_delay_load_hook.c', |
34 |
| - ], |
35 | 57 | 'libraries': [
|
36 | 58 | '-lkernel32.lib',
|
37 | 59 | '-luser32.lib',
|
|
50 | 72 | # warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>'
|
51 | 73 | # needs to have dll-interface to be used by clients of class 'node::ObjectWrap'
|
52 | 74 | 'msvs_disabled_warnings': [ 4251 ],
|
53 |
| - # Set up delay-loading for node.exe/iojs.exe so the loadable module |
54 |
| - # will still be able to find its imports if the binary is renamed. |
55 |
| - 'msvs_settings': { |
56 |
| - 'VCLinkerTool': { |
57 |
| - 'DelayLoadDLLs': [ 'iojs.exe', 'node.exe' ], |
58 |
| - # Don't print a linker warning when no imports from either .exe are used. |
59 |
| - 'AdditionalOptions': [ '/ignore:4199' ], |
60 |
| - } |
61 |
| - }, |
62 | 75 | }, {
|
63 | 76 | # OS!="win"
|
64 | 77 | 'defines': [ '_LARGEFILE_SOURCE', '_FILE_OFFSET_BITS=64' ],
|
|
0 commit comments