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',
38 'defines': [ 'DEBUG', '_DEBUG' ],
39 'cflags': [ '-g', '-O0' ],
41 ['target_arch=="x64"', {
42 'msvs_configuration_platform': 'x64',
47 'RuntimeLibrary': 1, # static debug
48 'Optimization': 0, # /Od, no optimization
49 'MinimalRebuild': 'false',
50 'OmitFramePointers': 'false',
51 'BasicRuntimeChecks': 3, # /RTC1
54 'LinkIncremental': 2, # enable incremental linking
58 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
62 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
64 ['target_arch=="x64"', {
65 'msvs_configuration_platform': 'x64',
68 # pull in V8's postmortem metadata
69 'ldflags': [ '-Wl,-z,allextract' ]
71 ['clang == 0 and gcc_version >= 40', {
72 'cflags': [ '-fno-tree-vrp' ], # Work around compiler bug.
74 ['clang == 0 and gcc_version <= 44', {
75 'cflags': [ '-fno-tree-sink' ], # Work around compiler bug.
77 ['OS!="mac" and OS!="win"', {
78 'cflags': [ '-fno-omit-frame-pointer' ],
83 'RuntimeLibrary': 0, # static release
84 'Optimization': 3, # /Ox, full optimization
85 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
86 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
87 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
88 'OmitFramePointers': 'true',
89 'EnableFunctionLevelLinking': 'true',
90 'EnableIntrinsicFunctions': 'true',
91 'RuntimeTypeInfo': 'false',
92 'ExceptionHandling': '0',
93 'AdditionalOptions': [
94 '/MP', # compile across multiple CPUs
98 'AdditionalOptions': [
99 '/LTCG', # link time code generation
103 'LinkTimeCodeGeneration': 1, # link-time code generation
104 'OptimizeReferences': 2, # /OPT:REF
105 'EnableCOMDATFolding': 2, # /OPT:ICF
106 'LinkIncremental': 1, # disable incremental linking
111 # Forcibly disable -Werror. We support a wide range of compilers, it's
112 # simply not feasible to squelch all warnings, never mind that the
113 # libraries in deps/ are not under our control.
114 'cflags!': ['-Werror'],
116 'VCCLCompilerTool': {
117 'StringPooling': 'true', # pool string literals
118 'DebugInformationFormat': 3, # Generate a PDB
120 'BufferSecurityCheck': 'true',
121 'ExceptionHandling': 1, # /EHsc
122 'SuppressStartupBanner': 'true',
123 'WarnAsError': 'false',
129 ['target_arch=="x64"', {
130 'TargetMachine' : 17 # /MACHINE:X64
133 'GenerateDebugInformation': 'true',
134 'RandomizedBaseAddress': 2, # enable ASLR
135 'DataExecutionPrevention': 2, # enable DEP
136 'AllowIsolation': 'true',
137 'SuppressStartupBanner': 'true',
138 'target_conditions': [
139 ['_type=="executable"', {
140 'SubSystem': 1, # console executable
145 'msvs_disabled_warnings': [4351, 4355, 4800],
148 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
151 # we don't really want VC++ warning us about
152 # how dangerous C functions are...
153 '_CRT_SECURE_NO_DEPRECATE',
154 # ... or that C implementations shouldn't use
156 '_CRT_NONSTDC_NO_DEPRECATE',
157 'BUILDING_V8_SHARED=1',
158 'BUILDING_UV_SHARED=1',
161 [ 'OS in "linux freebsd openbsd solaris"', {
162 'cflags': [ '-pthread', ],
163 'ldflags': [ '-pthread' ],
165 [ 'OS in "linux freebsd openbsd solaris android"', {
166 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
167 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
168 'ldflags': [ '-rdynamic' ],
169 'target_conditions': [
170 ['_type=="static_library"', {
171 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
175 [ 'target_arch=="ia32"', {
176 'cflags': [ '-m32' ],
177 'ldflags': [ '-m32' ],
179 [ 'target_arch=="x64"', {
180 'cflags': [ '-m64' ],
181 'ldflags': [ '-m64' ],
184 'cflags': [ '-pthreads' ],
185 'ldflags': [ '-pthreads' ],
186 'cflags!': [ '-pthread' ],
187 'ldflags!': [ '-pthread' ],
192 'defines': ['_GLIBCXX_USE_C99_MATH'],
193 'libraries': [ '-llog' ],
196 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
198 'ALWAYS_SEARCH_USER_PATHS': 'NO',
199 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
200 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
201 # (Equivalent to -fPIC)
202 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
203 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
204 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
205 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
206 'PREBINDING': 'NO', # No -Wl,-prebind
207 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
208 'USE_HEADERMAP': 'NO',
210 '-fno-strict-aliasing',
216 '-Wno-unused-parameter',
219 'target_conditions': [
220 ['_type!="static_library"', {
221 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
225 ['target_arch=="ia32"', {
226 'xcode_settings': {'ARCHS': ['i386']},
228 ['target_arch=="x64"', {
229 'xcode_settings': {'ARCHS': ['x86_64']},
233 ['OS=="freebsd" and node_use_dtrace=="true"', {
234 'libraries': [ '-lelf' ],