4 'werror': '', # Turn off -Werror in V8 build.
5 'visibility%': 'hidden', # V8's visibility setting
6 'target_arch%': 'ia32', # set v8's target architecture
7 'host_arch%': 'ia32', # set v8's host architecture
8 'want_separate_host_toolset%': 0, # V8 should not build target and host
9 'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
10 'component%': 'static_library', # NB. these names match with what V8 expects
11 'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
15 'uv_library%': 'static_library',
17 # Default to -O0 for debug builds.
18 'v8_optimized_debug%': 0,
20 # Enable disassembler for `--print-code` v8 options
21 'v8_enable_disassembler': 1,
23 # Don't bake anything extra into the snapshot.
24 'v8_use_external_startup_data%': 0,
29 'v8_postmortem_support%': 'false',
32 'v8_postmortem_support%': 'true',
34 ['GENERATOR == "ninja" or OS== "mac"', {
35 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
36 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
38 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
39 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
41 ['openssl_fips != ""', {
42 'OPENSSL_PRODUCT': 'libcrypto.a',
44 'OPENSSL_PRODUCT': 'libopenssl.a',
55 'default_configuration': 'Release',
59 'v8_enable_handle_zapping': 1,
61 'defines': [ 'DEBUG', '_DEBUG' ],
62 'cflags': [ '-g', '-O0' ],
64 ['target_arch=="x64"', {
65 'msvs_configuration_platform': 'x64',
68 'cflags': [ '-gxcoff' ],
69 'ldflags': [ '-Wl,-bbigtoc' ],
74 'RuntimeLibrary': 1, # static debug
75 'Optimization': 0, # /Od, no optimization
76 'MinimalRebuild': 'false',
77 'OmitFramePointers': 'false',
78 'BasicRuntimeChecks': 3, # /RTC1
81 'LinkIncremental': 2, # enable incremental linking
85 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
90 'v8_enable_handle_zapping': 0,
92 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
94 ['target_arch=="x64"', {
95 'msvs_configuration_platform': 'x64',
98 # pull in V8's postmortem metadata
99 'ldflags': [ '-Wl,-z,allextract' ]
101 ['OS!="mac" and OS!="win"', {
102 'cflags': [ '-fno-omit-frame-pointer' ],
106 'VCCLCompilerTool': {
107 'RuntimeLibrary': 0, # static release
108 'Optimization': 3, # /Ox, full optimization
109 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
110 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
111 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
112 'OmitFramePointers': 'true',
113 'EnableFunctionLevelLinking': 'true',
114 'EnableIntrinsicFunctions': 'true',
115 'RuntimeTypeInfo': 'false',
116 'AdditionalOptions': [
117 '/MP', # compile across multiple CPUs
121 'AdditionalOptions': [
122 '/LTCG', # link time code generation
126 'LinkTimeCodeGeneration': 1, # link-time code generation
127 'OptimizeReferences': 2, # /OPT:REF
128 'EnableCOMDATFolding': 2, # /OPT:ICF
129 'LinkIncremental': 1, # disable incremental linking
134 # Forcibly disable -Werror. We support a wide range of compilers, it's
135 # simply not feasible to squelch all warnings, never mind that the
136 # libraries in deps/ are not under our control.
137 'cflags!': ['-Werror'],
139 'VCCLCompilerTool': {
140 'StringPooling': 'true', # pool string literals
141 'DebugInformationFormat': 3, # Generate a PDB
143 'BufferSecurityCheck': 'true',
144 'ExceptionHandling': 0, # /EHsc
145 'SuppressStartupBanner': 'true',
146 'WarnAsError': 'false',
152 ['target_arch=="ia32"', {
153 'TargetMachine' : 1, # /MACHINE:X86
154 'target_conditions': [
155 ['_type=="executable"', {
156 'AdditionalOptions': [ '/SubSystem:Console,"5.01"' ],
160 ['target_arch=="x64"', {
161 'TargetMachine' : 17, # /MACHINE:AMD64
162 'target_conditions': [
163 ['_type=="executable"', {
164 'AdditionalOptions': [ '/SubSystem:Console,"5.02"' ],
169 'GenerateDebugInformation': 'true',
170 'GenerateMapFile': 'true', # /MAP
171 'MapExports': 'true', # /MAPINFO:EXPORTS
172 'RandomizedBaseAddress': 2, # enable ASLR
173 'DataExecutionPrevention': 2, # enable DEP
174 'AllowIsolation': 'true',
175 'SuppressStartupBanner': 'true',
178 'msvs_disabled_warnings': [4351, 4355, 4800],
180 ['asan == 1 and OS != "mac"', {
182 '-fno-omit-frame-pointer',
183 '-fsanitize=address',
186 'cflags!': [ '-fomit-frame-pointer' ],
187 'ldflags': [ '-fsanitize=address' ],
189 ['asan == 1 and OS == "mac"', {
192 '-fno-omit-frame-pointer',
193 '-gline-tables-only',
194 '-fsanitize=address',
198 '-fomit-frame-pointer',
201 'target_conditions': [
202 ['_type!="static_library"', {
203 'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
208 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
211 # we don't really want VC++ warning us about
212 # how dangerous C functions are...
213 '_CRT_SECURE_NO_DEPRECATE',
214 # ... or that C implementations shouldn't use
216 '_CRT_NONSTDC_NO_DEPRECATE',
217 # Make sure the STL doesn't try to use exceptions
219 'BUILDING_V8_SHARED=1',
220 'BUILDING_UV_SHARED=1',
223 [ 'OS in "linux freebsd openbsd solaris aix"', {
224 'cflags': [ '-pthread', ],
225 'ldflags': [ '-pthread' ],
227 [ 'OS in "linux freebsd openbsd solaris android aix"', {
228 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
229 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
230 'ldflags': [ '-rdynamic' ],
231 'target_conditions': [
232 ['_type=="static_library"', {
233 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
237 [ 'target_arch=="ia32"', {
238 'cflags': [ '-m32' ],
239 'ldflags': [ '-m32' ],
241 [ 'target_arch=="x32"', {
242 'cflags': [ '-mx32' ],
243 'ldflags': [ '-mx32' ],
245 [ 'target_arch=="x64"', {
246 'cflags': [ '-m64' ],
247 'ldflags': [ '-m64' ],
249 [ 'target_arch=="ppc" and OS!="aix"', {
250 'cflags': [ '-m32' ],
251 'ldflags': [ '-m32' ],
253 [ 'target_arch=="ppc64" and OS!="aix"', {
254 'cflags': [ '-m64', '-mminimal-toc' ],
255 'ldflags': [ '-m64' ],
258 'cflags': [ '-pthreads' ],
259 'ldflags': [ '-pthreads' ],
260 'cflags!': [ '-pthread' ],
261 'ldflags!': [ '-pthread' ],
265 [ 'target_arch=="ppc"', {
266 'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ],
268 [ 'target_arch=="ppc64"', {
269 'cflags': [ '-maix64' ],
270 'ldflags': [ '-maix64' ],
273 'ldflags!': [ '-rdynamic' ],
278 'defines': ['_GLIBCXX_USE_C99_MATH'],
279 'libraries': [ '-llog' ],
282 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
284 'ALWAYS_SEARCH_USER_PATHS': 'NO',
285 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
286 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
287 # (Equivalent to -fPIC)
288 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
289 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
290 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
291 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
292 'PREBINDING': 'NO', # No -Wl,-prebind
293 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
294 'USE_HEADERMAP': 'NO',
296 '-fno-strict-aliasing',
302 '-Wno-unused-parameter',
305 'target_conditions': [
306 ['_type!="static_library"', {
307 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
311 ['target_arch=="ia32"', {
312 'xcode_settings': {'ARCHS': ['i386']},
314 ['target_arch=="x64"', {
315 'xcode_settings': {'ARCHS': ['x86_64']},
319 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
320 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
325 ['OS=="freebsd" and node_use_dtrace=="true"', {
326 'libraries': [ '-lelf' ],
330 '-Wl,--export-dynamic',