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
134 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
137 # we don't really want VC++ warning us about
138 # how dangerous C functions are...
139 '_CRT_SECURE_NO_DEPRECATE',
140 # ... or that C implementations shouldn't use
142 '_CRT_NONSTDC_NO_DEPRECATE',
143 'BUILDING_V8_SHARED=1',
144 'BUILDING_UV_SHARED=1',
147 [ 'OS in "linux freebsd openbsd solaris"', {
148 'cflags': [ '-pthread', ],
149 'ldflags': [ '-pthread' ],
151 [ 'OS in "linux freebsd openbsd solaris android"', {
152 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
153 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
154 'ldflags': [ '-rdynamic' ],
155 'target_conditions': [
156 ['_type=="static_library"', {
157 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
161 [ 'target_arch=="ia32"', {
162 'cflags': [ '-m32' ],
163 'ldflags': [ '-m32' ],
165 [ 'target_arch=="x64"', {
166 'cflags': [ '-m64' ],
167 'ldflags': [ '-m64' ],
170 'cflags': [ '-pthreads' ],
171 'ldflags': [ '-pthreads' ],
172 'cflags!': [ '-pthread' ],
173 'ldflags!': [ '-pthread' ],
178 'defines': ['_GLIBCXX_USE_C99_MATH'],
179 'libraries': [ '-llog' ],
182 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
184 'ALWAYS_SEARCH_USER_PATHS': 'NO',
185 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
186 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
187 # (Equivalent to -fPIC)
188 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
189 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
190 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
191 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
192 'PREBINDING': 'NO', # No -Wl,-prebind
193 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
194 'USE_HEADERMAP': 'NO',
196 '-fno-strict-aliasing',
202 '-Wno-unused-parameter',
205 'target_conditions': [
206 ['_type!="static_library"', {
207 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
211 ['target_arch=="ia32"', {
212 'xcode_settings': {'ARCHS': ['i386']},
214 ['target_arch=="x64"', {
215 'xcode_settings': {'ARCHS': ['x86_64']},
219 ['OS=="freebsd" and node_use_dtrace=="true"', {
220 'libraries': [ '-lelf' ],