1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are
6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided
11 # with the distribution.
12 # * Neither the name of Google Inc. nor the names of its
13 # contributors may be used to endorse or promote products derived
14 # from this software without specific prior written permission.
16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 # Definitions to be used when building stand-alone V8 binaries.
31 # We need to include toolchain.gypi here for third-party sources that don't
32 # directly include it themselves.
33 'includes': ['toolchain.gypi'],
35 'component%': 'static_library',
38 'visibility%': 'hidden',
39 'v8_enable_backtrace%': 0,
40 'v8_enable_i18n_support%': 1,
41 'v8_deprecation_warnings': 1,
42 'msvs_multi_core_compile%': '1',
43 'mac_deployment_target%': '10.5',
48 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or \
49 OS=="netbsd" or OS=="mac" or OS=="qnx"', {
50 # This handles the Unix platforms we generally deal with.
51 # Anything else gets passed through, which probably won't work
52 # very well; such hosts should pass an explicit target_arch
54 'host_arch%': '<!pymod_do_main(detect_v8_host_arch)',
56 # OS!="linux" and OS!="freebsd" and OS!="openbsd" and
57 # OS!="netbsd" and OS!="mac"
62 'host_arch%': '<(host_arch)',
63 'target_arch%': '<(host_arch)',
65 'host_arch%': '<(host_arch)',
66 'target_arch%': '<(target_arch)',
67 'v8_target_arch%': '<(target_arch)',
69 'host_arch%': '<(host_arch)',
70 'target_arch%': '<(target_arch)',
71 'v8_target_arch%': '<(v8_target_arch)',
74 # .gyp files or targets should set v8_code to 1 if they build V8 specific
75 # code, as opposed to external code. This variable is used to control such
76 # things as the set of warnings to enable, and whether warnings are treated
80 # Speeds up Debug builds:
81 # 0 - Compiler optimizations off (debuggable) (default). This may
82 # be 5x slower than Release (or worse).
83 # 1 - Turn on compiler optimizations. This may be hard or impossible to
84 # debug. This may still be 2x slower than Release (or worse).
85 # 2 - Turn on optimizations, and also #undef DEBUG / #define NDEBUG
86 # (but leave V8_ENABLE_CHECKS and most other assertions enabled.
87 # This may cause some v8 tests to fail in the Debug configuration.
88 # This roughly matches the performance of a Release build and can
89 # be used by embedders that need to build their own code as debug
90 # but don't want or need a debug version of V8. This should produce
91 # near-release speeds.
92 'v8_optimized_debug%': 0,
94 # Relative path to icu.gyp from this file.
95 'icu_gyp_path': '../third_party/icu/icu.gyp',
98 ['(v8_target_arch=="arm" and host_arch!="arm") or \
99 (v8_target_arch=="arm64" and host_arch!="arm64") or \
100 (v8_target_arch=="mipsel" and host_arch!="mipsel") or \
101 (v8_target_arch=="mips64el" and host_arch!="mips64el") or \
102 (v8_target_arch=="x64" and host_arch!="x64") or \
103 (OS=="android" or OS=="qnx")', {
104 'want_separate_host_toolset': 1,
106 'want_separate_host_toolset': 0,
113 ['(v8_target_arch=="ia32" or v8_target_arch=="x64" or v8_target_arch=="x87") and \
114 (OS=="linux" or OS=="mac")', {
115 'v8_enable_gdbjit%': 1,
117 'v8_enable_gdbjit%': 0,
125 # Default ARM variable settings.
126 'arm_version%': 'default',
128 'arm_float_abi%': 'default',
129 'arm_thumb': 'default',
131 # Default MIPS variable settings.
132 'mips_arch_variant%': 'r2',
133 # Possible values fp32, fp64, fpxx.
134 # fp32 - 32 32-bit FPU registers are available, doubles are placed in
136 # fp64 - 32 64-bit FPU registers are available.
137 # fpxx - compatibility mode, it chooses fp32 or fp64 depending on runtime
139 'mips_fpu_mode%': 'fp32',
143 'v8_code%': '<(v8_code)',
145 'default_configuration': 'Debug',
148 'cflags': [ '-g', '-O0' ],
150 ['(v8_target_arch=="ia32" or v8_target_arch=="x87") and \
159 'inherit_from': [ 'DebugBaseCommon', 'DebugBase2' ],
162 # Xcode insists on this empty entry.
165 # Xcode insists on this empty entry.
168 'target_conditions': [
174 ['os_posix == 1 and OS != "mac"', {
181 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
186 'VCCLCompilerTool': {
187 'WarnAsError': 'false',
199 '-fno-omit-frame-pointer',
200 '-gline-tables-only',
201 '-fsanitize=address',
202 '-w', # http://crbug.com/162783
205 '-fomit-frame-pointer',
208 '-fsanitize=address',
215 '-fno-omit-frame-pointer',
216 '-gline-tables-only',
219 '-Wno-c++11-extensions',
222 '-fomit-frame-pointer',
233 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
240 '-Wno-unused-parameter',
245 # Don't warn about the "struct foo f = {0};" initialization pattern.
246 '-Wno-missing-field-initializers',
248 'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti', '-std=gnu++0x' ],
249 'ldflags': [ '-pthread', ],
251 [ 'visibility=="hidden" and v8_enable_backtrace==0', {
252 'cflags': [ '-fvisibility=hidden' ],
254 [ 'component=="shared_library"', {
255 'cflags': [ '-fPIC', ],
260 # 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"
268 '-Wno-unused-parameter',
270 # Don't warn about the "struct foo f = {0};" initialization pattern.
271 '-Wno-missing-field-initializers',
273 'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti', '-std=gnu++0x' ],
275 [ 'visibility=="hidden"', {
276 'cflags': [ '-fvisibility=hidden' ],
278 [ 'component=="shared_library"', {
279 'cflags': [ '-fPIC' ],
282 'target_conditions': [
283 [ '_toolset=="host" and host_os=="linux"', {
284 'cflags': [ '-pthread' ],
285 'ldflags': [ '-pthread' ],
286 'libraries': [ '-lrt' ],
288 [ '_toolset=="target"', {
289 'cflags': [ '-Wno-psabi' ],
290 'libraries': [ '-lbacktrace', '-lsocket', '-lm' ],
298 '_CRT_SECURE_NO_DEPRECATE',
299 '_CRT_NONSTDC_NO_DEPRECATE',
300 '_USING_V110_SDK71_',
303 ['component=="static_library"', {
309 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
310 'msvs_disabled_warnings': [4355, 4800],
312 'VCCLCompilerTool': {
313 'MinimalRebuild': 'false',
314 'BufferSecurityCheck': 'true',
315 'EnableFunctionLevelLinking': 'true',
316 'RuntimeTypeInfo': 'false',
318 'WarnAsError': 'true',
319 'DebugInformationFormat': '3',
320 'Detect64BitPortabilityProblems': 'false',
322 [ 'msvs_multi_core_compile', {
323 'AdditionalOptions': ['/MP'],
325 ['component=="shared_library"', {
326 'ExceptionHandling': '1', # /EHsc
328 'ExceptionHandling': '0',
333 'AdditionalOptions': ['/ignore:4221'],
335 ['v8_target_arch=="x64"', {
336 'TargetMachine': '17', # x64
338 'TargetMachine': '1', # ia32
343 'AdditionalDependencies': [
346 'GenerateDebugInformation': 'true',
347 'MapFileName': '$(OutDir)\\$(TargetName).map',
348 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
349 'FixedBaseAddress': '1',
350 # LinkIncremental values:
352 # 1 == /INCREMENTAL:NO
354 'LinkIncremental': '1',
357 # 1 == /SUBSYSTEM:CONSOLE
358 # 2 == /SUBSYSTEM:WINDOWS
362 ['v8_enable_i18n_support==1', {
363 'AdditionalDependencies': [
367 ['v8_target_arch=="x64"', {
368 'MinimumRequiredVersion': '5.02', # Server 2003.
369 'TargetMachine': '17', # x64
371 'MinimumRequiredVersion': '5.01', # XP.
372 'TargetMachine': '1', # ia32
381 'SYMROOT': '<(DEPTH)/xcodebuild',
385 'ALWAYS_SEARCH_USER_PATHS': 'NO',
386 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
387 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
388 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
389 # (Equivalent to -fPIC)
390 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
391 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
392 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
393 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
394 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
395 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
396 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
397 'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
398 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
399 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
400 'PREBINDING': 'NO', # No -Wl,-prebind
401 'SYMROOT': '<(DEPTH)/xcodebuild',
402 'USE_HEADERMAP': 'NO',
404 '-fno-strict-aliasing',
410 '-Wno-unused-parameter',
411 # Don't warn about the "struct foo f = {0};" initialization pattern.
412 '-Wno-missing-field-initializers',
417 'xcode_settings': {'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO'},
419 'xcode_settings': {'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES'},
423 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
424 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
428 'target_conditions': [
429 ['_type!="static_library"', {
430 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
432 ], # target_conditions