3 'werror': '', # Turn off -Werror in V8 build.
4 'visibility%': 'hidden', # V8's visibility setting
5 'target_arch%': 'ia32', # set v8's target architecture
6 'host_arch%': 'ia32', # set v8's host architecture
7 'want_separate_host_toolset%': 0, # V8 should not build target and host
8 'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
9 'component%': 'static_library', # NB. these names match with what V8 expects
10 'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
11 'gcc_version%': 'unknown',
15 # Turn on optimizations that may trigger compiler bugs.
16 # Use at your own risk. Do *NOT* report bugs if this option is enabled.
17 'node_unsafe_optimizations%': 0,
19 # Enable V8's post-mortem debugging only on unix flavors.
22 'v8_postmortem_support': 'true'
24 ['GENERATOR == "ninja" or OS== "mac"', {
25 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
26 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
28 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
29 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
35 'default_configuration': 'Release',
38 'defines': [ 'DEBUG', '_DEBUG' ],
39 'cflags': [ '-g', '-O0' ],
41 ['target_arch=="x64"', {
42 'msvs_configuration_platform': 'x64',
47 'RuntimeLibrary': 1, # static debug
48 'Optimization': 0, # /Od, no optimization
49 'MinimalRebuild': 'false',
50 'OmitFramePointers': 'false',
51 'BasicRuntimeChecks': 3, # /RTC1
54 'LinkIncremental': 2, # enable incremental linking
58 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
63 ['target_arch=="x64"', {
64 'msvs_configuration_platform': 'x64',
66 ['node_unsafe_optimizations==1', {
67 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
68 'ldflags': [ '-Wl,--gc-sections' ],
70 'cflags': [ '-O2', '-fno-strict-aliasing' ],
71 'cflags!': [ '-O3', '-fstrict-aliasing' ],
73 # Required by the dtrace post-processor. Unfortunately,
74 # some gcc/binutils combos generate bad code when
75 # -ffunction-sections is enabled. Let's hope for the best.
77 'cflags': [ '-ffunction-sections', '-fdata-sections' ],
79 'cflags!': [ '-ffunction-sections', '-fdata-sections' ],
81 ['clang == 0 and gcc_version >= 40', {
82 'cflags': [ '-fno-tree-vrp' ],
84 ['clang == 0 and gcc_version <= 44', {
85 'cflags': [ '-fno-tree-sink' ],
90 # pull in V8's postmortem metadata
91 'ldflags': [ '-Wl,-z,allextract' ]
93 ['OS!="mac" and OS!="win"', {
94 'cflags': [ '-fno-omit-frame-pointer' ],
99 'RuntimeLibrary': 0, # static release
100 'Optimization': 3, # /Ox, full optimization
101 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
102 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
103 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
104 'OmitFramePointers': 'true',
105 'EnableFunctionLevelLinking': 'true',
106 'EnableIntrinsicFunctions': 'true',
107 'RuntimeTypeInfo': 'false',
108 'ExceptionHandling': '0',
109 'AdditionalOptions': [
110 '/MP', # compile across multiple CPUs
114 'AdditionalOptions': [
115 '/LTCG', # link time code generation
119 'LinkTimeCodeGeneration': 1, # link-time code generation
120 'OptimizeReferences': 2, # /OPT:REF
121 'EnableCOMDATFolding': 2, # /OPT:ICF
122 'LinkIncremental': 1, # disable incremental linking
128 'VCCLCompilerTool': {
129 'StringPooling': 'true', # pool string literals
130 'DebugInformationFormat': 3, # Generate a PDB
132 'BufferSecurityCheck': 'true',
133 'ExceptionHandling': 1, # /EHsc
134 'SuppressStartupBanner': 'true',
135 'WarnAsError': 'false',
141 ['target_arch=="x64"', {
142 'TargetMachine' : 17 # /MACHINE:X64
145 'GenerateDebugInformation': 'true',
146 'RandomizedBaseAddress': 2, # enable ASLR
147 'DataExecutionPrevention': 2, # enable DEP
148 'AllowIsolation': 'true',
149 'SuppressStartupBanner': 'true',
150 'target_conditions': [
151 ['_type=="executable"', {
152 'SubSystem': 1, # console executable
159 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
162 # we don't really want VC++ warning us about
163 # how dangerous C functions are...
164 '_CRT_SECURE_NO_DEPRECATE',
165 # ... or that C implementations shouldn't use
167 '_CRT_NONSTDC_NO_DEPRECATE',
168 'BUILDING_V8_SHARED=1',
169 'BUILDING_UV_SHARED=1',
172 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
173 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-pthread', ],
174 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
175 'ldflags': [ '-pthread', '-rdynamic' ],
176 'target_conditions': [
177 ['_type=="static_library"', {
178 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
182 [ 'target_arch=="ia32"', {
183 'cflags': [ '-m32' ],
184 'ldflags': [ '-m32' ],
186 [ 'target_arch=="x64"', {
187 'cflags': [ '-m64' ],
188 'ldflags': [ '-m64' ],
191 'cflags': [ '-pthreads' ],
192 'ldflags': [ '-pthreads' ],
193 'cflags!': [ '-pthread' ],
194 'ldflags!': [ '-pthread' ],
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' ],
241 '-Wl,--export-dynamic',