2012-01-05 12:17:08 +00:00
# Copyright 2012 the V8 project authors. All rights reserved.
2011-08-25 14:50:09 +00:00
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Definitions to be used when building stand-alone V8 binaries.
{
2013-07-10 11:15:16 +00:00
# We need to include toolchain.gypi here for third-party sources that don't
# directly include it themselves.
'includes': ['toolchain.gypi'],
2011-08-25 14:50:09 +00:00
'variables': {
'component%': 'static_library',
2014-11-27 17:18:03 +00:00
'clang_xcode%': 0,
2015-04-27 13:20:05 +00:00
# Track where uninitialized memory originates from. From fastest to
# slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
# - track the chain of stores leading from allocation site to use site.
2015-05-21 15:45:17 +00:00
'msan_track_origins%': 2,
2011-08-25 14:50:09 +00:00
'visibility%': 'hidden',
2012-12-14 14:39:18 +00:00
'v8_enable_backtrace%': 0,
2013-09-19 12:07:03 +00:00
'v8_enable_i18n_support%': 1,
2013-11-22 10:57:55 +00:00
'v8_deprecation_warnings': 1,
2015-12-09 10:34:06 +00:00
'v8_imminent_deprecation_warnings': 1,
2017-06-02 11:52:40 +00:00
'v8_check_microtasks_scopes_consistency': 'true',
2011-08-25 14:50:09 +00:00
'msvs_multi_core_compile%': '1',
2016-03-31 07:08:37 +00:00
'mac_deployment_target%': '10.7',
2015-04-15 15:20:14 +00:00
'release_extra_cflags%': '',
2011-08-25 14:50:09 +00:00
'variables': {
'variables': {
2011-09-15 08:16:07 +00:00
'variables': {
2016-06-08 15:27:21 +00:00
'variables': {
'conditions': [
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or \
OS=="netbsd" or OS=="mac" or OS=="qnx" or OS=="aix"', {
# This handles the Unix platforms we generally deal with.
# Anything else gets passed through, which probably won't work
# very well; such hosts should pass an explicit target_arch
# to gyp.
'host_arch%': '<!pymod_do_main(detect_v8_host_arch)',
}, {
# OS!="linux" and OS!="freebsd" and OS!="openbsd" and
# OS!="netbsd" and OS!="mac" and OS!="aix"
'host_arch%': 'ia32',
}],
],
},
'host_arch%': '<(host_arch)',
'target_arch%': '<(host_arch)',
# By default we build against a stable sysroot image to avoid
# depending on the packages installed on the local machine. Set this
# to 0 to build against locally installed headers and libraries (e.g.
# if packaging for a linux distro)
'use_sysroot%': 1,
2011-09-15 08:16:07 +00:00
},
'host_arch%': '<(host_arch)',
2016-06-08 15:27:21 +00:00
'target_arch%': '<(target_arch)',
'use_sysroot%': '<(use_sysroot)',
2015-06-29 10:47:20 +00:00
'base_dir%': '<!(cd <(DEPTH) && python -c "import os; print os.getcwd()")',
2015-12-10 10:10:59 +00:00
2016-03-08 10:47:58 +00:00
# Instrument for code coverage and use coverage wrapper to exclude some
# files. Uses gcov if clang=0 is set explicitly. Otherwise,
# sanitizer_coverage must be set too.
2015-12-10 10:10:59 +00:00
'coverage%': 0,
2016-06-08 15:27:21 +00:00
# Default sysroot if no sysroot can be provided.
'sysroot%': '',
'conditions': [
# The system root for linux builds.
['OS=="linux" and use_sysroot==1', {
'conditions': [
['target_arch=="arm"', {
2017-04-05 20:07:01 +00:00
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_arm-sysroot',
2016-06-08 15:27:21 +00:00
}],
['target_arch=="x64"', {
2017-04-05 20:07:01 +00:00
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_amd64-sysroot',
2016-06-08 15:27:21 +00:00
}],
['target_arch=="ia32"', {
2017-04-05 20:07:01 +00:00
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_i386-sysroot',
2016-06-08 15:27:21 +00:00
}],
['target_arch=="mipsel"', {
2017-04-05 20:07:01 +00:00
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_mips-sysroot',
2016-06-08 15:27:21 +00:00
}],
],
}], # OS=="linux" and use_sysroot==1
],
2011-08-25 14:50:09 +00:00
},
2015-06-29 10:47:20 +00:00
'base_dir%': '<(base_dir)',
2011-08-25 14:50:09 +00:00
'host_arch%': '<(host_arch)',
2011-09-15 08:16:07 +00:00
'target_arch%': '<(target_arch)',
2016-02-25 08:20:27 +00:00
'v8_target_arch%': '<(target_arch)',
2015-12-10 10:10:59 +00:00
'coverage%': '<(coverage)',
2016-06-08 15:27:21 +00:00
'sysroot%': '<(sysroot)',
2015-04-17 08:13:20 +00:00
'asan%': 0,
'lsan%': 0,
'msan%': 0,
'tsan%': 0,
2015-05-27 16:18:22 +00:00
# Enable coverage gathering instrumentation in sanitizer tools. This flag
# also controls coverage granularity (1 for function-level, 2 for
# block-level, 3 for edge-level).
'sanitizer_coverage%': 0,
2016-08-01 09:41:09 +00:00
# Use dynamic libraries instrumented by one of the sanitizers
# instead of the standard system libraries. Set this flag to download
# prebuilt binaries from GCS.
'use_prebuilt_instrumented_libraries%': 0,
2015-05-28 11:50:44 +00:00
# Use libc++ (buildtools/third_party/libc++ and
# buildtools/third_party/libc++abi) instead of stdlibc++ as standard
# library. This is intended to be used for instrumented builds.
'use_custom_libcxx%': 0,
2015-01-21 15:30:18 +00:00
2015-06-29 10:47:20 +00:00
'clang_dir%': '<(base_dir)/third_party/llvm-build/Release+Asserts',
2016-08-01 09:41:09 +00:00
'make_clang_dir%': '<(base_dir)/third_party/llvm-build/Release+Asserts',
2015-06-24 05:35:07 +00:00
2015-08-07 09:05:13 +00:00
# Control Flow Integrity for virtual calls and casts.
# See http://clang.llvm.org/docs/ControlFlowIntegrity.html
'cfi_vptr%': 0,
'cfi_diag%': 0,
2015-09-15 08:45:34 +00:00
'cfi_blacklist%': '<(base_dir)/tools/cfi/blacklist.txt',
2015-11-02 10:40:16 +00:00
# Set to 1 to enable fast builds.
# TODO(machenbach): Only configured for windows.
'fastbuild%': 0,
2016-02-25 08:20:27 +00:00
# goma settings.
# 1 to use goma.
# If no gomadir is set, it uses the default gomadir.
'use_goma%': 0,
'gomadir%': '',
2016-02-25 12:55:14 +00:00
'test_isolation_mode%': 'noop',
2016-06-09 13:23:00 +00:00
# By default, use ICU data file (icudtl.dat).
'icu_use_data_file_flag%': 1,
2015-01-21 15:30:18 +00:00
'conditions': [
2016-02-25 08:20:27 +00:00
# Set default gomadir.
['OS=="win"', {
'gomadir': 'c:\\goma\\goma-win',
}, {
'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
}],
2016-03-08 10:47:58 +00:00
['host_arch!="ppc" and host_arch!="ppc64" and host_arch!="ppc64le" and host_arch!="s390" and host_arch!="s390x"', {
2015-12-10 10:10:59 +00:00
'host_clang%': 1,
2015-06-24 05:35:07 +00:00
}, {
2015-12-10 10:10:59 +00:00
'host_clang%': 0,
2015-06-24 05:35:07 +00:00
}],
2015-08-07 09:05:13 +00:00
# linux_use_bundled_gold: whether to use the gold linker binary checked
# into third_party/binutils. Force this off via GYP_DEFINES when you
# are using a custom toolchain and need to control -B in ldflags.
# Do not use 32-bit gold on 32-bit hosts as it runs out address space
# for component=static_library builds.
2016-07-05 10:25:24 +00:00
['((OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm" or (target_arch=="ia32" and host_arch=="x64"))) or (OS=="linux" and target_arch=="mipsel")', {
2015-08-07 09:05:13 +00:00
'linux_use_bundled_gold%': 1,
}, {
'linux_use_bundled_gold%': 0,
}],
2015-01-21 15:30:18 +00:00
],
2011-08-25 14:50:09 +00:00
},
2015-06-29 10:47:20 +00:00
'base_dir%': '<(base_dir)',
2015-06-24 05:35:07 +00:00
'clang_dir%': '<(clang_dir)',
2016-08-01 09:41:09 +00:00
'make_clang_dir%': '<(make_clang_dir)',
2011-08-25 14:50:09 +00:00
'host_arch%': '<(host_arch)',
2015-06-24 05:35:07 +00:00
'host_clang%': '<(host_clang)',
2011-08-25 14:50:09 +00:00
'target_arch%': '<(target_arch)',
'v8_target_arch%': '<(v8_target_arch)',
2011-10-06 11:08:41 +00:00
'werror%': '-Werror',
2015-01-21 15:30:18 +00:00
'use_goma%': '<(use_goma)',
'gomadir%': '<(gomadir)',
2015-04-17 08:13:20 +00:00
'asan%': '<(asan)',
'lsan%': '<(lsan)',
'msan%': '<(msan)',
'tsan%': '<(tsan)',
2015-05-27 16:18:22 +00:00
'sanitizer_coverage%': '<(sanitizer_coverage)',
2016-08-01 09:41:09 +00:00
'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
2015-05-28 11:50:44 +00:00
'use_custom_libcxx%': '<(use_custom_libcxx)',
2015-08-07 09:05:13 +00:00
'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
'cfi_vptr%': '<(cfi_vptr)',
'cfi_diag%': '<(cfi_diag)',
2015-09-15 08:45:34 +00:00
'cfi_blacklist%': '<(cfi_blacklist)',
2015-09-25 14:36:58 +00:00
'test_isolation_mode%': '<(test_isolation_mode)',
2015-11-02 10:40:16 +00:00
'fastbuild%': '<(fastbuild)',
2015-12-10 10:10:59 +00:00
'coverage%': '<(coverage)',
2016-06-08 15:27:21 +00:00
'sysroot%': '<(sysroot)',
2016-06-09 13:23:00 +00:00
'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
2013-06-28 15:22:46 +00:00
2015-08-20 00:01:07 +00:00
# Add a simple extras solely for the purpose of the cctests
2015-05-20 07:38:19 +00:00
'v8_extra_library_files': ['../test/cctest/test-extra.js'],
2015-08-20 00:01:07 +00:00
'v8_experimental_extra_library_files': ['../test/cctest/test-experimental-extra.js'],
2015-05-20 07:38:19 +00:00
2013-06-28 15:22:46 +00:00
# .gyp files or targets should set v8_code to 1 if they build V8 specific
# code, as opposed to external code. This variable is used to control such
# things as the set of warnings to enable, and whether warnings are treated
# as errors.
'v8_code%': 0,
2013-10-14 13:07:41 +00:00
# Speeds up Debug builds:
# 0 - Compiler optimizations off (debuggable) (default). This may
# be 5x slower than Release (or worse).
2015-01-12 09:58:29 +00:00
# 1 - Turn on optimizations and disable slow DCHECKs, but leave
# V8_ENABLE_CHECKS and most other assertions enabled. This may cause
# some v8 tests to fail in the Debug configuration. This roughly
# matches the performance of a Release build and can be used by
# embedders that need to build their own code as debug but don't want
# or need a debug version of V8. This should produce near-release
# speeds.
2013-10-14 13:07:41 +00:00
'v8_optimized_debug%': 0,
2014-12-11 15:27:38 +00:00
# Use external files for startup data blobs:
# the JS builtins sources and the start snapshot.
# Embedders that don't use standalone.gypi will need to add
# their own default value.
2015-08-17 13:59:40 +00:00
'v8_use_external_startup_data%': 1,
2014-12-11 15:27:38 +00:00
2013-09-17 08:31:56 +00:00
# Relative path to icu.gyp from this file.
'icu_gyp_path': '../third_party/icu/icu.gyp',
2011-08-25 14:50:09 +00:00
'conditions': [
['(v8_target_arch=="arm" and host_arch!="arm") or \
2014-03-21 08:47:03 +00:00
(v8_target_arch=="arm64" and host_arch!="arm64") or \
2012-07-11 15:15:04 +00:00
(v8_target_arch=="mipsel" and host_arch!="mipsel") or \
2014-07-09 11:08:26 +00:00
(v8_target_arch=="mips64el" and host_arch!="mips64el") or \
2012-07-18 11:43:44 +00:00
(v8_target_arch=="x64" and host_arch!="x64") or \
2014-01-02 07:04:05 +00:00
(OS=="android" or OS=="qnx")', {
2011-08-25 14:50:09 +00:00
'want_separate_host_toolset': 1,
}, {
'want_separate_host_toolset': 0,
}],
2013-06-28 15:22:46 +00:00
['OS == "win"', {
'os_posix%': 0,
}, {
'os_posix%': 1,
}],
2015-01-21 15:30:18 +00:00
['OS=="win" and use_goma==1', {
# goma doesn't support pch yet.
'chromium_win_pch': 0,
2015-11-02 10:40:16 +00:00
# goma doesn't support PDB yet.
'fastbuild%': 1,
2015-01-21 15:30:18 +00:00
}],
2017-07-18 15:55:06 +00:00
['((v8_target_arch=="ia32" or v8_target_arch=="x64") and \
2015-08-03 18:02:24 +00:00
(OS=="linux" or OS=="mac")) or (v8_target_arch=="ppc64" and OS=="linux")', {
2013-07-03 12:00:40 +00:00
'v8_enable_gdbjit%': 1,
}, {
'v8_enable_gdbjit%': 0,
}],
2016-02-25 08:20:27 +00:00
['(OS=="linux" or OS=="mac") and (target_arch=="ia32" or target_arch=="x64") and \
2017-07-18 15:55:06 +00:00
v8_target_arch!="x32"', {
2016-02-25 08:20:27 +00:00
'clang%': 1,
}, {
'clang%': 0,
}],
2015-04-17 08:13:20 +00:00
['asan==1 or lsan==1 or msan==1 or tsan==1', {
'clang%': 1,
'use_allocator%': 'none',
}],
2015-05-28 11:50:44 +00:00
['asan==1 and OS=="linux"', {
'use_custom_libcxx%': 1,
}],
['tsan==1', {
'use_custom_libcxx%': 1,
}],
['msan==1', {
# Use a just-built, MSan-instrumented libc++ instead of the system-wide
# libstdc++. This is required to avoid false positive reports whenever
# the C++ standard library is used.
'use_custom_libcxx%': 1,
}],
2015-06-22 13:17:18 +00:00
['OS=="android"', {
# Location of Android NDK.
'variables': {
'variables': {
# The Android toolchain needs to use the absolute path to the NDK
# because it is used at different levels in the GYP files.
2018-01-10 23:18:43 +00:00
'android_ndk_root%': '<(base_dir)/third_party/android_ndk/',
2015-06-22 13:17:18 +00:00
'android_host_arch%': "<!(uname -m | sed -e 's/i[3456]86/x86/')",
2016-06-06 08:47:27 +00:00
# Version of the NDK. Used to ensure full rebuilds on NDK rolls.
2016-09-08 10:30:44 +00:00
'android_ndk_version%': 'r12b',
2015-06-22 13:17:18 +00:00
'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
2016-04-13 23:11:54 +00:00
'os_folder_name%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/darwin/')",
2015-06-22 13:17:18 +00:00
},
# Copy conditionally-set variables out one scope.
'android_ndk_root%': '<(android_ndk_root)',
2016-06-06 08:47:27 +00:00
'android_ndk_version%': '<(android_ndk_version)',
2015-06-26 12:03:54 +00:00
'host_os%': '<(host_os)',
2016-04-13 23:11:54 +00:00
'os_folder_name%': '<(os_folder_name)',
2015-06-22 13:17:18 +00:00
'conditions': [
['target_arch == "ia32"', {
2016-04-13 23:11:54 +00:00
'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin',
2015-06-26 12:03:54 +00:00
'android_target_arch%': 'x86',
'android_target_platform%': '16',
2016-04-13 23:11:54 +00:00
'arm_version%': 'default',
2015-06-22 13:17:18 +00:00
}],
['target_arch == "x64"', {
2016-04-13 23:11:54 +00:00
'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin',
2015-06-26 12:03:54 +00:00
'android_target_arch%': 'x86_64',
'android_target_platform%': '21',
2016-04-13 23:11:54 +00:00
'arm_version%': 'default',
2015-06-22 13:17:18 +00:00
}],
['target_arch=="arm"', {
2016-04-13 23:11:54 +00:00
'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin',
2015-06-26 12:03:54 +00:00
'android_target_arch%': 'arm',
'android_target_platform%': '16',
'arm_version%': 7,
2015-06-22 13:17:18 +00:00
}],
['target_arch == "arm64"', {
2016-04-13 23:11:54 +00:00
'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin',
2015-06-26 12:03:54 +00:00
'android_target_arch%': 'arm64',
'android_target_platform%': '21',
'arm_version%': 'default',
2015-06-22 13:17:18 +00:00
}],
['target_arch == "mipsel"', {
2016-04-13 23:11:54 +00:00
'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin',
2015-06-26 12:03:54 +00:00
'android_target_arch%': 'mips',
'android_target_platform%': '16',
2016-04-13 23:11:54 +00:00
'arm_version%': 'default',
2015-06-22 13:17:18 +00:00
}],
['target_arch == "mips64el"', {
2016-04-13 23:11:54 +00:00
'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin',
2015-06-26 12:03:54 +00:00
'android_target_arch%': 'mips64',
'android_target_platform%': '21',
2016-04-13 23:11:54 +00:00
'arm_version%': 'default',
2015-06-22 13:17:18 +00:00
}],
],
},
2015-06-24 05:35:07 +00:00
# Copy conditionally-set variables out one scope.
2016-06-06 08:47:27 +00:00
'android_ndk_version%': '<(android_ndk_version)',
2015-06-26 12:03:54 +00:00
'android_target_arch%': '<(android_target_arch)',
'android_target_platform%': '<(android_target_platform)',
2015-06-24 05:35:07 +00:00
'android_toolchain%': '<(android_toolchain)',
2015-06-26 12:03:54 +00:00
'arm_version%': '<(arm_version)',
'host_os%': '<(host_os)',
2015-06-24 05:35:07 +00:00
2016-08-28 21:03:07 +00:00
# Print to stdout on Android.
'v8_android_log_stdout%': 1,
2015-06-22 13:17:18 +00:00
'conditions': [
['android_ndk_root==""', {
'variables': {
'android_sysroot': '<(android_toolchain)/sysroot/',
2016-02-08 08:26:45 +00:00
'android_stl': '<(android_toolchain)/sources/cxx-stl/',
2015-06-22 13:17:18 +00:00
},
'conditions': [
['target_arch=="x64"', {
'android_lib': '<(android_sysroot)/usr/lib64',
}, {
'android_lib': '<(android_sysroot)/usr/lib',
}],
],
2016-02-08 08:26:45 +00:00
'android_libcpp_include': '<(android_stl)/llvm-libc++/libcxx/include',
'android_libcpp_abi_include': '<(android_stl)/llvm-libc++abi/libcxxabi/include',
'android_libcpp_libs': '<(android_stl)/llvm-libc++/libs',
'android_support_include': '<(android_toolchain)/sources/android/support/include',
'android_sysroot': '<(android_sysroot)',
2015-06-22 13:17:18 +00:00
}, {
'variables': {
'android_sysroot': '<(android_ndk_root)/platforms/android-<(android_target_platform)/arch-<(android_target_arch)',
2016-02-08 08:26:45 +00:00
'android_stl': '<(android_ndk_root)/sources/cxx-stl/',
2015-06-22 13:17:18 +00:00
},
'conditions': [
['target_arch=="x64"', {
'android_lib': '<(android_sysroot)/usr/lib64',
}, {
'android_lib': '<(android_sysroot)/usr/lib',
}],
],
2016-02-08 08:26:45 +00:00
'android_libcpp_include': '<(android_stl)/llvm-libc++/libcxx/include',
'android_libcpp_abi_include': '<(android_stl)/llvm-libc++abi/libcxxabi/include',
'android_libcpp_libs': '<(android_stl)/llvm-libc++/libs',
'android_support_include': '<(android_ndk_root)/sources/android/support/include',
'android_sysroot': '<(android_sysroot)',
2015-06-22 13:17:18 +00:00
}],
],
2016-02-08 08:26:45 +00:00
'android_libcpp_library': 'c++_static',
2015-06-22 13:17:18 +00:00
}], # OS=="android"
2015-06-24 05:35:07 +00:00
['host_clang==1', {
2016-04-13 23:11:54 +00:00
'conditions':[
['OS=="android"', {
'host_ld': '<!(which ld)',
'host_ranlib': '<!(which ranlib)',
}],
],
2015-06-29 10:47:20 +00:00
'host_cc': '<(clang_dir)/bin/clang',
'host_cxx': '<(clang_dir)/bin/clang++',
2015-06-24 05:35:07 +00:00
}, {
'host_cc': '<!(which gcc)',
'host_cxx': '<!(which g++)',
}],
2011-08-25 14:50:09 +00:00
],
2012-05-03 08:11:38 +00:00
# Default ARM variable settings.
2015-06-26 10:39:09 +00:00
'arm_version%': 'default',
2012-05-03 08:11:38 +00:00
'arm_fpu%': 'vfpv3',
2013-04-16 15:36:11 +00:00
'arm_float_abi%': 'default',
'arm_thumb': 'default',
2014-11-10 11:47:54 +00:00
# Default MIPS variable settings.
'mips_arch_variant%': 'r2',
# Possible values fp32, fp64, fpxx.
# fp32 - 32 32-bit FPU registers are available, doubles are placed in
# register pairs.
# fp64 - 32 64-bit FPU registers are available.
# fpxx - compatibility mode, it chooses fp32 or fp64 depending on runtime
# detection
'mips_fpu_mode%': 'fp32',
2011-08-25 14:50:09 +00:00
},
'target_defaults': {
2013-06-28 15:22:46 +00:00
'variables': {
'v8_code%': '<(v8_code)',
2016-04-26 07:49:58 +00:00
'clang_warning_flags': [
2016-11-14 10:48:26 +00:00
'-Wsign-compare',
2016-04-26 07:49:58 +00:00
# TODO(thakis): https://crbug.com/604888
'-Wno-undefined-var-template',
2016-08-04 15:39:50 +00:00
# TODO(yangguo): issue 5258
'-Wno-nonportable-include-path',
2017-11-08 10:29:14 +00:00
'-Wno-tautological-constant-compare',
2016-04-26 07:49:58 +00:00
],
2015-06-26 12:03:54 +00:00
'conditions':[
['OS=="android"', {
'host_os%': '<(host_os)',
}],
],
2013-06-28 15:22:46 +00:00
},
2016-04-15 13:56:34 +00:00
'includes': [ 'set_clang_warning_flags.gypi', ],
2011-08-25 14:50:09 +00:00
'default_configuration': 'Debug',
'configurations': {
Use abstract configurations to switch between opt debug settings
The problem is that conditions are evaluated before configuration inheritance is resolved, so we can't just define a configuration like this:
'Optdebug': {
'inherits_from': ['Debug'],
'variables': {
'v8_optimized_debug': 2,
}
}
Instead, we have to put the different settings depending on the optimization level into separate configurations, and use conditions inside the concrete configurations to inherit from the correct base class.
Common settings go in the base configuration DebugBaseCommon, and v8_optimized_debug dependent settings go into DebugBase{0,1,2}
The new Debug configuration inherits from DebugBaseCommon and DebugBase<(v8_optimized_debug), while the new configuration Optdebug inherits from DebugBaseCommon and DebugBase2.
BUG=v8:3252
R=machenbach@chromium.org, jkummerow@chromium.org
LOG=n
Review URL: https://codereview.chromium.org/224443003
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20605 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-09 09:54:49 +00:00
'DebugBaseCommon': {
2014-10-22 08:12:17 +00:00
'conditions': [
2015-03-18 08:42:14 +00:00
['OS=="aix"', {
'cflags': [ '-g', '-Og', '-gxcoff' ],
}, {
'cflags': [ '-g', '-O0' ],
2015-01-30 08:01:53 +00:00
}],
2014-10-22 08:12:17 +00:00
],
2011-08-25 14:50:09 +00:00
},
Use abstract configurations to switch between opt debug settings
The problem is that conditions are evaluated before configuration inheritance is resolved, so we can't just define a configuration like this:
'Optdebug': {
'inherits_from': ['Debug'],
'variables': {
'v8_optimized_debug': 2,
}
}
Instead, we have to put the different settings depending on the optimization level into separate configurations, and use conditions inside the concrete configurations to inherit from the correct base class.
Common settings go in the base configuration DebugBaseCommon, and v8_optimized_debug dependent settings go into DebugBase{0,1,2}
The new Debug configuration inherits from DebugBaseCommon and DebugBase<(v8_optimized_debug), while the new configuration Optdebug inherits from DebugBaseCommon and DebugBase2.
BUG=v8:3252
R=machenbach@chromium.org, jkummerow@chromium.org
LOG=n
Review URL: https://codereview.chromium.org/224443003
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20605 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-09 09:54:49 +00:00
'Optdebug': {
2015-01-12 09:58:29 +00:00
'inherit_from': [ 'DebugBaseCommon', 'DebugBase1' ],
Use abstract configurations to switch between opt debug settings
The problem is that conditions are evaluated before configuration inheritance is resolved, so we can't just define a configuration like this:
'Optdebug': {
'inherits_from': ['Debug'],
'variables': {
'v8_optimized_debug': 2,
}
}
Instead, we have to put the different settings depending on the optimization level into separate configurations, and use conditions inside the concrete configurations to inherit from the correct base class.
Common settings go in the base configuration DebugBaseCommon, and v8_optimized_debug dependent settings go into DebugBase{0,1,2}
The new Debug configuration inherits from DebugBaseCommon and DebugBase<(v8_optimized_debug), while the new configuration Optdebug inherits from DebugBaseCommon and DebugBase2.
BUG=v8:3252
R=machenbach@chromium.org, jkummerow@chromium.org
LOG=n
Review URL: https://codereview.chromium.org/224443003
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20605 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-09 09:54:49 +00:00
},
'Debug': {
# Xcode insists on this empty entry.
},
2013-02-06 10:51:55 +00:00
'Release': {
2015-04-15 15:20:14 +00:00
'cflags+': ['<@(release_extra_cflags)'],
2013-02-06 10:51:55 +00:00
},
2015-07-13 12:39:15 +00:00
'conditions': [
['OS=="win"', {
'Optdebug_x64': {
'inherit_from': ['Optdebug'],
},
'Debug_x64': {
'inherit_from': ['Debug'],
},
'Release_x64': {
'inherit_from': ['Release'],
},
}],
],
2011-08-25 14:50:09 +00:00
},
2015-03-09 17:22:20 +00:00
'conditions':[
2015-11-27 11:42:44 +00:00
['clang==0', {
2016-10-18 10:47:45 +00:00
'cflags+': [
'-Wno-uninitialized',
],
2015-11-27 11:42:44 +00:00
}],
2015-12-24 11:58:17 +00:00
['clang==1 or host_clang==1', {
2015-03-09 17:22:20 +00:00
# This is here so that all files get recompiled after a clang roll and
# when turning clang on or off.
# (defines are passed via the command line, and build systems rebuild
# things when their commandline changes). Nothing should ever read this
# define.
2015-12-02 20:25:46 +00:00
'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
2015-03-09 17:22:20 +00:00
}],
2016-04-20 14:28:03 +00:00
['clang==1 and target_arch=="ia32"', {
'cflags': ['-mstack-alignment=16', '-mstackrealign'],
}],
2015-11-02 10:40:16 +00:00
['fastbuild!=0', {
'conditions': [
['OS=="win" and fastbuild==1', {
'msvs_settings': {
'VCLinkerTool': {
# This tells the linker to generate .pdbs, so that
# we can get meaningful stack traces.
'GenerateDebugInformation': 'true',
},
'VCCLCompilerTool': {
# No debug info to be generated by compiler.
'DebugInformationFormat': '0',
},
},
}],
],
}], # fastbuild!=0
2015-03-09 17:22:20 +00:00
],
2013-06-28 15:22:46 +00:00
'target_conditions': [
['v8_code == 0', {
2013-08-01 19:20:01 +00:00
'defines!': [
'DEBUG',
],
2013-06-28 15:22:46 +00:00
'conditions': [
['os_posix == 1 and OS != "mac"', {
2015-02-26 08:19:27 +00:00
# We don't want to get warnings from third-party code,
# so remove any existing warning-enabling flags like -Wall.
2013-06-28 15:22:46 +00:00
'cflags!': [
2015-02-26 08:19:27 +00:00
'-pedantic',
'-Wall',
2013-06-28 15:22:46 +00:00
'-Werror',
2015-02-26 08:19:27 +00:00
'-Wextra',
2015-04-28 06:54:08 +00:00
'-Wshorten-64-to-32',
2015-02-26 08:19:27 +00:00
],
'cflags+': [
# Clang considers the `register` keyword as deprecated, but
# ICU uses it all over the place.
'-Wno-deprecated-register',
# ICU uses its own deprecated functions.
'-Wno-deprecated-declarations',
# ICU prefers `a && b || c` over `(a && b) || c`.
'-Wno-logical-op-parentheses',
# ICU has some `unsigned < 0` checks.
'-Wno-tautological-compare',
# uresdata.c has switch(RES_GET_TYPE(x)) code. The
# RES_GET_TYPE macro returns an UResType enum, but some switch
# statement contains case values that aren't part of that
# enum (e.g. URES_TABLE32 which is in UResInternalType). This
# is on purpose.
'-Wno-switch',
],
'cflags_cc!': [
'-Wnon-virtual-dtor',
2013-06-28 15:22:46 +00:00
],
}],
['OS == "mac"', {
'xcode_settings': {
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
},
}],
['OS == "win"', {
'msvs_settings': {
'VCCLCompilerTool': {
'WarnAsError': 'false',
},
},
}],
],
}],
],
2011-08-25 14:50:09 +00:00
},
'conditions': [
2015-05-26 14:51:35 +00:00
['os_posix==1 and OS!="mac"', {
2014-03-13 10:36:55 +00:00
'target_defaults': {
2015-06-22 11:32:03 +00:00
'conditions': [
2015-05-26 14:51:35 +00:00
# Common options for AddressSanitizer, LeakSanitizer,
2015-10-21 13:35:23 +00:00
# ThreadSanitizer, MemorySanitizer and CFI builds.
['asan==1 or lsan==1 or tsan==1 or msan==1 or cfi_vptr==1', {
2015-05-26 14:51:35 +00:00
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fno-omit-frame-pointer',
'-gline-tables-only',
],
'cflags!': [
'-fomit-frame-pointer',
],
}],
],
}],
['asan==1', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize=address',
],
'ldflags': [
'-fsanitize=address',
],
'defines': [
'ADDRESS_SANITIZER',
],
}],
],
}],
['lsan==1', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize=leak',
],
'ldflags': [
'-fsanitize=leak',
],
'defines': [
'LEAK_SANITIZER',
],
}],
],
}],
['tsan==1', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize=thread',
],
'ldflags': [
'-fsanitize=thread',
],
'defines': [
'THREAD_SANITIZER',
],
}],
],
}],
['msan==1', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize=memory',
'-fsanitize-memory-track-origins=<(msan_track_origins)',
2015-11-26 10:34:10 +00:00
'-fPIC',
2015-05-26 14:51:35 +00:00
],
'ldflags': [
'-fsanitize=memory',
2015-11-26 10:34:10 +00:00
'-pie',
2015-05-26 14:51:35 +00:00
],
'defines': [
'MEMORY_SANITIZER',
],
}],
],
2015-05-28 11:50:44 +00:00
}],
2016-08-01 09:41:09 +00:00
['use_prebuilt_instrumented_libraries==1', {
'dependencies': [
'<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
],
}],
2015-05-28 11:50:44 +00:00
['use_custom_libcxx==1', {
2015-05-26 14:51:35 +00:00
'dependencies': [
'<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
],
}],
2015-05-27 16:18:22 +00:00
['sanitizer_coverage!=0', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize-coverage=<(sanitizer_coverage)',
],
'defines': [
'SANITIZER_COVERAGE',
],
}],
],
}],
2017-06-27 07:21:27 +00:00
['linux_use_bundled_gold==1', {
2015-08-07 09:05:13 +00:00
# Put our binutils, which contains gold in the search path. We pass
# the path to gold to the compiler. gyp leaves unspecified what the
# cwd is when running the compiler, so the normal gyp path-munging
# fails us. This hack gets the right path.
'ldflags': [
# Note, Chromium allows ia32 host arch as well, we limit this to
# x64 in v8.
'-B<(base_dir)/third_party/binutils/Linux_x64/Release/bin',
],
}],
2016-06-08 15:27:21 +00:00
['sysroot!="" and clang==1', {
'target_conditions': [
['_toolset=="target"', {
2017-05-29 11:55:27 +00:00
'variables': {
'ld_paths': ['<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))'],
},
2016-06-08 15:27:21 +00:00
'cflags': [
'--sysroot=<(sysroot)',
],
'ldflags': [
'--sysroot=<(sysroot)',
2017-05-29 11:55:27 +00:00
'<!(<(base_dir)/gypfiles/sysroot_ld_flags.sh <@(ld_paths))',
2016-06-08 15:27:21 +00:00
],
}]]
}],
2015-04-27 13:20:05 +00:00
],
},
}],
2015-05-27 16:18:22 +00:00
['OS=="mac"', {
2015-01-09 13:38:13 +00:00
'target_defaults': {
2015-05-27 16:18:22 +00:00
'conditions': [
['asan==1', {
'xcode_settings': {
# FIXME(machenbach): This is outdated compared to common.gypi.
'OTHER_CFLAGS+': [
'-fno-omit-frame-pointer',
'-gline-tables-only',
'-fsanitize=address',
'-w', # http://crbug.com/162783
],
'OTHER_CFLAGS!': [
'-fomit-frame-pointer',
],
'defines': [
'ADDRESS_SANITIZER',
],
},
'dependencies': [
2016-04-29 10:08:53 +00:00
'<(DEPTH)/gypfiles/mac/asan.gyp:asan_dynamic_runtime',
2015-05-27 16:18:22 +00:00
],
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
}],
],
}],
['sanitizer_coverage!=0', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize-coverage=<(sanitizer_coverage)',
],
'defines': [
'SANITIZER_COVERAGE',
],
}],
],
2015-01-09 13:38:13 +00:00
}],
],
2015-05-27 16:18:22 +00:00
}, # target_defaults
}], # OS=="mac"
2012-01-05 12:17:08 +00:00
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
2015-01-30 08:01:53 +00:00
or OS=="netbsd" or OS=="aix"', {
2011-08-25 14:50:09 +00:00
'target_defaults': {
2014-09-04 09:23:50 +00:00
'cflags': [
'-Wall',
'<(werror)',
'-Wno-unused-parameter',
'-pthread',
'-pedantic',
2017-08-29 11:06:35 +00:00
'-Wno-missing-field-initializers',
2015-12-17 18:48:07 +00:00
'-Wno-gnu-zero-variadic-macro-arguments',
2014-09-04 09:23:50 +00:00
],
2015-05-22 16:40:27 +00:00
'cflags_cc': [
'-Wnon-virtual-dtor',
'-fno-exceptions',
'-fno-rtti',
2016-03-22 15:24:01 +00:00
'-std=gnu++11',
2015-05-22 16:40:27 +00:00
],
2011-08-25 14:50:09 +00:00
'ldflags': [ '-pthread', ],
'conditions': [
2015-12-17 18:48:07 +00:00
# Don't warn about TRACE_EVENT_* macros with zero arguments passed to
# ##__VA_ARGS__. C99 strict mode prohibits having zero variadic macro
# arguments in gcc.
[ 'clang==0', {
'cflags!' : [
'-pedantic' ,
# Don't warn about unrecognized command line option.
'-Wno-gnu-zero-variadic-macro-arguments',
],
2017-05-04 12:59:38 +00:00
'cflags' : [
# Disable gcc warnings for optimizations based on the assumption
# that signed overflow does not occur. Generates false positives
# (see http://crbug.com/v8/6341).
"-Wno-strict-overflow",
2017-07-14 12:45:45 +00:00
# Don't rely on strict aliasing; v8 does weird pointer casts all
# over the place.
'-fno-strict-aliasing',
2017-05-04 12:59:38 +00:00
],
2017-11-04 09:51:59 +00:00
}, {
'cflags' : [
# TODO(hans): https://crbug.com/767059
'-Wno-tautological-constant-compare',
],
2015-12-17 18:48:07 +00:00
}],
2015-06-15 12:05:08 +00:00
[ 'clang==1 and (v8_target_arch=="x64" or v8_target_arch=="arm64" \
or v8_target_arch=="mips64el")', {
2015-04-28 06:54:08 +00:00
'cflags': [ '-Wshorten-64-to-32' ],
}],
2015-03-26 08:06:41 +00:00
[ 'host_arch=="ppc64" and OS!="aix"', {
2015-01-30 08:01:53 +00:00
'cflags': [ '-mminimal-toc' ],
}],
2012-12-14 14:27:06 +00:00
[ 'visibility=="hidden" and v8_enable_backtrace==0', {
2011-08-25 14:50:09 +00:00
'cflags': [ '-fvisibility=hidden' ],
}],
2011-08-26 11:23:51 +00:00
[ 'component=="shared_library"', {
'cflags': [ '-fPIC', ],
}],
2016-03-08 10:47:58 +00:00
[ 'clang==0 and coverage==1', {
2016-02-22 14:38:27 +00:00
'cflags': [ '-fprofile-arcs', '-ftest-coverage'],
2015-12-10 10:10:59 +00:00
'ldflags': [ '-fprofile-arcs'],
}],
2011-08-25 14:50:09 +00:00
],
},
2012-01-05 12:17:08 +00:00
}],
# 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"
# or OS=="netbsd"'
2014-01-02 07:04:05 +00:00
['OS=="qnx"', {
'target_defaults': {
2014-09-04 09:23:50 +00:00
'cflags': [
'-Wall',
'<(werror)',
'-Wno-unused-parameter',
# Don't warn about the "struct foo f = {0};" initialization pattern.
'-Wno-missing-field-initializers',
2015-12-17 18:48:07 +00:00
'-Wno-gnu-zero-variadic-macro-arguments',
2014-09-04 09:23:50 +00:00
],
2015-05-22 16:40:27 +00:00
'cflags_cc': [
'-Wnon-virtual-dtor',
'-fno-exceptions',
'-fno-rtti',
2016-03-22 15:24:01 +00:00
'-std=gnu++11',
2015-05-22 16:40:27 +00:00
],
2014-01-02 07:04:05 +00:00
'conditions': [
[ 'visibility=="hidden"', {
'cflags': [ '-fvisibility=hidden' ],
}],
[ 'component=="shared_library"', {
'cflags': [ '-fPIC' ],
}],
],
'target_conditions': [
[ '_toolset=="host" and host_os=="linux"', {
'cflags': [ '-pthread' ],
'ldflags': [ '-pthread' ],
'libraries': [ '-lrt' ],
}],
[ '_toolset=="target"', {
'cflags': [ '-Wno-psabi' ],
'libraries': [ '-lbacktrace', '-lsocket', '-lm' ],
}],
],
},
}], # OS=="qnx"
2011-08-25 14:50:09 +00:00
['OS=="win"', {
'target_defaults': {
'defines': [
'_CRT_SECURE_NO_DEPRECATE',
'_CRT_NONSTDC_NO_DEPRECATE',
2014-08-27 08:45:39 +00:00
'_USING_V110_SDK71_',
2011-08-25 14:50:09 +00:00
],
'conditions': [
['component=="static_library"', {
'defines': [
'_HAS_EXCEPTIONS=0',
],
}],
],
2017-04-08 09:54:03 +00:00
'msvs_cygwin_shell': 0,
2015-07-27 11:51:16 +00:00
'msvs_disabled_warnings': [
# C4091: 'typedef ': ignored on left of 'X' when no variable is
# declared.
# This happens in a number of Windows headers. Dumb.
4091,
# C4127: conditional expression is constant
# This warning can in theory catch dead code and other problems, but
# triggers in far too many desirable cases where the conditional
# expression is either set by macros or corresponds some legitimate
# compile-time constant expression (due to constant template args,
# conditionals comparing the sizes of different types, etc.). Some of
# these can be worked around, but it's not worth it.
4127,
# C4351: new behavior: elements of array 'array' will be default
# initialized
# This is a silly "warning" that basically just alerts you that the
# compiler is going to actually follow the language spec like it's
# supposed to, instead of not following it like old buggy versions
# did. There's absolutely no reason to turn this on.
4351,
# C4355: 'this': used in base member initializer list
# It's commonly useful to pass |this| to objects in a class'
# initializer list. While this warning can catch real bugs, most of
# the time the constructors in question don't attempt to call methods
# on the passed-in pointer (until later), and annotating every legit
# usage of this is simply more hassle than the warning is worth.
4355,
# C4503: 'identifier': decorated name length exceeded, name was
# truncated
# This only means that some long error messages might have truncated
# identifiers in the presence of lots of templates. It has no effect
# on program correctness and there's no real reason to waste time
# trying to prevent it.
4503,
# Warning C4589 says: "Constructor of abstract class ignores
# initializer for virtual base class." Disable this warning because it
# is flaky in VS 2015 RTM. It triggers on compiler generated
# copy-constructors in some cases.
4589,
# C4611: interaction between 'function' and C++ object destruction is
# non-portable
# This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
# suggests using exceptions instead of setjmp/longjmp for C++, but
# Chromium code compiles without exception support. We therefore have
# to use setjmp/longjmp for e.g. JPEG decode error handling, which
# means we have to turn off this warning (and be careful about how
# object destruction happens in such cases).
4611,
# TODO(jochen): These warnings are level 4. They will be slowly
# removed as code is fixed.
4100, # Unreferenced formal parameter
4121, # Alignment of a member was sensitive to packing
4244, # Conversion from 'type1' to 'type2', possible loss of data
4302, # Truncation from 'type 1' to 'type 2'
4309, # Truncation of constant value
4311, # Pointer truncation from 'type' to 'type'
4312, # Conversion from 'type1' to 'type2' of greater size
4505, # Unreferenced local function has been removed
4510, # Default constructor could not be generated
4512, # Assignment operator could not be generated
4610, # Object can never be instantiated
4800, # Forcing value to bool.
4838, # Narrowing conversion. Doesn't seem to be very useful.
4995, # 'X': name was marked as #pragma deprecated
4996, # 'X': was declared deprecated (for GetVersionEx).
# These are variable shadowing warnings that are new in VS2015. We
# should work through these at some point -- they may be removed from
# the RTM release in the /W4 set.
4456, 4457, 4458, 4459,
],
2011-08-25 14:50:09 +00:00
'msvs_settings': {
'VCCLCompilerTool': {
'MinimalRebuild': 'false',
'BufferSecurityCheck': 'true',
'EnableFunctionLevelLinking': 'true',
'RuntimeTypeInfo': 'false',
'WarningLevel': '3',
'WarnAsError': 'true',
'DebugInformationFormat': '3',
'Detect64BitPortabilityProblems': 'false',
'conditions': [
[ 'msvs_multi_core_compile', {
'AdditionalOptions': ['/MP'],
}],
['component=="shared_library"', {
'ExceptionHandling': '1', # /EHsc
}, {
'ExceptionHandling': '0',
}],
],
},
'VCLibrarianTool': {
'AdditionalOptions': ['/ignore:4221'],
2014-10-08 09:09:57 +00:00
'conditions': [
['v8_target_arch=="x64"', {
'TargetMachine': '17', # x64
}, {
'TargetMachine': '1', # ia32
}],
],
2011-08-25 14:50:09 +00:00
},
'VCLinkerTool': {
'AdditionalDependencies': [
'ws2_32.lib',
],
'GenerateDebugInformation': 'true',
'MapFileName': '$(OutDir)\\$(TargetName).map',
'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
'FixedBaseAddress': '1',
# LinkIncremental values:
# 0 == default
# 1 == /INCREMENTAL:NO
# 2 == /INCREMENTAL
'LinkIncremental': '1',
# SubSystem values:
# 0 == not set
# 1 == /SUBSYSTEM:CONSOLE
# 2 == /SUBSYSTEM:WINDOWS
'SubSystem': '1',
2013-07-09 09:55:27 +00:00
'conditions': [
['v8_enable_i18n_support==1', {
'AdditionalDependencies': [
'advapi32.lib',
],
}],
2014-10-08 09:09:57 +00:00
['v8_target_arch=="x64"', {
'MinimumRequiredVersion': '5.02', # Server 2003.
'TargetMachine': '17', # x64
}, {
'MinimumRequiredVersion': '5.01', # XP.
'TargetMachine': '1', # ia32
}],
2013-07-09 09:55:27 +00:00
],
2011-08-25 14:50:09 +00:00
},
2016-04-14 13:30:47 +00:00
'conditions': [
['clang==1', {
'VCCLCompilerTool': {
'AdditionalOptions': [
# Don't warn about unused function parameters.
# (This is also used on other platforms.)
'-Wno-unused-parameter',
# Don't warn about the "struct foo f = {0};" initialization
# pattern.
'-Wno-missing-field-initializers',
# TODO(hans): Make this list shorter eventually, http://crbug.com/504657
2016-04-15 13:56:34 +00:00
'-Qunused-arguments', # http://crbug.com/504658
2016-04-14 13:30:47 +00:00
'-Wno-microsoft-enum-value', # http://crbug.com/505296
'-Wno-unknown-pragmas', # http://crbug.com/505314
'-Wno-microsoft-cast', # http://crbug.com/550065
2016-04-15 13:56:34 +00:00
],
},
}],
['clang==1 and MSVS_VERSION == "2013"', {
'VCCLCompilerTool': {
'AdditionalOptions': [
'-fmsc-version=1800',
],
},
}],
['clang==1 and MSVS_VERSION == "2015"', {
'VCCLCompilerTool': {
'AdditionalOptions': [
2016-04-14 13:30:47 +00:00
'-fmsc-version=1900',
],
},
}],
],
2011-08-25 14:50:09 +00:00
},
},
}], # OS=="win"
['OS=="mac"', {
2012-05-11 12:18:09 +00:00
'xcode_settings': {
2014-12-18 20:42:32 +00:00
'SDKROOT': 'macosx',
2012-05-11 12:18:09 +00:00
'SYMROOT': '<(DEPTH)/xcodebuild',
},
2011-08-25 14:50:09 +00:00
'target_defaults': {
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
2014-08-05 13:23:55 +00:00
'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
2011-08-25 14:50:09 +00:00
'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
# (Equivalent to -fPIC)
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
# GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
2013-06-25 14:39:27 +00:00
'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
2012-07-02 14:58:43 +00:00
# MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
2011-08-25 14:50:09 +00:00
'PREBINDING': 'NO', # No -Wl,-prebind
2012-05-11 12:18:09 +00:00
'SYMROOT': '<(DEPTH)/xcodebuild',
2011-08-25 14:50:09 +00:00
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
'-fno-strict-aliasing',
],
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
'-Wno-unused-parameter',
2014-09-04 09:23:50 +00:00
# Don't warn about the "struct foo f = {0};" initialization pattern.
'-Wno-missing-field-initializers',
2015-12-17 18:48:07 +00:00
'-Wno-gnu-zero-variadic-macro-arguments',
2011-08-25 14:50:09 +00:00
],
},
2013-12-02 15:29:31 +00:00
'conditions': [
['werror==""', {
'xcode_settings': {'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO'},
}, {
'xcode_settings': {'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES'},
}],
2014-03-14 07:47:08 +00:00
['clang==1', {
'xcode_settings': {
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
2016-03-22 15:24:01 +00:00
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
2014-03-14 07:47:08 +00:00
},
2015-07-14 16:05:20 +00:00
'conditions': [
2016-04-28 13:34:45 +00:00
['clang_xcode==0', {
'xcode_settings': {
'CC': '<(clang_dir)/bin/clang',
'LDPLUSPLUS': '<(clang_dir)/bin/clang++',
'CLANG_CXX_LIBRARY': 'libc++'
},
}],
2015-07-14 16:05:20 +00:00
['v8_target_arch=="x64" or v8_target_arch=="arm64" \
or v8_target_arch=="mips64el"', {
'xcode_settings': {'WARNING_CFLAGS': ['-Wshorten-64-to-32']},
}],
],
2014-03-14 07:47:08 +00:00
}],
2013-12-02 15:29:31 +00:00
],
2011-08-25 14:50:09 +00:00
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
}],
], # target_conditions
}, # target_defaults
}], # OS=="mac"
2015-06-22 13:17:18 +00:00
['OS=="android"', {
'target_defaults': {
'defines': [
'ANDROID',
],
'configurations': {
'Release': {
'cflags': [
'-fomit-frame-pointer',
],
}, # Release
}, # configurations
'cflags': [ '-Wno-abi', '-Wall', '-W', '-Wno-unused-parameter'],
'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti', '-fno-exceptions',
2016-02-08 08:26:45 +00:00
'-std=gnu++11' ],
2015-06-22 13:17:18 +00:00
'target_conditions': [
['_toolset=="target"', {
'cflags!': [
'-pthread', # Not supported by Android toolchain.
],
'cflags': [
'-ffunction-sections',
'-funwind-tables',
'-fstack-protector',
'-fno-short-enums',
'-finline-limit=64',
'-Wa,--noexecstack',
2016-02-08 08:26:45 +00:00
'--sysroot=<(android_sysroot)',
2015-06-22 13:17:18 +00:00
],
'cflags_cc': [
2016-02-08 08:26:45 +00:00
'-isystem<(android_libcpp_include)',
'-isystem<(android_libcpp_abi_include)',
'-isystem<(android_support_include)',
2015-06-22 13:17:18 +00:00
],
'defines': [
'ANDROID',
#'__GNU_SOURCE=1', # Necessary for clone()
'HAVE_OFF64_T',
'HAVE_SYS_UIO_H',
'ANDROID_BINSIZE_HACK', # Enable temporary hacks to reduce binsize.
2016-06-06 08:47:27 +00:00
'ANDROID_NDK_VERSION=<(android_ndk_version)',
2015-06-22 13:17:18 +00:00
],
'ldflags!': [
'-pthread', # Not supported by Android toolchain.
],
'ldflags': [
'-Wl,--no-undefined',
2016-02-08 08:26:45 +00:00
'--sysroot=<(android_sysroot)',
'-nostdlib',
2015-06-22 13:17:18 +00:00
],
'libraries!': [
'-lrt', # librt is built into Bionic.
# Not supported by Android toolchain.
# Where do these come from? Can't find references in
# any Chromium gyp or gypi file. Maybe they come from
# gyp itself?
'-lpthread', '-lnss3', '-lnssutil3', '-lsmime3', '-lplds4', '-lplc4', '-lnspr4',
],
'libraries': [
2016-02-08 08:26:45 +00:00
'-l<(android_libcpp_library)',
'-latomic',
2015-06-22 13:17:18 +00:00
# Manually link the libgcc.a that the cross compiler uses.
2015-06-24 05:35:07 +00:00
'<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
2015-06-22 13:17:18 +00:00
'-lc',
'-ldl',
'-lm',
],
'conditions': [
['target_arch == "arm"', {
'ldflags': [
# Enable identical code folding to reduce size.
'-Wl,--icf=safe',
],
}],
['target_arch=="arm" and arm_version==7', {
'cflags': [
'-march=armv7-a',
'-mtune=cortex-a8',
'-mfpu=vfp3',
],
'ldflags': [
2016-02-08 08:26:45 +00:00
'-L<(android_libcpp_libs)/armeabi-v7a',
2015-06-22 13:17:18 +00:00
],
}],
['target_arch=="arm" and arm_version < 7', {
'ldflags': [
2016-02-08 08:26:45 +00:00
'-L<(android_libcpp_libs)/armeabi',
2015-06-22 13:17:18 +00:00
],
}],
['target_arch=="x64"', {
'ldflags': [
2016-02-08 08:26:45 +00:00
'-L<(android_libcpp_libs)/x86_64',
2015-06-22 13:17:18 +00:00
],
}],
['target_arch=="arm64"', {
'ldflags': [
2016-02-08 08:26:45 +00:00
'-L<(android_libcpp_libs)/arm64-v8a',
2015-06-22 13:17:18 +00:00
],
}],
2017-07-18 15:55:06 +00:00
['target_arch=="ia32"', {
2015-06-22 13:17:18 +00:00
# The x86 toolchain currently has problems with stack-protector.
'cflags!': [
'-fstack-protector',
],
'cflags': [
'-fno-stack-protector',
],
'ldflags': [
2016-02-08 08:26:45 +00:00
'-L<(android_libcpp_libs)/x86',
2015-06-22 13:17:18 +00:00
],
}],
['target_arch=="mipsel"', {
# The mips toolchain currently has problems with stack-protector.
'cflags!': [
'-fstack-protector',
'-U__linux__'
],
'cflags': [
'-fno-stack-protector',
],
'ldflags': [
2016-02-08 08:26:45 +00:00
'-L<(android_libcpp_libs)/mips',
2015-06-22 13:17:18 +00:00
],
}],
['(target_arch=="arm" or target_arch=="arm64" or target_arch=="x64" or target_arch=="ia32") and component!="shared_library"', {
'cflags': [
'-fPIE',
],
'ldflags': [
'-pie',
],
}],
],
'target_conditions': [
['_type=="executable"', {
'conditions': [
['target_arch=="arm64" or target_arch=="x64"', {
'ldflags': [
'-Wl,-dynamic-linker,/system/bin/linker64',
],
}, {
'ldflags': [
'-Wl,-dynamic-linker,/system/bin/linker',
],
}]
],
'ldflags': [
'-Bdynamic',
'-Wl,-z,nocopyreloc',
# crtbegin_dynamic.o should be the last item in ldflags.
'<(android_lib)/crtbegin_dynamic.o',
],
'libraries': [
# crtend_android.o needs to be the last item in libraries.
# Do not add any libraries after this!
'<(android_lib)/crtend_android.o',
],
}],
['_type=="shared_library"', {
'ldflags': [
'-Wl,-shared,-Bsymbolic',
'<(android_lib)/crtbegin_so.o',
],
}],
['_type=="static_library"', {
'ldflags': [
# Don't export symbols from statically linked libraries.
'-Wl,--exclude-libs=ALL',
],
}],
],
}], # _toolset=="target"
# Settings for building host targets using the system toolchain.
['_toolset=="host"', {
'cflags': [ '-pthread' ],
'ldflags': [ '-pthread' ],
'ldflags!': [
'-Wl,-z,noexecstack',
'-Wl,--gc-sections',
'-Wl,-O1',
'-Wl,--as-needed',
],
}],
], # target_conditions
}, # target_defaults
}], # OS=="android"
2015-06-24 05:35:07 +00:00
['OS=="android" and clang==0', {
# Hardcode the compiler names in the Makefile so that
# it won't depend on the environment at make time.
'make_global_settings': [
2016-04-13 23:11:54 +00:00
['LD', '<!(/bin/echo -n <(android_toolchain)/../*/bin/ld)'],
['RANLIB', '<!(/bin/echo -n <(android_toolchain)/../*/bin/ranlib)'],
2015-06-24 05:35:07 +00:00
['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
2016-04-13 23:11:54 +00:00
['LD.host', '<(host_ld)'],
['RANLIB.host', '<(host_ranlib)'],
2015-06-24 05:35:07 +00:00
['CC.host', '<(host_cc)'],
['CXX.host', '<(host_cxx)'],
],
}],
2015-03-05 12:54:27 +00:00
['clang!=1 and host_clang==1 and target_arch!="ia32" and target_arch!="x64"', {
'make_global_settings': [
2015-06-29 10:47:20 +00:00
['CC.host', '<(clang_dir)/bin/clang'],
['CXX.host', '<(clang_dir)/bin/clang++'],
2015-03-05 12:54:27 +00:00
],
}],
['clang==0 and host_clang==1 and target_arch!="ia32" and target_arch!="x64"', {
'target_conditions': [
['_toolset=="host"', {
'cflags_cc': [ '-std=gnu++11', ],
}],
],
'target_defaults': {
'target_conditions': [
['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
],
},
}],
2015-03-04 05:56:03 +00:00
['clang==1 and "<(GENERATOR)"=="ninja"', {
# See http://crbug.com/110262
'target_defaults': {
'cflags': [ '-fcolor-diagnostics' ],
'xcode_settings': { 'OTHER_CFLAGS': [ '-fcolor-diagnostics' ] },
},
}],
2014-11-27 17:18:03 +00:00
['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
2015-01-22 07:21:35 +00:00
'and OS!="win" and "<(GENERATOR)"=="make"', {
2014-11-27 17:18:03 +00:00
'make_global_settings': [
2015-06-29 10:47:20 +00:00
['CC', '<(clang_dir)/bin/clang'],
['CXX', '<(clang_dir)/bin/clang++'],
2015-01-22 07:21:35 +00:00
['CC.host', '$(CC)'],
['CXX.host', '$(CXX)'],
],
}],
['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
'and OS!="win" and "<(GENERATOR)"=="ninja"', {
'make_global_settings': [
['CC', '<(clang_dir)/bin/clang'],
['CXX', '<(clang_dir)/bin/clang++'],
2014-11-27 17:18:03 +00:00
['CC.host', '$(CC)'],
['CXX.host', '$(CXX)'],
],
}],
['clang==1 and OS=="win"', {
'make_global_settings': [
# On Windows, gyp's ninja generator only looks at CC.
2015-06-29 10:47:20 +00:00
['CC', '<(clang_dir)/bin/clang-cl'],
2014-11-27 17:18:03 +00:00
],
}],
2015-11-24 14:33:48 +00:00
['OS=="linux" and target_arch=="arm" and host_arch!="arm" and clang==0 and "<(GENERATOR)"=="ninja"', {
2015-11-20 08:45:37 +00:00
# Set default ARM cross tools on linux. These can be overridden
# using CC,CXX,CC.host and CXX.host environment variables.
'make_global_settings': [
['CC', '<!(which arm-linux-gnueabihf-gcc)'],
['CXX', '<!(which arm-linux-gnueabihf-g++)'],
['CC.host', '<(host_cc)'],
['CXX.host', '<(host_cxx)'],
],
}],
2015-01-21 15:30:18 +00:00
# TODO(yyanagisawa): supports GENERATOR==make
# make generator doesn't support CC_wrapper without CC
# in make_global_settings yet.
2016-02-25 08:20:27 +00:00
['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
2016-02-25 09:19:32 +00:00
'conditions': [
['coverage==1', {
# Wrap goma with coverage wrapper.
'make_global_settings': [
2016-04-29 10:08:53 +00:00
['CC_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py <(gomadir)/gomacc'],
['CXX_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py <(gomadir)/gomacc'],
['CC.host_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py <(gomadir)/gomacc'],
['CXX.host_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py <(gomadir)/gomacc'],
2016-02-25 09:19:32 +00:00
],
}, {
# Use only goma wrapper.
'make_global_settings': [
['CC_wrapper', '<(gomadir)/gomacc'],
['CXX_wrapper', '<(gomadir)/gomacc'],
['CC.host_wrapper', '<(gomadir)/gomacc'],
['CXX.host_wrapper', '<(gomadir)/gomacc'],
],
}],
],
}, {
'conditions': [
['coverage==1', {
# Use only coverage wrapper.
'make_global_settings': [
2016-04-29 10:08:53 +00:00
['CC_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py'],
['CXX_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py'],
['CC.host_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py'],
['CXX.host_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py'],
2016-02-25 09:19:32 +00:00
],
}],
2015-01-21 15:30:18 +00:00
],
}],
2011-08-25 14:50:09 +00:00
],
}