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 -Og 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',
50 'default_configuration': 'Release',
54 'v8_enable_handle_zapping%': 1,
56 'defines': [ 'DEBUG', '_DEBUG' ],
57 'cflags': [ '-g', '-Og' ],
59 ['target_arch=="x64"', {
60 'msvs_configuration_platform': 'x64',
65 'RuntimeLibrary': 1, # static debug
66 'Optimization': 0, # /Od, no optimization
67 'MinimalRebuild': 'false',
68 'OmitFramePointers': 'false',
69 'BasicRuntimeChecks': 3, # /RTC1
72 'LinkIncremental': 2, # enable incremental linking
76 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
81 'v8_enable_handle_zapping%': 0,
83 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
85 ['target_arch=="x64"', {
86 'msvs_configuration_platform': 'x64',
89 # pull in V8's postmortem metadata
90 'ldflags': [ '-Wl,-z,allextract' ]
92 ['OS!="mac" and OS!="win"', {
93 'cflags': [ '-fno-omit-frame-pointer' ],
98 'RuntimeLibrary': 0, # static release
99 'Optimization': 3, # /Ox, full optimization
100 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
101 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
102 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
103 'OmitFramePointers': 'true',
104 'EnableFunctionLevelLinking': 'true',
105 'EnableIntrinsicFunctions': 'true',
106 'RuntimeTypeInfo': 'false',
107 'AdditionalOptions': [
108 '/MP', # compile across multiple CPUs
112 'AdditionalOptions': [
113 '/LTCG', # link time code generation
117 'LinkTimeCodeGeneration': 1, # link-time code generation
118 'OptimizeReferences': 2, # /OPT:REF
119 'EnableCOMDATFolding': 2, # /OPT:ICF
120 'LinkIncremental': 1, # disable incremental linking
125 # Forcibly disable -Werror. We support a wide range of compilers, it's
126 # simply not feasible to squelch all warnings, never mind that the
127 # libraries in deps/ are not under our control.
128 'cflags!': ['-Werror'],
130 'VCCLCompilerTool': {
131 'StringPooling': 'true', # pool string literals
132 'DebugInformationFormat': 3, # Generate a PDB
134 'BufferSecurityCheck': 'true',
135 'ExceptionHandling': 0, # /EHsc
136 'SuppressStartupBanner': 'true',
137 'WarnAsError': 'false',
143 ['target_arch=="ia32"', {
144 'TargetMachine' : 1, # /MACHINE:X86
145 'target_conditions': [
146 ['_type=="executable"', {
147 'AdditionalOptions': [ '/SubSystem:Console,"5.01"' ],
151 ['target_arch=="x64"', {
152 'TargetMachine' : 17, # /MACHINE:AMD64
153 'target_conditions': [
154 ['_type=="executable"', {
155 'AdditionalOptions': [ '/SubSystem:Console,"5.02"' ],
160 'GenerateDebugInformation': 'true',
161 'RandomizedBaseAddress': 2, # enable ASLR
162 'DataExecutionPrevention': 2, # enable DEP
163 'AllowIsolation': 'true',
164 'SuppressStartupBanner': 'true',
167 'msvs_disabled_warnings': [4351, 4355, 4800],
171 '-fno-omit-frame-pointer',
172 '-fsanitize=address',
173 '-w', # http://crbug.com/162783
175 'cflags_cc+': [ '-gline-tables-only' ],
176 'cflags!': [ '-fomit-frame-pointer' ],
177 'ldflags': [ '-fsanitize=address' ],
180 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
183 # we don't really want VC++ warning us about
184 # how dangerous C functions are...
185 '_CRT_SECURE_NO_DEPRECATE',
186 # ... or that C implementations shouldn't use
188 '_CRT_NONSTDC_NO_DEPRECATE',
189 # Make sure the STL doesn't try to use exceptions
191 'BUILDING_V8_SHARED=1',
192 'BUILDING_UV_SHARED=1',
195 [ 'OS in "linux freebsd openbsd solaris"', {
196 'cflags': [ '-pthread', ],
197 'ldflags': [ '-pthread' ],
199 [ 'OS in "linux freebsd openbsd solaris android"', {
200 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
201 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
202 'ldflags': [ '-rdynamic' ],
203 'target_conditions': [
204 ['_type=="static_library"', {
205 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
209 [ 'target_arch=="ia32"', {
210 'cflags': [ '-m32' ],
211 'ldflags': [ '-m32' ],
213 [ 'target_arch=="x32"', {
214 'cflags': [ '-mx32' ],
215 'ldflags': [ '-mx32' ],
217 [ 'target_arch=="x64"', {
218 'cflags': [ '-m64' ],
219 'ldflags': [ '-m64' ],
222 'cflags': [ '-pthreads' ],
223 'ldflags': [ '-pthreads' ],
224 'cflags!': [ '-pthread' ],
225 'ldflags!': [ '-pthread' ],
230 'defines': ['_GLIBCXX_USE_C99_MATH'],
231 'libraries': [ '-llog' ],
234 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
236 'ALWAYS_SEARCH_USER_PATHS': 'NO',
237 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
238 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
239 # (Equivalent to -fPIC)
240 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
241 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
242 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
243 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
244 'PREBINDING': 'NO', # No -Wl,-prebind
245 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
246 'USE_HEADERMAP': 'NO',
248 '-fno-strict-aliasing',
254 '-Wno-unused-parameter',
257 'target_conditions': [
258 ['_type!="static_library"', {
259 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
263 ['target_arch=="ia32"', {
264 'xcode_settings': {'ARCHS': ['i386']},
266 ['target_arch=="x64"', {
267 'xcode_settings': {'ARCHS': ['x86_64']},
271 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
272 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
277 ['OS=="freebsd" and node_use_dtrace=="true"', {
278 'libraries': [ '-lelf' ],
282 '-Wl,--export-dynamic',