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 # Turn on optimizations that may trigger compiler bugs.
15 # Use at your own risk. Do *NOT* report bugs if this option is enabled.
16 'node_unsafe_optimizations%': 0,
18 # Enable V8's post-mortem debugging only on unix flavors.
21 'v8_postmortem_support': 'true'
27 'default_configuration': 'Release',
30 'defines': [ 'DEBUG', '_DEBUG' ],
31 'cflags': [ '-g', '-O0' ],
33 ['target_arch=="x64"', {
34 'msvs_configuration_platform': 'x64',
39 'RuntimeLibrary': 1, # static debug
40 'Optimization': 0, # /Od, no optimization
41 'MinimalRebuild': 'false',
42 'OmitFramePointers': 'false',
43 'BasicRuntimeChecks': 3, # /RTC1
46 'LinkIncremental': 2, # enable incremental linking
50 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
55 ['target_arch=="x64"', {
56 'msvs_configuration_platform': 'x64',
58 ['node_unsafe_optimizations==1', {
59 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
60 'ldflags': [ '-Wl,--gc-sections' ],
62 'cflags': [ '-O2', '-fno-strict-aliasing' ],
63 'cflags!': [ '-O3', '-fstrict-aliasing' ],
65 # Required by the dtrace post-processor. Unfortunately,
66 # some gcc/binutils combos generate bad code when
67 # -ffunction-sections is enabled. Let's hope for the best.
69 'cflags': [ '-ffunction-sections', '-fdata-sections' ],
71 'cflags!': [ '-ffunction-sections', '-fdata-sections' ],
73 ['clang == 0 and gcc_version >= 40', {
74 'cflags': [ '-fno-tree-vrp' ],
76 ['clang == 0 and gcc_version <= 44', {
77 'cflags': [ '-fno-tree-sink' ],
82 'cflags': [ '-fno-omit-frame-pointer' ],
83 # pull in V8's postmortem metadata
84 'ldflags': [ '-Wl,-z,allextract' ]
89 'RuntimeLibrary': 0, # static release
90 'Optimization': 3, # /Ox, full optimization
91 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
92 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
93 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
94 'OmitFramePointers': 'true',
95 'EnableFunctionLevelLinking': 'true',
96 'EnableIntrinsicFunctions': 'true',
97 'RuntimeTypeInfo': 'false',
98 'ExceptionHandling': '0',
99 'AdditionalOptions': [
100 '/MP', # compile across multiple CPUs
104 'AdditionalOptions': [
105 '/LTCG', # link time code generation
109 'LinkTimeCodeGeneration': 1, # link-time code generation
110 'OptimizeReferences': 2, # /OPT:REF
111 'EnableCOMDATFolding': 2, # /OPT:ICF
112 'LinkIncremental': 1, # disable incremental linking
118 'VCCLCompilerTool': {
119 'StringPooling': 'true', # pool string literals
120 'DebugInformationFormat': 3, # Generate a PDB
122 'BufferSecurityCheck': 'true',
123 'ExceptionHandling': 1, # /EHsc
124 'ImageHasSafeExceptionHandlers': 0, # /SAFESEH:NO
125 'SuppressStartupBanner': 'true',
126 'WarnAsError': 'false',
132 ['target_arch=="x64"', {
133 'TargetMachine' : 17 # /MACHINE:X64
136 'GenerateDebugInformation': 'true',
137 'RandomizedBaseAddress': 2, # enable ASLR
138 'DataExecutionPrevention': 2, # enable DEP
139 'AllowIsolation': 'true',
140 'SuppressStartupBanner': 'true',
141 'target_conditions': [
142 ['_type=="executable"', {
143 'SubSystem': 1, # console executable
150 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
153 # we don't really want VC++ warning us about
154 # how dangerous C functions are...
155 '_CRT_SECURE_NO_DEPRECATE',
156 # ... or that C implementations shouldn't use
158 '_CRT_NONSTDC_NO_DEPRECATE',
159 'BUILDING_V8_SHARED=1',
160 'BUILDING_UV_SHARED=1',
163 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
164 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-pthread', ],
165 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
166 'ldflags': [ '-pthread', '-rdynamic' ],
167 'target_conditions': [
168 ['_type=="static_library"', {
169 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
173 [ 'target_arch=="ia32"', {
174 'cflags': [ '-m32' ],
175 'ldflags': [ '-m32' ],
177 [ 'target_arch=="x64"', {
178 'cflags': [ '-m64' ],
179 'ldflags': [ '-m64' ],
182 'cflags': [ '-pthreads' ],
183 'ldflags': [ '-pthreads' ],
184 'cflags!': [ '-pthread' ],
185 'ldflags!': [ '-pthread' ],
190 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
192 'ALWAYS_SEARCH_USER_PATHS': 'NO',
193 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
194 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
195 # (Equivalent to -fPIC)
196 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
197 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
198 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
199 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
200 'PREBINDING': 'NO', # No -Wl,-prebind
201 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
202 'USE_HEADERMAP': 'NO',
204 '-fno-strict-aliasing',
210 '-Wno-unused-parameter',
213 'target_conditions': [
214 ['_type!="static_library"', {
215 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
219 ['target_arch=="ia32"', {
220 'xcode_settings': {'ARCHS': ['i386']},
222 ['target_arch=="x64"', {
223 'xcode_settings': {'ARCHS': ['x86_64']},
227 ['OS=="freebsd" and node_use_dtrace=="true"', {
228 'libraries': [ '-lelf' ],