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',
16 'uv_library%': 'static_library',
18 # Default to -O0 for debug builds.
19 'v8_optimized_debug%': 0,
21 # Enable disassembler for `--print-code` v8 options
22 'v8_enable_disassembler': 1,
24 # Enable V8's post-mortem debugging only on unix flavors.
28 'v8_postmortem_support': 'false'
31 'v8_postmortem_support': 'true'
33 ['GENERATOR == "ninja" or OS== "mac"', {
34 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
35 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
37 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
38 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
44 'default_configuration': 'Release',
48 'v8_enable_handle_zapping%': 1,
50 'defines': [ 'DEBUG', '_DEBUG' ],
51 'cflags': [ '-g', '-O0' ],
53 ['target_arch=="x64"', {
54 'msvs_configuration_platform': 'x64',
59 'RuntimeLibrary': 1, # static debug
60 'Optimization': 0, # /Od, no optimization
61 'MinimalRebuild': 'false',
62 'OmitFramePointers': 'false',
63 'BasicRuntimeChecks': 3, # /RTC1
66 'LinkIncremental': 2, # enable incremental linking
70 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
75 'v8_enable_handle_zapping%': 0,
77 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
79 ['target_arch=="x64"', {
80 'msvs_configuration_platform': 'x64',
83 # pull in V8's postmortem metadata
84 'ldflags': [ '-Wl,-z,allextract' ]
86 ['clang == 0 and gcc_version >= 40', {
87 'cflags': [ '-fno-tree-vrp' ], # Work around compiler bug.
89 ['clang == 0 and gcc_version <= 44', {
90 'cflags': [ '-fno-tree-sink' ], # Work around compiler bug.
92 ['OS!="mac" and OS!="win"', {
93 'cflags': [ '-fno-omit-frame-pointer' ],
98 'RuntimeLibrary': 0, # static release
99 'Optimization': 3, # /Ox, full optimization
100 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
101 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
102 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
103 'OmitFramePointers': 'true',
104 'EnableFunctionLevelLinking': 'true',
105 'EnableIntrinsicFunctions': 'true',
106 'RuntimeTypeInfo': 'false',
107 'ExceptionHandling': '0',
108 'AdditionalOptions': [
109 '/MP', # compile across multiple CPUs
113 'AdditionalOptions': [
114 '/LTCG', # link time code generation
118 'LinkTimeCodeGeneration': 1, # link-time code generation
119 'OptimizeReferences': 2, # /OPT:REF
120 'EnableCOMDATFolding': 2, # /OPT:ICF
121 'LinkIncremental': 1, # disable incremental linking
126 # Forcibly disable -Werror. We support a wide range of compilers, it's
127 # simply not feasible to squelch all warnings, never mind that the
128 # libraries in deps/ are not under our control.
129 'cflags!': ['-Werror'],
131 'VCCLCompilerTool': {
132 'StringPooling': 'true', # pool string literals
133 'DebugInformationFormat': 3, # Generate a PDB
135 'BufferSecurityCheck': 'true',
136 'ExceptionHandling': 1, # /EHsc
137 'SuppressStartupBanner': 'true',
138 'WarnAsError': 'false',
144 ['target_arch=="x64"', {
145 'TargetMachine' : 17 # /MACHINE:X64
148 'GenerateDebugInformation': 'true',
149 'RandomizedBaseAddress': 2, # enable ASLR
150 'DataExecutionPrevention': 2, # enable DEP
151 'AllowIsolation': 'true',
152 'SuppressStartupBanner': 'true',
153 'target_conditions': [
154 ['_type=="executable"', {
155 'SubSystem': 1, # console executable
160 'msvs_disabled_warnings': [4351, 4355, 4800],
163 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
166 # we don't really want VC++ warning us about
167 # how dangerous C functions are...
168 '_CRT_SECURE_NO_DEPRECATE',
169 # ... or that C implementations shouldn't use
171 '_CRT_NONSTDC_NO_DEPRECATE',
172 'BUILDING_V8_SHARED=1',
173 'BUILDING_UV_SHARED=1',
176 [ 'OS in "linux freebsd openbsd solaris"', {
177 'cflags': [ '-pthread', ],
178 'ldflags': [ '-pthread' ],
180 [ 'OS in "linux freebsd openbsd solaris android"', {
181 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
182 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
183 'ldflags': [ '-rdynamic' ],
184 'target_conditions': [
185 ['_type=="static_library"', {
186 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
190 [ 'target_arch=="ia32"', {
191 'cflags': [ '-m32' ],
192 'ldflags': [ '-m32' ],
194 [ 'target_arch=="x32"', {
195 'cflags': [ '-mx32' ],
196 'ldflags': [ '-mx32' ],
198 [ 'target_arch=="x64"', {
199 'cflags': [ '-m64' ],
200 'ldflags': [ '-m64' ],
203 'cflags': [ '-pthreads' ],
204 'ldflags': [ '-pthreads' ],
205 'cflags!': [ '-pthread' ],
206 'ldflags!': [ '-pthread' ],
211 'defines': ['_GLIBCXX_USE_C99_MATH'],
212 'libraries': [ '-llog' ],
215 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
217 'ALWAYS_SEARCH_USER_PATHS': 'NO',
218 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
219 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
220 # (Equivalent to -fPIC)
221 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
222 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
223 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
224 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
225 'PREBINDING': 'NO', # No -Wl,-prebind
226 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
227 'USE_HEADERMAP': 'NO',
229 '-fno-strict-aliasing',
235 '-Wno-unused-parameter',
238 'target_conditions': [
239 ['_type!="static_library"', {
240 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
244 ['target_arch=="ia32"', {
245 'xcode_settings': {'ARCHS': ['i386']},
247 ['target_arch=="x64"', {
248 'xcode_settings': {'ARCHS': ['x86_64']},
252 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
253 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
258 ['OS=="freebsd" and node_use_dtrace=="true"', {
259 'libraries': [ '-lelf' ],
263 '-Wl,--export-dynamic',