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