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'
23 ['GENERATOR == "ninja"', {
24 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
25 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
27 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
28 'V8_BASE': '<(OBJ_DIR)/deps/v8/tools/gyp/libv8_base.a',
34 'default_configuration': 'Release',
37 'defines': [ 'DEBUG', '_DEBUG' ],
38 'cflags': [ '-g', '-O0' ],
40 ['target_arch=="x64"', {
41 'msvs_configuration_platform': 'x64',
46 'RuntimeLibrary': 1, # static debug
47 'Optimization': 0, # /Od, no optimization
48 'MinimalRebuild': 'false',
49 'OmitFramePointers': 'false',
50 'BasicRuntimeChecks': 3, # /RTC1
53 'LinkIncremental': 2, # enable incremental linking
57 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
62 ['target_arch=="x64"', {
63 'msvs_configuration_platform': 'x64',
65 ['node_unsafe_optimizations==1', {
66 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
67 'ldflags': [ '-Wl,--gc-sections' ],
69 'cflags': [ '-O2', '-fno-strict-aliasing' ],
70 'cflags!': [ '-O3', '-fstrict-aliasing' ],
72 # Required by the dtrace post-processor. Unfortunately,
73 # some gcc/binutils combos generate bad code when
74 # -ffunction-sections is enabled. Let's hope for the best.
76 'cflags': [ '-ffunction-sections', '-fdata-sections' ],
78 'cflags!': [ '-ffunction-sections', '-fdata-sections' ],
80 ['clang == 0 and gcc_version >= 40', {
81 'cflags': [ '-fno-tree-vrp' ],
83 ['clang == 0 and gcc_version <= 44', {
84 'cflags': [ '-fno-tree-sink' ],
89 # pull in V8's postmortem metadata
90 'ldflags': [ '-Wl,-z,allextract' ]
92 ['OS!="mac" and OS!="win"', {
93 'cflags': [ '-fno-omit-frame-pointer' ],
98 'RuntimeLibrary': 0, # static release
99 'Optimization': 3, # /Ox, full optimization
100 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
101 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
102 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
103 'OmitFramePointers': 'true',
104 'EnableFunctionLevelLinking': 'true',
105 'EnableIntrinsicFunctions': 'true',
106 'RuntimeTypeInfo': 'false',
107 'ExceptionHandling': '0',
108 'AdditionalOptions': [
109 '/MP', # compile across multiple CPUs
113 'AdditionalOptions': [
114 '/LTCG', # link time code generation
118 'LinkTimeCodeGeneration': 1, # link-time code generation
119 'OptimizeReferences': 2, # /OPT:REF
120 'EnableCOMDATFolding': 2, # /OPT:ICF
121 'LinkIncremental': 1, # disable incremental linking
127 'VCCLCompilerTool': {
128 'StringPooling': 'true', # pool string literals
129 'DebugInformationFormat': 3, # Generate a PDB
131 'BufferSecurityCheck': 'true',
132 'ExceptionHandling': 1, # /EHsc
133 'SuppressStartupBanner': 'true',
134 'WarnAsError': 'false',
140 ['target_arch=="x64"', {
141 'TargetMachine' : 17 # /MACHINE:X64
144 'GenerateDebugInformation': 'true',
145 'RandomizedBaseAddress': 2, # enable ASLR
146 'DataExecutionPrevention': 2, # enable DEP
147 'AllowIsolation': 'true',
148 'SuppressStartupBanner': 'true',
149 'target_conditions': [
150 ['_type=="executable"', {
151 'SubSystem': 1, # console executable
158 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
161 # we don't really want VC++ warning us about
162 # how dangerous C functions are...
163 '_CRT_SECURE_NO_DEPRECATE',
164 # ... or that C implementations shouldn't use
166 '_CRT_NONSTDC_NO_DEPRECATE',
167 'BUILDING_V8_SHARED=1',
168 'BUILDING_UV_SHARED=1',
171 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
172 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-pthread', ],
173 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
174 'ldflags': [ '-pthread', '-rdynamic' ],
175 'target_conditions': [
176 ['_type=="static_library"', {
177 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
181 [ 'target_arch=="ia32"', {
182 'cflags': [ '-m32' ],
183 'ldflags': [ '-m32' ],
185 [ 'target_arch=="x64"', {
186 'cflags': [ '-m64' ],
187 'ldflags': [ '-m64' ],
190 'cflags': [ '-pthreads' ],
191 'ldflags': [ '-pthreads' ],
192 'cflags!': [ '-pthread' ],
193 'ldflags!': [ '-pthread' ],
198 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
200 'ALWAYS_SEARCH_USER_PATHS': 'NO',
201 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
202 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
203 # (Equivalent to -fPIC)
204 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
205 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
206 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
207 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
208 'PREBINDING': 'NO', # No -Wl,-prebind
209 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
210 'USE_HEADERMAP': 'NO',
212 '-fno-strict-aliasing',
218 '-Wno-unused-parameter',
221 'target_conditions': [
222 ['_type!="static_library"', {
223 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
227 ['target_arch=="ia32"', {
228 'xcode_settings': {'ARCHS': ['i386']},
230 ['target_arch=="x64"', {
231 'xcode_settings': {'ARCHS': ['x86_64']},
235 ['OS=="freebsd" and node_use_dtrace=="true"', {
236 'libraries': [ '-lelf' ],