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 # Enable V8's post-mortem debugging only on unix flavors.
18 'v8_postmortem_support': 'false'
21 'v8_postmortem_support': 'true'
23 ['GENERATOR == "ninja"', {
24 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
25 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.<(target_arch).a',
27 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
28 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.<(target_arch).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
61 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
63 ['target_arch=="x64"', {
64 'msvs_configuration_platform': 'x64',
67 # pull in V8's postmortem metadata
68 'ldflags': [ '-Wl,-z,allextract' ]
70 ['clang == 0 and gcc_version >= 40', {
71 'cflags': [ '-fno-tree-vrp' ], # Work around compiler bug.
73 ['clang == 0 and gcc_version <= 44', {
74 'cflags': [ '-fno-tree-sink' ], # Work around compiler bug.
76 ['OS!="mac" and OS!="win"', {
77 'cflags': [ '-fno-omit-frame-pointer' ],
82 'RuntimeLibrary': 0, # static release
83 'Optimization': 3, # /Ox, full optimization
84 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
85 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
86 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
87 'OmitFramePointers': 'true',
88 'EnableFunctionLevelLinking': 'true',
89 'EnableIntrinsicFunctions': 'true',
90 'RuntimeTypeInfo': 'false',
91 'ExceptionHandling': '0',
92 'AdditionalOptions': [
93 '/MP', # compile across multiple CPUs
97 'AdditionalOptions': [
98 '/LTCG', # link time code generation
102 'LinkTimeCodeGeneration': 1, # link-time code generation
103 'OptimizeReferences': 2, # /OPT:REF
104 'EnableCOMDATFolding': 2, # /OPT:ICF
105 'LinkIncremental': 1, # disable incremental linking
110 # Forcibly disable -Werror. We support a wide range of compilers, it's
111 # simply not feasible to squelch all warnings, never mind that the
112 # libraries in deps/ are not under our control.
113 'cflags!': ['-Werror'],
115 'VCCLCompilerTool': {
116 'StringPooling': 'true', # pool string literals
117 'DebugInformationFormat': 3, # Generate a PDB
119 'BufferSecurityCheck': 'true',
120 'ExceptionHandling': 1, # /EHsc
121 'SuppressStartupBanner': 'true',
122 'WarnAsError': 'false',
128 ['target_arch=="x64"', {
129 'TargetMachine' : 17 # /MACHINE:X64
132 'GenerateDebugInformation': 'true',
133 'RandomizedBaseAddress': 2, # enable ASLR
134 'DataExecutionPrevention': 2, # enable DEP
135 'AllowIsolation': 'true',
136 'SuppressStartupBanner': 'true',
137 'target_conditions': [
138 ['_type=="executable"', {
139 'SubSystem': 1, # console executable
144 'msvs_disabled_warnings': [4351, 4355, 4800],
147 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
150 # we don't really want VC++ warning us about
151 # how dangerous C functions are...
152 '_CRT_SECURE_NO_DEPRECATE',
153 # ... or that C implementations shouldn't use
155 '_CRT_NONSTDC_NO_DEPRECATE',
156 'BUILDING_V8_SHARED=1',
157 'BUILDING_UV_SHARED=1',
160 [ 'OS in "linux freebsd openbsd solaris"', {
161 'cflags': [ '-pthread', ],
162 'ldflags': [ '-pthread' ],
164 [ 'OS in "linux freebsd openbsd solaris android"', {
165 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
166 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
167 'ldflags': [ '-rdynamic' ],
168 'target_conditions': [
169 ['_type=="static_library"', {
170 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
174 [ 'target_arch=="ia32"', {
175 'cflags': [ '-m32' ],
176 'ldflags': [ '-m32' ],
178 [ 'target_arch=="x64"', {
179 'cflags': [ '-m64' ],
180 'ldflags': [ '-m64' ],
183 'cflags': [ '-pthreads' ],
184 'ldflags': [ '-pthreads' ],
185 'cflags!': [ '-pthread' ],
186 'ldflags!': [ '-pthread' ],
191 'defines': ['_GLIBCXX_USE_C99_MATH'],
192 'libraries': [ '-llog' ],
195 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
197 'ALWAYS_SEARCH_USER_PATHS': 'NO',
198 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
199 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
200 # (Equivalent to -fPIC)
201 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
202 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
203 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
204 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
205 'PREBINDING': 'NO', # No -Wl,-prebind
206 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
207 'USE_HEADERMAP': 'NO',
209 '-fno-strict-aliasing',
215 '-Wno-unused-parameter',
218 'target_conditions': [
219 ['_type!="static_library"', {
220 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
224 ['target_arch=="ia32"', {
225 'xcode_settings': {'ARCHS': ['i386']},
227 ['target_arch=="x64"', {
228 'xcode_settings': {'ARCHS': ['x86_64']},
232 ['OS=="freebsd" and node_use_dtrace=="true"', {
233 'libraries': [ '-lelf' ],