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 # Enable V8's post-mortem debugging only on unix flavors.
27 'v8_postmortem_support': 'false'
30 'v8_postmortem_support': 'true'
32 ['GENERATOR == "ninja" or OS== "mac"', {
33 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
34 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
36 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
37 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
48 'default_configuration': 'Release',
52 'v8_enable_handle_zapping%': 1,
54 'defines': [ 'DEBUG', '_DEBUG' ],
55 'cflags': [ '-g', '-O0' ],
57 ['target_arch=="x64"', {
58 'msvs_configuration_platform': 'x64',
63 'RuntimeLibrary': 1, # static debug
64 'Optimization': 0, # /Od, no optimization
65 'MinimalRebuild': 'false',
66 'OmitFramePointers': 'false',
67 'BasicRuntimeChecks': 3, # /RTC1
70 'LinkIncremental': 2, # enable incremental linking
74 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
79 'v8_enable_handle_zapping%': 0,
81 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
83 ['target_arch=="x64"', {
84 'msvs_configuration_platform': 'x64',
87 # pull in V8's postmortem metadata
88 'ldflags': [ '-Wl,-z,allextract' ]
90 ['OS!="mac" and OS!="win"', {
91 'cflags': [ '-fno-omit-frame-pointer' ],
96 'RuntimeLibrary': 0, # static release
97 'Optimization': 3, # /Ox, full optimization
98 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
99 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
100 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
101 'OmitFramePointers': 'true',
102 'EnableFunctionLevelLinking': 'true',
103 'EnableIntrinsicFunctions': 'true',
104 'RuntimeTypeInfo': 'false',
105 'ExceptionHandling': '0',
106 'AdditionalOptions': [
107 '/MP', # compile across multiple CPUs
111 'AdditionalOptions': [
112 '/LTCG', # link time code generation
116 'LinkTimeCodeGeneration': 1, # link-time code generation
117 'OptimizeReferences': 2, # /OPT:REF
118 'EnableCOMDATFolding': 2, # /OPT:ICF
119 'LinkIncremental': 1, # disable incremental linking
124 # Forcibly disable -Werror. We support a wide range of compilers, it's
125 # simply not feasible to squelch all warnings, never mind that the
126 # libraries in deps/ are not under our control.
127 'cflags!': ['-Werror'],
129 'VCCLCompilerTool': {
130 'StringPooling': 'true', # pool string literals
131 'DebugInformationFormat': 3, # Generate a PDB
133 'BufferSecurityCheck': 'true',
134 'ExceptionHandling': 1, # /EHsc
135 'SuppressStartupBanner': 'true',
136 'WarnAsError': 'false',
142 ['target_arch=="x64"', {
143 'TargetMachine' : 17 # /MACHINE:X64
146 'GenerateDebugInformation': 'true',
147 'RandomizedBaseAddress': 2, # enable ASLR
148 'DataExecutionPrevention': 2, # enable DEP
149 'AllowIsolation': 'true',
150 'SuppressStartupBanner': 'true',
151 'target_conditions': [
152 ['_type=="executable"', {
153 'SubSystem': 1, # console executable
158 'msvs_disabled_warnings': [4351, 4355, 4800],
162 '-fno-omit-frame-pointer',
163 '-fsanitize=address',
164 '-w', # http://crbug.com/162783
166 'cflags_cc+': [ '-gline-tables-only' ],
167 'cflags!': [ '-fomit-frame-pointer' ],
168 'ldflags': [ '-fsanitize=address' ],
171 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
174 # we don't really want VC++ warning us about
175 # how dangerous C functions are...
176 '_CRT_SECURE_NO_DEPRECATE',
177 # ... or that C implementations shouldn't use
179 '_CRT_NONSTDC_NO_DEPRECATE',
180 'BUILDING_V8_SHARED=1',
181 'BUILDING_UV_SHARED=1',
184 [ 'OS in "linux freebsd openbsd solaris"', {
185 'cflags': [ '-pthread', ],
186 'ldflags': [ '-pthread' ],
188 [ 'OS in "linux freebsd openbsd solaris android"', {
189 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
190 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
191 'ldflags': [ '-rdynamic' ],
192 'target_conditions': [
193 ['_type=="static_library"', {
194 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
198 [ 'target_arch=="ia32"', {
199 'cflags': [ '-m32' ],
200 'ldflags': [ '-m32' ],
202 [ 'target_arch=="x32"', {
203 'cflags': [ '-mx32' ],
204 'ldflags': [ '-mx32' ],
206 [ 'target_arch=="x64"', {
207 'cflags': [ '-m64' ],
208 'ldflags': [ '-m64' ],
211 'cflags': [ '-pthreads' ],
212 'ldflags': [ '-pthreads' ],
213 'cflags!': [ '-pthread' ],
214 'ldflags!': [ '-pthread' ],
219 'defines': ['_GLIBCXX_USE_C99_MATH'],
220 'libraries': [ '-llog' ],
223 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
225 'ALWAYS_SEARCH_USER_PATHS': 'NO',
226 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
227 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
228 # (Equivalent to -fPIC)
229 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
230 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
231 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
232 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
233 'PREBINDING': 'NO', # No -Wl,-prebind
234 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
235 'USE_HEADERMAP': 'NO',
237 '-fno-strict-aliasing',
243 '-Wno-unused-parameter',
246 'target_conditions': [
247 ['_type!="static_library"', {
248 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
252 ['target_arch=="ia32"', {
253 'xcode_settings': {'ARCHS': ['i386']},
255 ['target_arch=="x64"', {
256 'xcode_settings': {'ARCHS': ['x86_64']},
260 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
261 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
266 ['OS=="freebsd" and node_use_dtrace=="true"', {
267 'libraries': [ '-lelf' ],
271 '-Wl,--export-dynamic',