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 # Disable support for postmortem debugging, continuously broken.
24 'v8_postmortem_support%': 'false',
26 # Don't bake anything extra into the snapshot.
27 'v8_use_external_startup_data%': 0,
35 ['GENERATOR == "ninja" or OS== "mac"', {
36 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
37 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
39 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
40 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
51 'default_configuration': 'Release',
55 'v8_enable_handle_zapping%': 1,
57 'defines': [ 'DEBUG', '_DEBUG' ],
58 'cflags': [ '-g', '-O0' ],
60 ['target_arch=="x64"', {
61 'msvs_configuration_platform': 'x64',
66 'RuntimeLibrary': 1, # static debug
67 'Optimization': 0, # /Od, no optimization
68 'MinimalRebuild': 'false',
69 'OmitFramePointers': 'false',
70 'BasicRuntimeChecks': 3, # /RTC1
73 'LinkIncremental': 2, # enable incremental linking
77 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
82 'v8_enable_handle_zapping%': 0,
84 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
86 ['target_arch=="x64"', {
87 'msvs_configuration_platform': 'x64',
90 # pull in V8's postmortem metadata
91 'ldflags': [ '-Wl,-z,allextract' ]
93 ['OS!="mac" and OS!="win"', {
94 'cflags': [ '-fno-omit-frame-pointer' ],
99 'RuntimeLibrary': 0, # static release
100 'Optimization': 3, # /Ox, full optimization
101 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
102 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
103 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
104 'OmitFramePointers': 'true',
105 'EnableFunctionLevelLinking': 'true',
106 'EnableIntrinsicFunctions': 'true',
107 'RuntimeTypeInfo': 'false',
108 'AdditionalOptions': [
109 '/MP', # compile across multiple CPUs
113 'AdditionalOptions': [
114 '/LTCG', # link time code generation
118 'LinkTimeCodeGeneration': 1, # link-time code generation
119 'OptimizeReferences': 2, # /OPT:REF
120 'EnableCOMDATFolding': 2, # /OPT:ICF
121 'LinkIncremental': 1, # disable incremental linking
126 # Forcibly disable -Werror. We support a wide range of compilers, it's
127 # simply not feasible to squelch all warnings, never mind that the
128 # libraries in deps/ are not under our control.
129 'cflags!': ['-Werror'],
131 'VCCLCompilerTool': {
132 'StringPooling': 'true', # pool string literals
133 'DebugInformationFormat': 3, # Generate a PDB
135 'BufferSecurityCheck': 'true',
136 'ExceptionHandling': 0, # /EHsc
137 'SuppressStartupBanner': 'true',
138 'WarnAsError': 'false',
144 ['target_arch=="ia32"', {
145 'TargetMachine' : 1, # /MACHINE:X86
146 'target_conditions': [
147 ['_type=="executable"', {
148 'AdditionalOptions': [ '/SubSystem:Console,"5.01"' ],
152 ['target_arch=="x64"', {
153 'TargetMachine' : 17, # /MACHINE:AMD64
154 'target_conditions': [
155 ['_type=="executable"', {
156 'AdditionalOptions': [ '/SubSystem:Console,"5.02"' ],
161 'GenerateDebugInformation': 'true',
162 'RandomizedBaseAddress': 2, # enable ASLR
163 'DataExecutionPrevention': 2, # enable DEP
164 'AllowIsolation': 'true',
165 'SuppressStartupBanner': 'true',
168 'msvs_disabled_warnings': [4351, 4355, 4800],
172 '-fno-omit-frame-pointer',
173 '-fsanitize=address',
174 '-w', # http://crbug.com/162783
176 'cflags_cc+': [ '-gline-tables-only' ],
177 'cflags!': [ '-fomit-frame-pointer' ],
178 'ldflags': [ '-fsanitize=address' ],
181 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
184 # we don't really want VC++ warning us about
185 # how dangerous C functions are...
186 '_CRT_SECURE_NO_DEPRECATE',
187 # ... or that C implementations shouldn't use
189 '_CRT_NONSTDC_NO_DEPRECATE',
190 # Make sure the STL doesn't try to use exceptions
192 'BUILDING_V8_SHARED=1',
193 'BUILDING_UV_SHARED=1',
196 [ 'OS in "linux freebsd openbsd solaris"', {
197 'cflags': [ '-pthread', ],
198 'ldflags': [ '-pthread' ],
200 [ 'OS in "linux freebsd openbsd solaris android"', {
201 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
202 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
203 'ldflags': [ '-rdynamic' ],
204 'target_conditions': [
205 ['_type=="static_library"', {
206 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
210 [ 'target_arch=="ia32"', {
211 'cflags': [ '-m32' ],
212 'ldflags': [ '-m32' ],
214 [ 'target_arch=="x32"', {
215 'cflags': [ '-mx32' ],
216 'ldflags': [ '-mx32' ],
218 [ 'target_arch=="x64"', {
219 'cflags': [ '-m64' ],
220 'ldflags': [ '-m64' ],
223 'cflags': [ '-pthreads' ],
224 'ldflags': [ '-pthreads' ],
225 'cflags!': [ '-pthread' ],
226 'ldflags!': [ '-pthread' ],
231 'defines': ['_GLIBCXX_USE_C99_MATH'],
232 'libraries': [ '-llog' ],
235 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
237 'ALWAYS_SEARCH_USER_PATHS': 'NO',
238 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
239 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
240 # (Equivalent to -fPIC)
241 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
242 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
243 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
244 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
245 'PREBINDING': 'NO', # No -Wl,-prebind
246 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
247 'USE_HEADERMAP': 'NO',
249 '-fno-strict-aliasing',
255 '-Wno-unused-parameter',
258 'target_conditions': [
259 ['_type!="static_library"', {
260 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
264 ['target_arch=="ia32"', {
265 'xcode_settings': {'ARCHS': ['i386']},
267 ['target_arch=="x64"', {
268 'xcode_settings': {'ARCHS': ['x86_64']},
272 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
273 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
278 ['OS=="freebsd" and node_use_dtrace=="true"', {
279 'libraries': [ '-lelf' ],
283 '-Wl,--export-dynamic',