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' ],
60 'cflags': [ '-O0' ], # https://llvm.org/bugs/show_bug.cgi?id=20765
62 'cflags': [ '-Og' ], # Debug-friendly optimizations only.
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 'RandomizedBaseAddress': 2, # enable ASLR
167 'DataExecutionPrevention': 2, # enable DEP
168 'AllowIsolation': 'true',
169 'SuppressStartupBanner': 'true',
172 'msvs_disabled_warnings': [4351, 4355, 4800],
176 '-fno-omit-frame-pointer',
177 '-fsanitize=address',
178 '-w', # http://crbug.com/162783
180 'cflags_cc+': [ '-gline-tables-only' ],
181 'cflags!': [ '-fomit-frame-pointer' ],
182 'ldflags': [ '-fsanitize=address' ],
185 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
188 # we don't really want VC++ warning us about
189 # how dangerous C functions are...
190 '_CRT_SECURE_NO_DEPRECATE',
191 # ... or that C implementations shouldn't use
193 '_CRT_NONSTDC_NO_DEPRECATE',
194 # Make sure the STL doesn't try to use exceptions
196 'BUILDING_V8_SHARED=1',
197 'BUILDING_UV_SHARED=1',
200 [ 'OS in "linux freebsd openbsd solaris"', {
201 'cflags': [ '-pthread', ],
202 'ldflags': [ '-pthread' ],
204 [ 'OS in "linux freebsd openbsd solaris android"', {
205 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
206 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
207 'ldflags': [ '-rdynamic' ],
208 'target_conditions': [
209 ['_type=="static_library"', {
210 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
214 [ 'target_arch=="ia32"', {
215 'cflags': [ '-m32' ],
216 'ldflags': [ '-m32' ],
218 [ 'target_arch=="x32"', {
219 'cflags': [ '-mx32' ],
220 'ldflags': [ '-mx32' ],
222 [ 'target_arch=="x64"', {
223 'cflags': [ '-m64' ],
224 'ldflags': [ '-m64' ],
227 'cflags': [ '-pthreads' ],
228 'ldflags': [ '-pthreads' ],
229 'cflags!': [ '-pthread' ],
230 'ldflags!': [ '-pthread' ],
235 'defines': ['_GLIBCXX_USE_C99_MATH'],
236 'libraries': [ '-llog' ],
239 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
241 'ALWAYS_SEARCH_USER_PATHS': 'NO',
242 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
243 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
244 # (Equivalent to -fPIC)
245 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
246 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
247 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
248 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
249 'PREBINDING': 'NO', # No -Wl,-prebind
250 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
251 'USE_HEADERMAP': 'NO',
253 '-fno-strict-aliasing',
259 '-Wno-unused-parameter',
262 'target_conditions': [
263 ['_type!="static_library"', {
264 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
268 ['target_arch=="ia32"', {
269 'xcode_settings': {'ARCHS': ['i386']},
271 ['target_arch=="x64"', {
272 'xcode_settings': {'ARCHS': ['x86_64']},
276 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
277 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
282 ['OS=="freebsd" and node_use_dtrace=="true"', {
283 'libraries': [ '-lelf' ],
287 '-Wl,--export-dynamic',