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',
70 'RuntimeLibrary': 1, # static debug
71 'Optimization': 0, # /Od, no optimization
72 'MinimalRebuild': 'false',
73 'OmitFramePointers': 'false',
74 'BasicRuntimeChecks': 3, # /RTC1
77 'LinkIncremental': 2, # enable incremental linking
81 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
86 'v8_enable_handle_zapping': 0,
88 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
90 ['target_arch=="x64"', {
91 'msvs_configuration_platform': 'x64',
94 # pull in V8's postmortem metadata
95 'ldflags': [ '-Wl,-z,allextract' ]
97 ['OS!="mac" and OS!="win"', {
98 'cflags': [ '-fno-omit-frame-pointer' ],
102 'VCCLCompilerTool': {
103 'RuntimeLibrary': 0, # static release
104 'Optimization': 3, # /Ox, full optimization
105 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
106 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
107 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
108 'OmitFramePointers': 'true',
109 'EnableFunctionLevelLinking': 'true',
110 'EnableIntrinsicFunctions': 'true',
111 'RuntimeTypeInfo': 'false',
112 'AdditionalOptions': [
113 '/MP', # compile across multiple CPUs
117 'AdditionalOptions': [
118 '/LTCG', # link time code generation
122 'LinkTimeCodeGeneration': 1, # link-time code generation
123 'OptimizeReferences': 2, # /OPT:REF
124 'EnableCOMDATFolding': 2, # /OPT:ICF
125 'LinkIncremental': 1, # disable incremental linking
130 # Forcibly disable -Werror. We support a wide range of compilers, it's
131 # simply not feasible to squelch all warnings, never mind that the
132 # libraries in deps/ are not under our control.
133 'cflags!': ['-Werror'],
135 'VCCLCompilerTool': {
136 'StringPooling': 'true', # pool string literals
137 'DebugInformationFormat': 3, # Generate a PDB
139 'BufferSecurityCheck': 'true',
140 'ExceptionHandling': 0, # /EHsc
141 'SuppressStartupBanner': 'true',
142 'WarnAsError': 'false',
148 ['target_arch=="ia32"', {
149 'TargetMachine' : 1, # /MACHINE:X86
150 'target_conditions': [
151 ['_type=="executable"', {
152 'AdditionalOptions': [ '/SubSystem:Console,"5.01"' ],
156 ['target_arch=="x64"', {
157 'TargetMachine' : 17, # /MACHINE:AMD64
158 'target_conditions': [
159 ['_type=="executable"', {
160 'AdditionalOptions': [ '/SubSystem:Console,"5.02"' ],
165 'GenerateDebugInformation': 'true',
166 'GenerateMapFile': 'true', # /MAP
167 'MapExports': 'true', # /MAPINFO:EXPORTS
168 'RandomizedBaseAddress': 2, # enable ASLR
169 'DataExecutionPrevention': 2, # enable DEP
170 'AllowIsolation': 'true',
171 'SuppressStartupBanner': 'true',
174 'msvs_disabled_warnings': [4351, 4355, 4800],
176 ['asan == 1 and OS != "mac"', {
178 '-fno-omit-frame-pointer',
179 '-fsanitize=address',
182 'cflags_cc+': [ '-gline-tables-only' ],
183 'cflags!': [ '-fomit-frame-pointer' ],
184 'ldflags': [ '-fsanitize=address' ],
186 ['asan == 1 and OS == "mac"', {
189 '-fno-omit-frame-pointer',
190 '-gline-tables-only',
191 '-fsanitize=address',
195 '-fomit-frame-pointer',
198 'target_conditions': [
199 ['_type!="static_library"', {
200 'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
205 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
208 # we don't really want VC++ warning us about
209 # how dangerous C functions are...
210 '_CRT_SECURE_NO_DEPRECATE',
211 # ... or that C implementations shouldn't use
213 '_CRT_NONSTDC_NO_DEPRECATE',
214 # Make sure the STL doesn't try to use exceptions
216 'BUILDING_V8_SHARED=1',
217 'BUILDING_UV_SHARED=1',
220 [ 'OS in "linux freebsd openbsd solaris"', {
221 'cflags': [ '-pthread', ],
222 'ldflags': [ '-pthread' ],
224 [ 'OS in "linux freebsd openbsd solaris android"', {
225 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
226 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
227 'ldflags': [ '-rdynamic' ],
228 'target_conditions': [
229 ['_type=="static_library"', {
230 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
234 [ 'target_arch=="ia32"', {
235 'cflags': [ '-m32' ],
236 'ldflags': [ '-m32' ],
238 [ 'target_arch=="x32"', {
239 'cflags': [ '-mx32' ],
240 'ldflags': [ '-mx32' ],
242 [ 'target_arch=="x64"', {
243 'cflags': [ '-m64' ],
244 'ldflags': [ '-m64' ],
246 [ 'target_arch=="ppc"', {
247 'cflags': [ '-m32' ],
248 'ldflags': [ '-m32' ],
250 [ 'target_arch=="ppc64"', {
251 'cflags': [ '-m64', '-mminimal-toc' ],
252 'ldflags': [ '-m64' ],
255 'cflags': [ '-pthreads' ],
256 'ldflags': [ '-pthreads' ],
257 'cflags!': [ '-pthread' ],
258 'ldflags!': [ '-pthread' ],
263 'defines': ['_GLIBCXX_USE_C99_MATH'],
264 'libraries': [ '-llog' ],
267 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
269 'ALWAYS_SEARCH_USER_PATHS': 'NO',
270 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
271 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
272 # (Equivalent to -fPIC)
273 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
274 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
275 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
276 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
277 'PREBINDING': 'NO', # No -Wl,-prebind
278 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
279 'USE_HEADERMAP': 'NO',
281 '-fno-strict-aliasing',
287 '-Wno-unused-parameter',
290 'target_conditions': [
291 ['_type!="static_library"', {
292 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
296 ['target_arch=="ia32"', {
297 'xcode_settings': {'ARCHS': ['i386']},
299 ['target_arch=="x64"', {
300 'xcode_settings': {'ARCHS': ['x86_64']},
304 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
305 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
310 ['OS=="freebsd" and node_use_dtrace=="true"', {
311 'libraries': [ '-lelf' ],
315 '-Wl,--export-dynamic',