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',
13 # Turn on optimizations that may trigger compiler bugs.
14 # Use at your own risk. Do *NOT* report bugs if this option is enabled.
15 'node_unsafe_optimizations%': 0,
17 # Enable V8's post-mortem debugging only on unix flavors.
20 'v8_postmortem_support': 'true'
26 'default_configuration': 'Release',
29 'defines': [ 'DEBUG', '_DEBUG' ],
30 'cflags': [ '-g', '-O0' ],
32 ['target_arch=="x64"', {
33 'msvs_configuration_platform': 'x64',
38 'RuntimeLibrary': 1, # static debug
39 'Optimization': 0, # /Od, no optimization
40 'MinimalRebuild': 'false',
41 'OmitFramePointers': 'false',
42 'BasicRuntimeChecks': 3, # /RTC1
45 'LinkIncremental': 2, # enable incremental linking
49 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
54 ['target_arch=="x64"', {
55 'msvs_configuration_platform': 'x64',
57 ['node_unsafe_optimizations==1', {
58 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
59 'ldflags': [ '-Wl,--gc-sections' ],
61 'cflags': [ '-O2', '-fno-strict-aliasing' ],
62 'cflags!': [ '-O3', '-fstrict-aliasing' ],
64 # Required by the dtrace post-processor. Unfortunately,
65 # some gcc/binutils combos generate bad code when
66 # -ffunction-sections is enabled. Let's hope for the best.
68 'cflags': [ '-ffunction-sections', '-fdata-sections' ],
70 'cflags!': [ '-ffunction-sections', '-fdata-sections' ],
72 ['clang == 0 and gcc_version >= 40', {
73 'cflags': [ '-fno-tree-vrp' ],
75 ['clang == 0 and gcc_version <= 44', {
76 'cflags': [ '-fno-tree-sink' ],
81 'cflags': [ '-fno-omit-frame-pointer' ],
82 # pull in V8's postmortem metadata
83 'ldflags': [ '-Wl,-z,allextract' ]
88 'RuntimeLibrary': 0, # static release
89 'Optimization': 3, # /Ox, full optimization
90 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
91 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
92 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
93 'OmitFramePointers': 'true',
94 'EnableFunctionLevelLinking': 'true',
95 'EnableIntrinsicFunctions': 'true',
96 'RuntimeTypeInfo': 'false',
97 'ExceptionHandling': '0',
98 'AdditionalOptions': [
99 '/MP', # compile across multiple CPUs
103 'AdditionalOptions': [
104 '/LTCG', # link time code generation
108 'LinkTimeCodeGeneration': 1, # link-time code generation
109 'OptimizeReferences': 2, # /OPT:REF
110 'EnableCOMDATFolding': 2, # /OPT:ICF
111 'LinkIncremental': 1, # disable incremental linking
117 'VCCLCompilerTool': {
118 'StringPooling': 'true', # pool string literals
119 'DebugInformationFormat': 3, # Generate a PDB
121 'BufferSecurityCheck': 'true',
122 'ExceptionHandling': 1, # /EHsc
123 'SuppressStartupBanner': 'true',
124 'WarnAsError': 'false',
130 ['target_arch=="x64"', {
131 'TargetMachine' : 17 # /MACHINE:X64
134 'GenerateDebugInformation': 'true',
135 'RandomizedBaseAddress': 2, # enable ASLR
136 'DataExecutionPrevention': 2, # enable DEP
137 'AllowIsolation': 'true',
138 'SuppressStartupBanner': 'true',
139 'target_conditions': [
140 ['_type=="executable"', {
141 'SubSystem': 1, # console executable
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',
163 '_FILE_OFFSET_BITS=64',
166 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
167 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-pthread', ],
168 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
169 'ldflags': [ '-pthread', '-rdynamic' ],
171 [ 'target_arch=="ia32"', {
172 'cflags': [ '-m32' ],
173 'ldflags': [ '-m32' ],
175 [ 'target_arch=="x64"', {
176 'cflags': [ '-m64' ],
177 'ldflags': [ '-m64' ],
180 'cflags': [ '-pthreads' ],
181 'ldflags': [ '-pthreads' ],
182 'cflags!': [ '-pthread' ],
183 'ldflags!': [ '-pthread' ],
188 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
190 'ALWAYS_SEARCH_USER_PATHS': 'NO',
191 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
192 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
193 # (Equivalent to -fPIC)
194 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
195 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
196 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
197 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
198 'GCC_VERSION': '4.2',
199 'PREBINDING': 'NO', # No -Wl,-prebind
200 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
201 'USE_HEADERMAP': 'NO',
203 '-fno-strict-aliasing',
209 '-Wno-unused-parameter',
212 'target_conditions': [
213 ['_type!="static_library"', {
214 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
218 ['target_arch=="ia32"', {
219 'xcode_settings': {'ARCHS': ['i386']},
221 ['target_arch=="x64"', {
222 'xcode_settings': {'ARCHS': ['x86_64']},