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 disassembler for `--print-code` v8 options
16 'v8_enable_disassembler': 1,
18 # Enable V8's post-mortem debugging only on unix flavors.
22 'v8_postmortem_support': 'false'
25 'v8_postmortem_support': 'true'
27 ['GENERATOR == "ninja" or OS== "mac"', {
28 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
29 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
31 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
32 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
38 'default_configuration': 'Release',
42 'v8_enable_handle_zapping%': 1,
44 'defines': [ 'DEBUG', '_DEBUG' ],
45 'cflags': [ '-g', '-O0' ],
47 ['target_arch=="x64"', {
48 'msvs_configuration_platform': 'x64',
53 'RuntimeLibrary': 1, # static debug
54 'Optimization': 0, # /Od, no optimization
55 'MinimalRebuild': 'false',
56 'OmitFramePointers': 'false',
57 'BasicRuntimeChecks': 3, # /RTC1
60 'LinkIncremental': 2, # enable incremental linking
64 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
69 'v8_enable_handle_zapping%': 0,
71 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
73 ['target_arch=="x64"', {
74 'msvs_configuration_platform': 'x64',
77 # pull in V8's postmortem metadata
78 'ldflags': [ '-Wl,-z,allextract' ]
80 ['clang == 0 and gcc_version >= 40', {
81 'cflags': [ '-fno-tree-vrp' ], # Work around compiler bug.
83 ['clang == 0 and gcc_version <= 44', {
84 'cflags': [ '-fno-tree-sink' ], # Work around compiler bug.
86 ['OS!="mac" and OS!="win"', {
87 'cflags': [ '-fno-omit-frame-pointer' ],
92 'RuntimeLibrary': 0, # static release
93 'Optimization': 3, # /Ox, full optimization
94 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
95 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
96 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
97 'OmitFramePointers': 'true',
98 'EnableFunctionLevelLinking': 'true',
99 'EnableIntrinsicFunctions': 'true',
100 'RuntimeTypeInfo': 'false',
101 'ExceptionHandling': '0',
102 'AdditionalOptions': [
103 '/MP', # compile across multiple CPUs
107 'AdditionalOptions': [
108 '/LTCG', # link time code generation
112 'LinkTimeCodeGeneration': 1, # link-time code generation
113 'OptimizeReferences': 2, # /OPT:REF
114 'EnableCOMDATFolding': 2, # /OPT:ICF
115 'LinkIncremental': 1, # disable incremental linking
120 # Forcibly disable -Werror. We support a wide range of compilers, it's
121 # simply not feasible to squelch all warnings, never mind that the
122 # libraries in deps/ are not under our control.
123 'cflags!': ['-Werror'],
125 'VCCLCompilerTool': {
126 'StringPooling': 'true', # pool string literals
127 'DebugInformationFormat': 3, # Generate a PDB
129 'BufferSecurityCheck': 'true',
130 'ExceptionHandling': 1, # /EHsc
131 'SuppressStartupBanner': 'true',
132 'WarnAsError': 'false',
138 ['target_arch=="x64"', {
139 'TargetMachine' : 17 # /MACHINE:X64
142 'GenerateDebugInformation': 'true',
143 'RandomizedBaseAddress': 2, # enable ASLR
144 'DataExecutionPrevention': 2, # enable DEP
145 'AllowIsolation': 'true',
146 'SuppressStartupBanner': 'true',
147 'target_conditions': [
148 ['_type=="executable"', {
149 'SubSystem': 1, # console executable
154 'msvs_disabled_warnings': [4351, 4355, 4800],
157 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
160 # we don't really want VC++ warning us about
161 # how dangerous C functions are...
162 '_CRT_SECURE_NO_DEPRECATE',
163 # ... or that C implementations shouldn't use
165 '_CRT_NONSTDC_NO_DEPRECATE',
166 'BUILDING_V8_SHARED=1',
167 'BUILDING_UV_SHARED=1',
170 [ 'OS in "linux freebsd openbsd solaris"', {
171 'cflags': [ '-pthread', ],
172 'ldflags': [ '-pthread' ],
174 [ 'OS in "linux freebsd openbsd solaris android"', {
175 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
176 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
177 'ldflags': [ '-rdynamic' ],
178 'target_conditions': [
179 ['_type=="static_library"', {
180 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
184 [ 'target_arch=="ia32"', {
185 'cflags': [ '-m32' ],
186 'ldflags': [ '-m32' ],
188 [ 'target_arch=="x64"', {
189 'cflags': [ '-m64' ],
190 'ldflags': [ '-m64' ],
193 'cflags': [ '-pthreads' ],
194 'ldflags': [ '-pthreads' ],
195 'cflags!': [ '-pthread' ],
196 'ldflags!': [ '-pthread' ],
201 'defines': ['_GLIBCXX_USE_C99_MATH'],
202 'libraries': [ '-llog' ],
205 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
207 'ALWAYS_SEARCH_USER_PATHS': 'NO',
208 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
209 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
210 # (Equivalent to -fPIC)
211 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
212 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
213 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
214 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
215 'PREBINDING': 'NO', # No -Wl,-prebind
216 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
217 'USE_HEADERMAP': 'NO',
219 '-fno-strict-aliasing',
225 '-Wno-unused-parameter',
228 'target_conditions': [
229 ['_type!="static_library"', {
230 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
234 ['target_arch=="ia32"', {
235 'xcode_settings': {'ARCHS': ['i386']},
237 ['target_arch=="x64"', {
238 'xcode_settings': {'ARCHS': ['x86_64']},
242 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
243 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
248 ['OS=="freebsd" and node_use_dtrace=="true"', {
249 'libraries': [ '-lelf' ],
253 '-Wl,--export-dynamic',