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
12 'gcc_version%': 'unknown',
17 'uv_library%': 'static_library',
19 # Default to -O0 for debug builds.
20 'v8_optimized_debug%': 0,
22 # Enable disassembler for `--print-code` v8 options
23 'v8_enable_disassembler': 1,
25 # Enable V8's post-mortem debugging only on unix flavors.
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',
45 'default_configuration': 'Release',
49 'v8_enable_handle_zapping%': 1,
51 'defines': [ 'DEBUG', '_DEBUG' ],
52 'cflags': [ '-g', '-O0' ],
54 ['target_arch=="x64"', {
55 'msvs_configuration_platform': 'x64',
60 'RuntimeLibrary': 1, # static debug
61 'Optimization': 0, # /Od, no optimization
62 'MinimalRebuild': 'false',
63 'OmitFramePointers': 'false',
64 'BasicRuntimeChecks': 3, # /RTC1
67 'LinkIncremental': 2, # enable incremental linking
71 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
76 'v8_enable_handle_zapping%': 0,
78 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
80 ['target_arch=="x64"', {
81 'msvs_configuration_platform': 'x64',
84 # pull in V8's postmortem metadata
85 'ldflags': [ '-Wl,-z,allextract' ]
87 ['OS!="mac" and OS!="win"', {
88 'cflags': [ '-fno-omit-frame-pointer' ],
93 'RuntimeLibrary': 0, # static release
94 'Optimization': 3, # /Ox, full optimization
95 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
96 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
97 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
98 'OmitFramePointers': 'true',
99 'EnableFunctionLevelLinking': 'true',
100 'EnableIntrinsicFunctions': 'true',
101 'RuntimeTypeInfo': 'false',
102 'ExceptionHandling': '0',
103 'AdditionalOptions': [
104 '/MP', # compile across multiple CPUs
108 'AdditionalOptions': [
109 '/LTCG', # link time code generation
113 'LinkTimeCodeGeneration': 1, # link-time code generation
114 'OptimizeReferences': 2, # /OPT:REF
115 'EnableCOMDATFolding': 2, # /OPT:ICF
116 'LinkIncremental': 1, # disable incremental linking
121 # Forcibly disable -Werror. We support a wide range of compilers, it's
122 # simply not feasible to squelch all warnings, never mind that the
123 # libraries in deps/ are not under our control.
124 'cflags!': ['-Werror'],
126 'VCCLCompilerTool': {
127 'StringPooling': 'true', # pool string literals
128 'DebugInformationFormat': 3, # Generate a PDB
130 'BufferSecurityCheck': 'true',
131 'ExceptionHandling': 1, # /EHsc
132 'SuppressStartupBanner': 'true',
133 'WarnAsError': 'false',
139 ['target_arch=="x64"', {
140 'TargetMachine' : 17 # /MACHINE:X64
143 'GenerateDebugInformation': 'true',
144 'RandomizedBaseAddress': 2, # enable ASLR
145 'DataExecutionPrevention': 2, # enable DEP
146 'AllowIsolation': 'true',
147 'SuppressStartupBanner': 'true',
148 'target_conditions': [
149 ['_type=="executable"', {
150 'SubSystem': 1, # console executable
155 'msvs_disabled_warnings': [4351, 4355, 4800],
159 '-fno-omit-frame-pointer',
160 '-fsanitize=address',
161 '-w', # http://crbug.com/162783
163 'cflags_cc+': [ '-gline-tables-only' ],
164 'cflags!': [ '-fomit-frame-pointer' ],
165 'ldflags': [ '-fsanitize=address' ],
168 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
171 # we don't really want VC++ warning us about
172 # how dangerous C functions are...
173 '_CRT_SECURE_NO_DEPRECATE',
174 # ... or that C implementations shouldn't use
176 '_CRT_NONSTDC_NO_DEPRECATE',
177 'BUILDING_V8_SHARED=1',
178 'BUILDING_UV_SHARED=1',
181 [ 'OS in "linux freebsd openbsd solaris"', {
182 'cflags': [ '-pthread', ],
183 'ldflags': [ '-pthread' ],
185 [ 'OS in "linux freebsd openbsd solaris android"', {
186 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
187 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
188 'ldflags': [ '-rdynamic' ],
189 'target_conditions': [
190 ['_type=="static_library"', {
191 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
195 [ 'target_arch=="ia32"', {
196 'cflags': [ '-m32' ],
197 'ldflags': [ '-m32' ],
199 [ 'target_arch=="x32"', {
200 'cflags': [ '-mx32' ],
201 'ldflags': [ '-mx32' ],
203 [ 'target_arch=="x64"', {
204 'cflags': [ '-m64' ],
205 'ldflags': [ '-m64' ],
208 'cflags': [ '-pthreads' ],
209 'ldflags': [ '-pthreads' ],
210 'cflags!': [ '-pthread' ],
211 'ldflags!': [ '-pthread' ],
216 'defines': ['_GLIBCXX_USE_C99_MATH'],
217 'libraries': [ '-llog' ],
220 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
222 'ALWAYS_SEARCH_USER_PATHS': 'NO',
223 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
224 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
225 # (Equivalent to -fPIC)
226 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
227 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
228 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
229 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
230 'PREBINDING': 'NO', # No -Wl,-prebind
231 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
232 'USE_HEADERMAP': 'NO',
234 '-fno-strict-aliasing',
240 '-Wno-unused-parameter',
243 'target_conditions': [
244 ['_type!="static_library"', {
245 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
249 ['target_arch=="ia32"', {
250 'xcode_settings': {'ARCHS': ['i386']},
252 ['target_arch=="x64"', {
253 'xcode_settings': {'ARCHS': ['x86_64']},
257 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
258 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
263 ['OS=="freebsd" and node_use_dtrace=="true"', {
264 'libraries': [ '-lelf' ],
268 '-Wl,--export-dynamic',