3 'visibility%': 'hidden', # V8's visibility setting
4 'target_arch%': 'ia32', # set v8's target architecture
5 'host_arch%': 'ia32', # set v8's host architecture
6 'want_separate_host_toolset': 0, # V8 should not build target and host
7 'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
8 'component%': 'static_library', # NB. these names match with what V8 expects
9 'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
10 'gcc_version%': 'unknown',
14 # Enable V8's post-mortem debugging only on unix flavors.
17 'v8_postmortem_support': 'false'
19 'v8_postmortem_support': 'true'
25 'default_configuration': 'Release',
28 'defines': [ 'DEBUG', '_DEBUG' ],
29 'cflags': [ '-g', '-O0' ],
31 ['target_arch=="x64"', {
32 'msvs_configuration_platform': 'x64',
37 'RuntimeLibrary': 1, # static debug
38 'Optimization': 0, # /Od, no optimization
39 'MinimalRebuild': 'false',
40 'OmitFramePointers': 'false',
41 'BasicRuntimeChecks': 3, # /RTC1
44 'LinkIncremental': 2, # enable incremental linking
48 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
52 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
54 ['target_arch=="x64"', {
55 'msvs_configuration_platform': 'x64',
58 'cflags': [ '-fno-omit-frame-pointer' ],
59 # pull in V8's postmortem metadata
60 'ldflags': [ '-Wl,-z,allextract' ]
62 # Doesn't work with the Solaris linker.
63 'ldflags': [ '-Wl,--gc-sections' ],
65 ['clang == 0 and gcc_version >= 40', {
66 'cflags': [ '-fno-tree-vrp' ], # Work around compiler bug.
68 ['clang == 0 and gcc_version <= 44', {
69 'cflags': [ '-fno-tree-sink' ], # Work around compiler bug.
74 'RuntimeLibrary': 0, # static release
75 'Optimization': 3, # /Ox, full optimization
76 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
77 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
78 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
79 'OmitFramePointers': 'true',
80 'EnableFunctionLevelLinking': 'true',
81 'EnableIntrinsicFunctions': 'true',
82 'RuntimeTypeInfo': 'false',
83 'ExceptionHandling': '0',
84 'AdditionalOptions': [
85 '/MP', # compile across multiple CPUs
89 'AdditionalOptions': [
90 '/LTCG', # link time code generation
94 'LinkTimeCodeGeneration': 1, # link-time code generation
95 'OptimizeReferences': 2, # /OPT:REF
96 'EnableCOMDATFolding': 2, # /OPT:ICF
97 'LinkIncremental': 1, # disable incremental linking
103 'VCCLCompilerTool': {
104 'StringPooling': 'true', # pool string literals
105 'DebugInformationFormat': 3, # Generate a PDB
107 'BufferSecurityCheck': 'true',
108 'ExceptionHandling': 1, # /EHsc
109 'SuppressStartupBanner': 'true',
110 'WarnAsError': 'false',
116 ['target_arch=="x64"', {
117 'TargetMachine' : 17 # /MACHINE:X64
120 'GenerateDebugInformation': 'true',
121 'RandomizedBaseAddress': 2, # enable ASLR
122 'DataExecutionPrevention': 2, # enable DEP
123 'AllowIsolation': 'true',
124 'SuppressStartupBanner': 'true',
125 'target_conditions': [
126 ['_type=="executable"', {
127 'SubSystem': 1, # console executable
132 'msvs_disabled_warnings': [4351, 4355, 4800],
135 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
138 # we don't really want VC++ warning us about
139 # how dangerous C functions are...
140 '_CRT_SECURE_NO_DEPRECATE',
141 # ... or that C implementations shouldn't use
143 '_CRT_NONSTDC_NO_DEPRECATE',
144 'BUILDING_V8_SHARED=1',
145 'BUILDING_UV_SHARED=1',
148 [ 'OS in "linux freebsd openbsd solaris"', {
149 'cflags': [ '-pthread', ],
150 'ldflags': [ '-pthread' ],
152 [ 'OS in "linux freebsd openbsd solaris android"', {
153 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
154 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
155 'ldflags': [ '-rdynamic' ],
156 'target_conditions': [
157 ['_type=="static_library"', {
158 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
162 [ 'target_arch=="ia32"', {
163 'cflags': [ '-m32' ],
164 'ldflags': [ '-m32' ],
166 [ 'target_arch=="x64"', {
167 'cflags': [ '-m64' ],
168 'ldflags': [ '-m64' ],
171 'cflags': [ '-pthreads' ],
172 'ldflags': [ '-pthreads' ],
173 'cflags!': [ '-pthread' ],
174 'ldflags!': [ '-pthread' ],
179 'defines': ['_GLIBCXX_USE_C99_MATH'],
180 'libraries': [ '-llog' ],
183 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
185 'ALWAYS_SEARCH_USER_PATHS': 'NO',
186 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
187 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
188 # (Equivalent to -fPIC)
189 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
190 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
191 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
192 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
193 'PREBINDING': 'NO', # No -Wl,-prebind
194 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
195 'USE_HEADERMAP': 'NO',
197 '-fno-strict-aliasing',
203 '-Wno-unused-parameter',
206 'target_conditions': [
207 ['_type!="static_library"', {
208 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
212 ['target_arch=="ia32"', {
213 'xcode_settings': {'ARCHS': ['i386']},
215 ['target_arch=="x64"', {
216 'xcode_settings': {'ARCHS': ['x86_64']},
220 ['OS=="freebsd" and node_use_dtrace=="true"', {
221 'libraries': [ '-lelf' ],