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_cc+': [ '-gline-tables-only' ],
187 'cflags!': [ '-fomit-frame-pointer' ],
188 'ldflags': [ '-fsanitize=address' ],
190 ['asan == 1 and OS == "mac"', {
193 '-fno-omit-frame-pointer',
194 '-gline-tables-only',
195 '-fsanitize=address',
199 '-fomit-frame-pointer',
202 'target_conditions': [
203 ['_type!="static_library"', {
204 'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
209 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
212 # we don't really want VC++ warning us about
213 # how dangerous C functions are...
214 '_CRT_SECURE_NO_DEPRECATE',
215 # ... or that C implementations shouldn't use
217 '_CRT_NONSTDC_NO_DEPRECATE',
218 # Make sure the STL doesn't try to use exceptions
220 'BUILDING_V8_SHARED=1',
221 'BUILDING_UV_SHARED=1',
224 [ 'OS in "linux freebsd openbsd solaris aix"', {
225 'cflags': [ '-pthread', ],
226 'ldflags': [ '-pthread' ],
228 [ 'OS in "linux freebsd openbsd solaris android aix"', {
229 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
230 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
231 'ldflags': [ '-rdynamic' ],
232 'target_conditions': [
233 ['_type=="static_library"', {
234 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
238 [ 'target_arch=="ia32"', {
239 'cflags': [ '-m32' ],
240 'ldflags': [ '-m32' ],
242 [ 'target_arch=="x32"', {
243 'cflags': [ '-mx32' ],
244 'ldflags': [ '-mx32' ],
246 [ 'target_arch=="x64"', {
247 'cflags': [ '-m64' ],
248 'ldflags': [ '-m64' ],
250 [ 'target_arch=="ppc" and OS!="aix"', {
251 'cflags': [ '-m32' ],
252 'ldflags': [ '-m32' ],
254 [ 'target_arch=="ppc64" and OS!="aix"', {
255 'cflags': [ '-m64', '-mminimal-toc' ],
256 'ldflags': [ '-m64' ],
259 'cflags': [ '-pthreads' ],
260 'ldflags': [ '-pthreads' ],
261 'cflags!': [ '-pthread' ],
262 'ldflags!': [ '-pthread' ],
266 [ 'target_arch=="ppc"', {
267 'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ],
269 [ 'target_arch=="ppc64"', {
270 'cflags': [ '-maix64' ],
271 'ldflags': [ '-maix64' ],
274 'ldflags!': [ '-rdynamic' ],
279 'defines': ['_GLIBCXX_USE_C99_MATH'],
280 'libraries': [ '-llog' ],
283 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
285 'ALWAYS_SEARCH_USER_PATHS': 'NO',
286 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
287 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
288 # (Equivalent to -fPIC)
289 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
290 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
291 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
292 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
293 'PREBINDING': 'NO', # No -Wl,-prebind
294 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
295 'USE_HEADERMAP': 'NO',
297 '-fno-strict-aliasing',
303 '-Wno-unused-parameter',
306 'target_conditions': [
307 ['_type!="static_library"', {
308 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
312 ['target_arch=="ia32"', {
313 'xcode_settings': {'ARCHS': ['i386']},
315 ['target_arch=="x64"', {
316 'xcode_settings': {'ARCHS': ['x86_64']},
320 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
321 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
326 ['OS=="freebsd" and node_use_dtrace=="true"', {
327 'libraries': [ '-lelf' ],
331 '-Wl,--export-dynamic',