3 'werror': '', # Turn off -Werror in V8 build.
4 'visibility%': 'hidden', # V8's visibility setting
5 'target_arch%': 'ia32', # set v8's target architecture
6 'host_arch%': 'ia32', # set v8's host architecture
7 'want_separate_host_toolset%': 0, # V8 should not build target and host
8 'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
9 'component%': 'static_library', # NB. these names match with what V8 expects
10 'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
11 'gcc_version%': 'unknown',
15 # Enable V8's post-mortem debugging only on unix flavors.
19 'v8_postmortem_support': 'false'
22 'v8_postmortem_support': 'true'
24 ['GENERATOR == "ninja"', {
25 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
26 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.<(target_arch).a',
28 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
29 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.<(target_arch).a',
35 'default_configuration': 'Release',
39 'v8_enable_handle_zapping%': 1,
41 'defines': [ 'DEBUG', '_DEBUG' ],
42 'cflags': [ '-g', '-O0' ],
44 ['target_arch=="x64"', {
45 'msvs_configuration_platform': 'x64',
50 'RuntimeLibrary': 1, # static debug
51 'Optimization': 0, # /Od, no optimization
52 'MinimalRebuild': 'false',
53 'OmitFramePointers': 'false',
54 'BasicRuntimeChecks': 3, # /RTC1
57 'LinkIncremental': 2, # enable incremental linking
61 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
66 'v8_enable_handle_zapping%': 0,
68 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
70 ['target_arch=="x64"', {
71 'msvs_configuration_platform': 'x64',
74 # pull in V8's postmortem metadata
75 'ldflags': [ '-Wl,-z,allextract' ]
77 ['clang == 0 and gcc_version >= 40', {
78 'cflags': [ '-fno-tree-vrp' ], # Work around compiler bug.
80 ['clang == 0 and gcc_version <= 44', {
81 'cflags': [ '-fno-tree-sink' ], # Work around compiler bug.
83 ['OS!="mac" and OS!="win"', {
84 'cflags': [ '-fno-omit-frame-pointer' ],
89 'RuntimeLibrary': 0, # static release
90 'Optimization': 3, # /Ox, full optimization
91 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
92 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
93 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
94 'OmitFramePointers': 'true',
95 'EnableFunctionLevelLinking': 'true',
96 'EnableIntrinsicFunctions': 'true',
97 'RuntimeTypeInfo': 'false',
98 'ExceptionHandling': '0',
99 'AdditionalOptions': [
100 '/MP', # compile across multiple CPUs
104 'AdditionalOptions': [
105 '/LTCG', # link time code generation
109 'LinkTimeCodeGeneration': 1, # link-time code generation
110 'OptimizeReferences': 2, # /OPT:REF
111 'EnableCOMDATFolding': 2, # /OPT:ICF
112 'LinkIncremental': 1, # disable incremental linking
117 # Forcibly disable -Werror. We support a wide range of compilers, it's
118 # simply not feasible to squelch all warnings, never mind that the
119 # libraries in deps/ are not under our control.
120 'cflags!': ['-Werror'],
122 'VCCLCompilerTool': {
123 'StringPooling': 'true', # pool string literals
124 'DebugInformationFormat': 3, # Generate a PDB
126 'BufferSecurityCheck': 'true',
127 'ExceptionHandling': 1, # /EHsc
128 'SuppressStartupBanner': 'true',
129 'WarnAsError': 'false',
135 ['target_arch=="x64"', {
136 'TargetMachine' : 17 # /MACHINE:X64
139 'GenerateDebugInformation': 'true',
140 'RandomizedBaseAddress': 2, # enable ASLR
141 'DataExecutionPrevention': 2, # enable DEP
142 'AllowIsolation': 'true',
143 'SuppressStartupBanner': 'true',
144 'target_conditions': [
145 ['_type=="executable"', {
146 'SubSystem': 1, # console executable
151 'msvs_disabled_warnings': [4351, 4355, 4800],
154 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
157 # we don't really want VC++ warning us about
158 # how dangerous C functions are...
159 '_CRT_SECURE_NO_DEPRECATE',
160 # ... or that C implementations shouldn't use
162 '_CRT_NONSTDC_NO_DEPRECATE',
163 'BUILDING_V8_SHARED=1',
164 'BUILDING_UV_SHARED=1',
167 [ 'OS in "linux freebsd openbsd solaris"', {
168 'cflags': [ '-pthread', ],
169 'ldflags': [ '-pthread' ],
171 [ 'OS in "linux freebsd openbsd solaris android"', {
172 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
173 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
174 'ldflags': [ '-rdynamic' ],
175 'target_conditions': [
176 ['_type=="static_library"', {
177 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
181 [ 'target_arch=="ia32"', {
182 'cflags': [ '-m32' ],
183 'ldflags': [ '-m32' ],
185 [ 'target_arch=="x64"', {
186 'cflags': [ '-m64' ],
187 'ldflags': [ '-m64' ],
190 'cflags': [ '-pthreads' ],
191 'ldflags': [ '-pthreads' ],
192 'cflags!': [ '-pthread' ],
193 'ldflags!': [ '-pthread' ],
198 'defines': ['_GLIBCXX_USE_C99_MATH'],
199 'libraries': [ '-llog' ],
202 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
204 'ALWAYS_SEARCH_USER_PATHS': 'NO',
205 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
206 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
207 # (Equivalent to -fPIC)
208 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
209 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
210 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
211 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
212 'PREBINDING': 'NO', # No -Wl,-prebind
213 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
214 'USE_HEADERMAP': 'NO',
216 '-fno-strict-aliasing',
222 '-Wno-unused-parameter',
225 'target_conditions': [
226 ['_type!="static_library"', {
227 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
231 ['target_arch=="ia32"', {
232 'xcode_settings': {'ARCHS': ['i386']},
234 ['target_arch=="x64"', {
235 'xcode_settings': {'ARCHS': ['x86_64']},
239 ['OS=="freebsd" and node_use_dtrace=="true"', {
240 'libraries': [ '-lelf' ],