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': 'false'
23 'v8_postmortem_support': 'true'
29 'default_configuration': 'Release',
32 'defines': [ 'DEBUG', '_DEBUG' ],
33 'cflags': [ '-g', '-O0' ],
35 ['target_arch=="x64"', {
36 'msvs_configuration_platform': 'x64',
41 'RuntimeLibrary': 1, # static debug
42 'Optimization': 0, # /Od, no optimization
43 'MinimalRebuild': 'false',
44 'OmitFramePointers': 'false',
45 'BasicRuntimeChecks': 3, # /RTC1
48 'LinkIncremental': 2, # enable incremental linking
52 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
57 ['target_arch=="x64"', {
58 'msvs_configuration_platform': 'x64',
60 ['node_unsafe_optimizations==1', {
61 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
62 'ldflags': [ '-Wl,--gc-sections' ],
64 'cflags': [ '-O2', '-fno-strict-aliasing' ],
65 'cflags!': [ '-O3', '-fstrict-aliasing' ],
67 # Required by the dtrace post-processor. Unfortunately,
68 # some gcc/binutils combos generate bad code when
69 # -ffunction-sections is enabled. Let's hope for the best.
71 'cflags': [ '-ffunction-sections', '-fdata-sections' ],
73 'cflags!': [ '-ffunction-sections', '-fdata-sections' ],
75 ['clang == 0 and gcc_version >= 40', {
76 'cflags': [ '-fno-tree-vrp' ],
78 ['clang == 0 and gcc_version <= 44', {
79 'cflags': [ '-fno-tree-sink' ],
84 'cflags': [ '-fno-omit-frame-pointer' ],
85 # pull in V8's postmortem metadata
86 'ldflags': [ '-Wl,-z,allextract' ]
91 'RuntimeLibrary': 0, # static release
92 'Optimization': 3, # /Ox, full optimization
93 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
94 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
95 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
96 'OmitFramePointers': 'true',
97 'EnableFunctionLevelLinking': 'true',
98 'EnableIntrinsicFunctions': 'true',
99 'RuntimeTypeInfo': 'false',
100 'ExceptionHandling': '0',
101 'AdditionalOptions': [
102 '/MP', # compile across multiple CPUs
106 'AdditionalOptions': [
107 '/LTCG', # link time code generation
111 'LinkTimeCodeGeneration': 1, # link-time code generation
112 'OptimizeReferences': 2, # /OPT:REF
113 'EnableCOMDATFolding': 2, # /OPT:ICF
114 'LinkIncremental': 1, # disable incremental linking
120 'VCCLCompilerTool': {
121 'StringPooling': 'true', # pool string literals
122 'DebugInformationFormat': 3, # Generate a PDB
124 'BufferSecurityCheck': 'true',
125 'ExceptionHandling': 1, # /EHsc
126 'SuppressStartupBanner': 'true',
127 'WarnAsError': 'false',
133 ['target_arch=="x64"', {
134 'TargetMachine' : 17 # /MACHINE:X64
137 'GenerateDebugInformation': 'true',
138 'RandomizedBaseAddress': 2, # enable ASLR
139 'DataExecutionPrevention': 2, # enable DEP
140 'AllowIsolation': 'true',
141 'SuppressStartupBanner': 'true',
142 'target_conditions': [
143 ['_type=="executable"', {
144 'SubSystem': 1, # console executable
151 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
154 # we don't really want VC++ warning us about
155 # how dangerous C functions are...
156 '_CRT_SECURE_NO_DEPRECATE',
157 # ... or that C implementations shouldn't use
159 '_CRT_NONSTDC_NO_DEPRECATE',
160 'BUILDING_V8_SHARED=1',
161 'BUILDING_UV_SHARED=1',
164 [ 'OS in "linux freebsd openbsd solaris"', {
165 'cflags': [ '-pthread', ],
166 'ldflags': [ '-pthread' ],
168 [ 'OS in "linux freebsd openbsd solaris android"', {
169 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
170 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
171 'ldflags': [ '-rdynamic' ],
172 'target_conditions': [
173 ['_type=="static_library"', {
174 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
178 [ 'target_arch=="ia32"', {
179 'cflags': [ '-m32' ],
180 'ldflags': [ '-m32' ],
182 [ 'target_arch=="x64"', {
183 'cflags': [ '-m64' ],
184 'ldflags': [ '-m64' ],
187 'cflags': [ '-pthreads' ],
188 'ldflags': [ '-pthreads' ],
189 'cflags!': [ '-pthread' ],
190 'ldflags!': [ '-pthread' ],
195 'defines': ['_GLIBCXX_USE_C99_MATH'],
196 'libraries': [ '-llog' ],
199 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
201 'ALWAYS_SEARCH_USER_PATHS': 'NO',
202 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
203 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
204 # (Equivalent to -fPIC)
205 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
206 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
207 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
208 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
209 'PREBINDING': 'NO', # No -Wl,-prebind
210 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
211 'USE_HEADERMAP': 'NO',
213 '-fno-strict-aliasing',
219 '-Wno-unused-parameter',
222 'target_conditions': [
223 ['_type!="static_library"', {
224 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
228 ['target_arch=="ia32"', {
229 'xcode_settings': {'ARCHS': ['i386']},
231 ['target_arch=="x64"', {
232 'xcode_settings': {'ARCHS': ['x86_64']},
236 ['OS=="freebsd" and node_use_dtrace=="true"', {
237 'libraries': [ '-lelf' ],