Commit 2c8663aa authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

[gyp] remove gyp files.

R=machenbach@chromium.org

Bug: v8:7335
Change-Id: Ied1101295fc9ee37fcc038b9aeb557229722df0b
Reviewed-on: https://chromium-review.googlesource.com/897566
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51185}
parent 922d14b4
......@@ -37,8 +37,6 @@
/base
/build
/buildtools
/gypfiles/.gold_plugin
/gypfiles/win_toolchain.json
/hydrogen.cfg
/obj
/out
......
......@@ -79,7 +79,6 @@ include_rules = [
# checkdeps.py shouldn't check for includes in these directories:
skip_child_includes = [
'build',
'gypfiles',
'third_party',
]
......@@ -334,13 +333,6 @@ hooks = [
'-s', 'v8/tools/mips_toolchain.tar.gz.sha1',
],
},
{
# A change to a .gyp, .gypi, or to GYP itself should run the generator.
'name': 'regyp_if_needed',
'pattern': '.',
'condition': 'build_for_node != True',
'action': ['python', 'v8/gypfiles/gyp_v8', '--running-as-hook'],
},
# Download and initialize "vpython" VirtualEnv environment packages.
{
'name': 'vpython_common',
......
This diff is collapsed.
# Copyright 2012 the V8 project authors. All rights reserved.
# 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.
# Those definitions should be consistent with the main Makefile
ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \
android_mipsel android_x87
MODES = release debug
# Generates all combinations of ANDROID ARCHES and MODES,
# e.g. "android_ia32.release" or "android_arm.release"
ANDROID_BUILDS = $(foreach mode,$(MODES), \
$(addsuffix .$(mode),$(ANDROID_ARCHES)))
ifeq ($(ARCH), android_arm)
DEFINES = target_arch=arm v8_target_arch=arm
else ifeq ($(ARCH), android_arm64)
DEFINES = target_arch=arm64 v8_target_arch=arm64
else ifeq ($(ARCH), android_mipsel)
DEFINES = target_arch=mipsel v8_target_arch=mipsel
else ifeq ($(ARCH), android_ia32)
DEFINES = target_arch=ia32 v8_target_arch=ia32
else ifeq ($(ARCH), android_x64)
DEFINES = target_arch=x64 v8_target_arch=x64
else ifeq ($(ARCH), android_x87)
DEFINES = target_arch=ia32 v8_target_arch=x87
else
$(error Target architecture "${ARCH}" is not supported)
endif
# Common flags.
DEFINES += OS=android
.SECONDEXPANSION:
$(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@
@$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \
BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
python -c "print raw_input().capitalize()") \
builddir="$(shell pwd)/$(OUTDIR)/$@"
# Android GYP file generation targets.
ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_BUILDS))
$(ANDROID_MAKEFILES):
GYP_GENERATORS=make-android \
GYP_DEFINES="${DEFINES}" \
PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/gypfiles:$(PYTHONPATH)" \
tools/gyp/gyp --generator-output="${OUTDIR}" gypfiles/all.gyp \
-Igypfiles/standalone.gypi --depth=. \
-S$(suffix $(basename $@))$(suffix $@) ${GYPFLAGS}
......@@ -286,39 +286,6 @@ def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api):
return []
def _CheckMissingFiles(input_api, output_api):
"""Runs verify_source_deps.py to ensure no files were added that are not in
GN.
"""
# We need to wait until we have an input_api object and use this
# roundabout construct to import checkdeps because this file is
# eval-ed and thus doesn't have __file__.
original_sys_path = sys.path
try:
sys.path = [input_api.os_path.join(input_api.PresubmitLocalPath(),
'gypfiles')] + sys.path
from verify_source_deps import missing_gn_files, missing_gyp_files
finally:
# Restore sys.path to what it was before.
sys.path = original_sys_path
gn_files = missing_gn_files()
gyp_files = missing_gyp_files()
results = []
if gn_files:
results.append(output_api.PresubmitError(
"You added one or more source files but didn't update the\n"
"corresponding BUILD.gn files:\n",
gn_files))
if gyp_files:
results.append(output_api.PresubmitError(
"You added one or more source files but didn't update the\n"
"corresponding gyp files:\n",
gyp_files))
return results
def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
results = []
......@@ -334,7 +301,6 @@ def _CommonChecks(input_api, output_api):
results.extend(_CheckHeadersHaveIncludeGuards(input_api, output_api))
results.extend(
_CheckNoInlineHeaderIncludesInNormalHeaders(input_api, output_api))
results.extend(_CheckMissingFiles(input_api, output_api))
results.extend(_CheckJSONFiles(input_api, output_api))
results.extend(_CheckMacroUndefs(input_api, output_api))
results.extend(input_api.RunTests(
......
......@@ -64,9 +64,6 @@
'merges': {
'filepath': '.',
},
'gypfiles': {
'filepath': 'gypfiles/',
},
'inspector': {
'filepath': 'inspector',
},
......@@ -116,9 +113,6 @@
# Only enabled on branches created with tools/release/create_release.py
# 'v8-merges@googlegroups.com',
],
'gypfiles': [
'machenbach@chromium.org',
],
'inspector': [
'devtools-reviews@chromium.org',
],
......
machenbach@chromium.org
For build instructions, please refer to:
https://code.google.com/p/v8/wiki/BuildingWithGYP
TL;DR version on *nix:
$ make dependencies # Only needed once.
$ make ia32.release -j8
$ make ia32.release.check # Optionally: run tests.
# Copyright 2011 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'All',
'type': 'none',
'dependencies': [
'd8.gyp:d8',
'inspector-test.gyp:*',
'mkgrokdump.gyp:*',
],
'conditions': [
['component!="shared_library"', {
'dependencies': [
'parser-shell.gyp:parser-shell',
],
}],
# These items don't compile for Android on Mac.
['host_os!="mac" or OS!="android"', {
'dependencies': [
'samples.gyp:*',
'cctest.gyp:*',
'fuzzer.gyp:*',
'unittests.gyp:*',
],
}],
]
}
]
}
This diff is collapsed.
#!/usr/bin/env python
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# CC/CXX wrapper script that excludes certain file patterns from coverage
# instrumentation.
import re
import subprocess
import sys
exclusions = [
'buildtools',
'src/third_party',
'third_party',
'test',
'testing',
]
def remove_if_exists(string_list, item):
if item in string_list:
string_list.remove(item)
args = sys.argv[1:]
text = ' '.join(sys.argv[2:])
for exclusion in exclusions:
if re.search(r'\-o obj/%s[^ ]*\.o' % exclusion, text):
remove_if_exists(args, '-fprofile-arcs')
remove_if_exists(args, '-ftest-coverage')
remove_if_exists(args, '-fsanitize-coverage=func')
remove_if_exists(args, '-fsanitize-coverage=bb')
remove_if_exists(args, '-fsanitize-coverage=edge')
remove_if_exists(args, '-fsanitize-coverage=trace-pc-guard')
remove_if_exists(args, '-fsanitize-coverage=bb,trace-pc-guard')
break
sys.exit(subprocess.check_call(args))
# Copyright 2018 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'v8_code': 1,
# Enable support for Intel VTune. Supported on ia32/x64 only
'v8_enable_vtunejit%': 0,
'v8_enable_i18n_support%': 1,
},
'includes': ['toolchain.gypi', 'features.gypi'],
'targets': [
{
'target_name': 'd8',
'type': 'executable',
'dependencies': [
'v8.gyp:v8',
'v8.gyp:v8_libbase',
'v8.gyp:v8_libplatform',
],
# Generated source files need this explicitly:
'include_dirs+': [
'..',
'<(DEPTH)',
],
'sources': [
'../src/d8.h',
'../src/d8.cc',
'../src/d8-console.h',
'../src/d8-console.cc',
'<(SHARED_INTERMEDIATE_DIR)/d8-js.cc',
],
'conditions': [
[ 'want_separate_host_toolset==1', {
'toolsets': [ 'target', ],
'dependencies': [
'd8_js2c#host',
],
}, {
'dependencies': [
'd8_js2c',
],
}],
['(OS=="linux" or OS=="mac" or OS=="freebsd" or OS=="netbsd" \
or OS=="openbsd" or OS=="solaris" or OS=="android" \
or OS=="qnx" or OS=="aix")', {
'sources': [ '../src/d8-posix.cc', ]
}],
[ 'OS=="win"', {
'sources': [ '../src/d8-windows.cc', ]
}],
[ 'component!="shared_library"', {
'conditions': [
[ 'v8_postmortem_support=="true"', {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-Wl,-force_load,<(PRODUCT_DIR)/libv8_base.a'
],
},
}],
],
}],
['v8_enable_vtunejit==1', {
'dependencies': [
'v8vtune.gyp:v8_vtune',
],
}],
['v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icui18n',
'<(icu_gyp_path):icuuc',
],
}],
['OS=="win" and v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icudata',
],
}],
],
},
{
'target_name': 'd8_js2c',
'type': 'none',
'variables': {
'js_files': [
'../src/d8.js',
'../src/js/macros.py',
],
},
'conditions': [
[ 'want_separate_host_toolset==1', {
'toolsets': ['host'],
}, {
'toolsets': ['target'],
}]
],
'actions': [
{
'action_name': 'd8_js2c',
'inputs': [
'../tools/js2c.py',
'<@(js_files)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/d8-js.cc',
],
'action': [
'python',
'../tools/js2c.py',
'<@(_outputs)',
'D8',
'<@(js_files)'
],
},
],
},
],
}
# Copyright 2013 the V8 project authors. All rights reserved.
# 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.
# Compile time controlled V8 features.
{
'variables': {
'variables': {
'v8_target_arch%': '<(target_arch)',
},
# Allows the embedder to add a custom suffix to the version string.
'v8_embedder_string%': '',
'v8_enable_disassembler%': 0,
'v8_promise_internal_field_count%': 0,
'v8_enable_gdbjit%': 0,
'v8_enable_verify_csa%': 0,
'v8_object_print%': 0,
'v8_enable_verify_heap%': 0,
'v8_trace_maps%': 0,
# Enable the snapshot feature, for fast context creation.
# http://v8project.blogspot.com/2015/09/custom-startup-snapshots.html
'v8_use_snapshot%': 'true',
'v8_enable_verify_predictable%': 0,
# With post mortem support enabled, metadata is embedded into libv8 that
# describes various parameters of the VM for use by debuggers. See
# tools/gen-postmortem-metadata.py for details.
'v8_postmortem_support%': 'false',
# Interpreted regexp engine exists as platform-independent alternative
# based where the regular expression is compiled to a bytecode.
'v8_interpreted_regexp%': 0,
# Enable ECMAScript Internationalization API. Enabling this feature will
# add a dependency on the ICU library.
'v8_enable_i18n_support%': 1,
# Enable compiler warnings when using V8_DEPRECATED apis.
'v8_deprecation_warnings%': 0,
# Enable compiler warnings when using V8_DEPRECATE_SOON apis.
'v8_imminent_deprecation_warnings%': 0,
# Set to 1 to enable DCHECKs in release builds.
'dcheck_always_on%': 0,
# Enable/disable JavaScript API accessors.
'v8_js_accessors%': 0,
# Temporary flag to allow embedders to update their microtasks scopes.
'v8_check_microtasks_scopes_consistency%': 'false',
# Enable concurrent marking.
'v8_enable_concurrent_marking%': 1,
# Enables various testing features.
'v8_enable_test_features%': 0,
# Controls the threshold for on-heap/off-heap Typed Arrays.
'v8_typed_array_max_size_in_heap%': 64,
},
'target_defaults': {
'conditions': [
['v8_embedder_string!=""', {
'defines': ['V8_EMBEDDER_STRING="<(v8_embedder_string)"',],
}],
['v8_enable_disassembler==1', {
'defines': ['ENABLE_DISASSEMBLER',],
}],
['v8_promise_internal_field_count!=0', {
'defines': ['V8_PROMISE_INTERNAL_FIELD_COUNT','v8_promise_internal_field_count'],
}],
['v8_enable_gdbjit==1', {
'defines': ['ENABLE_GDB_JIT_INTERFACE',],
}],
['v8_enable_verify_csa==1', {
'defines': ['ENABLE_VERIFY_CSA',],
}],
['v8_object_print==1', {
'defines': ['OBJECT_PRINT',],
}],
['v8_enable_verify_heap==1', {
'defines': ['VERIFY_HEAP',],
}],
['v8_trace_maps==1', {
'defines': ['V8_TRACE_MAPS',],
}],
['v8_enable_test_features==1', {
'defines': ['V8_ENABLE_ALLOCATION_TIMEOUT', 'V8_ENABLE_FORCE_SLOW_PATH'],
}],
['v8_enable_verify_predictable==1', {
'defines': ['VERIFY_PREDICTABLE',],
}],
['v8_interpreted_regexp==1', {
'defines': ['V8_INTERPRETED_REGEXP',],
}],
['v8_deprecation_warnings==1', {
'defines': ['V8_DEPRECATION_WARNINGS',],
}],
['v8_imminent_deprecation_warnings==1', {
'defines': ['V8_IMMINENT_DEPRECATION_WARNINGS',],
}],
['v8_enable_i18n_support==1', {
'defines': ['V8_INTL_SUPPORT',],
}],
['v8_use_snapshot=="true" and v8_use_external_startup_data==1', {
'defines': ['V8_USE_EXTERNAL_STARTUP_DATA',],
}],
['dcheck_always_on!=0', {
'defines': ['DEBUG',],
}],
['v8_check_microtasks_scopes_consistency=="true"', {
'defines': ['V8_CHECK_MICROTASKS_SCOPES_CONSISTENCY',],
}],
['v8_enable_concurrent_marking==1', {
'defines': ['V8_CONCURRENT_MARKING',],
}],
], # conditions
'configurations': {
'DebugBaseCommon': {
'abstract': 1,
'variables': {
'v8_enable_handle_zapping%': 1,
},
'conditions': [
['v8_enable_handle_zapping==1', {
'defines': ['ENABLE_HANDLE_ZAPPING',],
}],
],
}, # Debug
'Release': {
'variables': {
'v8_enable_handle_zapping%': 1,
},
'conditions': [
['v8_enable_handle_zapping==1', {
'defines': ['ENABLE_HANDLE_ZAPPING',],
}],
], # conditions
}, # Release
}, # configurations
'defines': [
'V8_GYP_BUILD',
'V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=<(v8_typed_array_max_size_in_heap)',
], # defines
}, # target_defaults
}
This diff is collapsed.
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'gmock',
'type': 'static_library',
'dependencies': [
'gtest.gyp:gtest',
],
'sources': [
# Sources based on files in r173 of gmock.
'../testing/gmock/include/gmock/gmock-actions.h',
'../testing/gmock/include/gmock/gmock-cardinalities.h',
'../testing/gmock/include/gmock/gmock-generated-actions.h',
'../testing/gmock/include/gmock/gmock-generated-function-mockers.h',
'../testing/gmock/include/gmock/gmock-generated-matchers.h',
'../testing/gmock/include/gmock/gmock-generated-nice-strict.h',
'../testing/gmock/include/gmock/gmock-matchers.h',
'../testing/gmock/include/gmock/gmock-spec-builders.h',
'../testing/gmock/include/gmock/gmock.h',
'../testing/gmock/include/gmock/internal/gmock-generated-internal-utils.h',
'../testing/gmock/include/gmock/internal/gmock-internal-utils.h',
'../testing/gmock/include/gmock/internal/gmock-port.h',
'../testing/gmock/src/gmock-all.cc',
'../testing/gmock/src/gmock-cardinalities.cc',
'../testing/gmock/src/gmock-internal-utils.cc',
'../testing/gmock/src/gmock-matchers.cc',
'../testing/gmock/src/gmock-spec-builders.cc',
'../testing/gmock/src/gmock.cc',
'../testing/gmock-support.h', # gMock helpers
'../testing/gmock_custom/gmock/internal/custom/gmock-port.h',
],
'sources!': [
'../testing/gmock/src/gmock-all.cc', # Not needed by our build.
],
'include_dirs': [
'../testing/gmock_custom',
'../testing/gmock',
'../testing/gmock/include',
],
'all_dependent_settings': {
'include_dirs': [
'../testing/gmock_custom',
'../testing/gmock/include', # So that gmock headers can find themselves.
],
},
'export_dependent_settings': [
'gtest.gyp:gtest',
],
'conditions': [
['want_separate_host_toolset==1', {
'toolsets': ['host', 'target'],
}, {
'toolsets': ['target'],
}],
],
},
{
'target_name': 'gmock_main',
'type': 'static_library',
'dependencies': [
'gmock',
],
'sources': [
'../testing/gmock/src/gmock_main.cc',
],
},
],
}
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'gtest',
'toolsets': ['host', 'target'],
'type': 'static_library',
'sources': [
'../testing/gtest/include/gtest/gtest-death-test.h',
'../testing/gtest/include/gtest/gtest-message.h',
'../testing/gtest/include/gtest/gtest-param-test.h',
'../testing/gtest/include/gtest/gtest-printers.h',
'../testing/gtest/include/gtest/gtest-spi.h',
'../testing/gtest/include/gtest/gtest-test-part.h',
'../testing/gtest/include/gtest/gtest-typed-test.h',
'../testing/gtest/include/gtest/gtest.h',
'../testing/gtest/include/gtest/gtest_pred_impl.h',
'../testing/gtest/include/gtest/internal/gtest-death-test-internal.h',
'../testing/gtest/include/gtest/internal/gtest-filepath.h',
'../testing/gtest/include/gtest/internal/gtest-internal.h',
'../testing/gtest/include/gtest/internal/gtest-linked_ptr.h',
'../testing/gtest/include/gtest/internal/gtest-param-util-generated.h',
'../testing/gtest/include/gtest/internal/gtest-param-util.h',
'../testing/gtest/include/gtest/internal/gtest-port.h',
'../testing/gtest/include/gtest/internal/gtest-string.h',
'../testing/gtest/include/gtest/internal/gtest-tuple.h',
'../testing/gtest/include/gtest/internal/gtest-type-util.h',
'../testing/gtest/src/gtest-all.cc',
'../testing/gtest/src/gtest-death-test.cc',
'../testing/gtest/src/gtest-filepath.cc',
'../testing/gtest/src/gtest-internal-inl.h',
'../testing/gtest/src/gtest-port.cc',
'../testing/gtest/src/gtest-printers.cc',
'../testing/gtest/src/gtest-test-part.cc',
'../testing/gtest/src/gtest-typed-test.cc',
'../testing/gtest/src/gtest.cc',
'../testing/gtest-support.h',
],
'sources!': [
'../testing/gtest/src/gtest-all.cc', # Not needed by our build.
],
'include_dirs': [
'../testing/gtest',
'../testing/gtest/include',
],
'dependencies': [
'gtest_prod',
],
'defines': [
# In order to allow regex matches in gtest to be shared between Windows
# and other systems, we tell gtest to always use it's internal engine.
'GTEST_HAS_POSIX_RE=0',
'GTEST_LANG_CXX11=1',
],
'all_dependent_settings': {
'defines': [
'GTEST_HAS_POSIX_RE=0',
'GTEST_LANG_CXX11=1',
],
},
'conditions': [
['OS=="android"', {
'defines': [
'GTEST_HAS_CLONE=0',
],
'direct_dependent_settings': {
'defines': [
'GTEST_HAS_CLONE=0',
],
},
}],
],
'direct_dependent_settings': {
'defines': [
'UNIT_TEST',
],
'include_dirs': [
'../testing/gtest/include', # So that gtest headers can find themselves.
],
'target_conditions': [
['_type=="executable"', {
'test': 1,
'conditions': [
['OS=="mac"', {
'run_as': {
'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'],
},
}],
['OS=="win"', {
'run_as': {
'action????': ['$(TargetPath)', '--gtest_print_time'],
},
}],
],
}],
],
'msvs_disabled_warnings': [4800],
},
},
{
'target_name': 'gtest_main',
'type': 'static_library',
'dependencies': [
'gtest',
],
'sources': [
'../testing/gtest/src/gtest_main.cc',
],
},
{
'target_name': 'gtest_prod',
'toolsets': ['host', 'target'],
'type': 'none',
'sources': [
'../testing/gtest/include/gtest/gtest_prod.h',
],
},
],
}
# Copyright 2015 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Sets up various automatic gyp environment variables. These are used by
gyp_v8 and landmines.py which run at different stages of runhooks. To
make sure settings are consistent between them, all setup should happen here.
"""
import os
import sys
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
V8_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir))
def apply_gyp_environment(file_path=None):
"""
Reads in a *.gyp_env file and applies the valid keys to os.environ.
"""
if not file_path or not os.path.exists(file_path):
return
file_contents = open(file_path).read()
try:
file_data = eval(file_contents, {'__builtins__': None}, None)
except SyntaxError, e:
e.filename = os.path.abspath(file_path)
raise
supported_vars = ( 'V8_GYP_FILE',
'V8_GYP_SYNTAX_CHECK',
'GYP_DEFINES',
'GYP_GENERATORS',
'GYP_GENERATOR_FLAGS',
'GYP_GENERATOR_OUTPUT', )
for var in supported_vars:
val = file_data.get(var)
if val:
if var in os.environ:
print 'INFO: Environment value for "%s" overrides value in %s.' % (
var, os.path.abspath(file_path)
)
else:
os.environ[var] = val
def set_environment():
"""Sets defaults for GYP_* variables."""
if 'SKIP_V8_GYP_ENV' not in os.environ:
# Update the environment based on v8.gyp_env
gyp_env_path = os.path.join(os.path.dirname(V8_ROOT), 'v8.gyp_env')
apply_gyp_environment(gyp_env_path)
if not os.environ.get('GYP_GENERATORS'):
# Default to ninja on all platforms.
os.environ['GYP_GENERATORS'] = 'ninja'
#!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. All rights reserved.
# 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.
# This script is wrapper for V8 that adds some support for how GYP
# is invoked by V8 beyond what can be done in the gclient hooks.
import argparse
import glob
import gyp_environment
import os
import platform
import shlex
import subprocess
import sys
script_dir = os.path.dirname(os.path.realpath(__file__))
v8_root = os.path.abspath(os.path.join(script_dir, os.pardir))
sys.path.insert(0, os.path.join(v8_root, 'tools', 'gyp', 'pylib'))
import gyp
# Add paths so that pymod_do_main(...) can import files.
sys.path.insert(
1, os.path.abspath(os.path.join(v8_root, 'tools', 'generate_shim_headers')))
sys.path.append(
os.path.abspath(os.path.join(v8_root, 'third_party', 'binutils')))
def GetOutputDirectory():
"""Returns the output directory that GYP will use."""
# Handle command line generator flags.
parser = argparse.ArgumentParser()
parser.add_argument('-G', dest='genflags', default=[], action='append')
genflags = parser.parse_known_args()[0].genflags
# Handle generator flags from the environment.
genflags += shlex.split(os.environ.get('GYP_GENERATOR_FLAGS', ''))
needle = 'output_dir='
for item in genflags:
if item.startswith(needle):
return item[len(needle):]
return 'out'
def additional_include_files(args=[]):
"""
Returns a list of additional (.gypi) files to include, without
duplicating ones that are already specified on the command line.
"""
# Determine the include files specified on the command line.
# This doesn't cover all the different option formats you can use,
# but it's mainly intended to avoid duplicating flags on the automatic
# makefile regeneration which only uses this format.
specified_includes = set()
for arg in args:
if arg.startswith('-I') and len(arg) > 2:
specified_includes.add(os.path.realpath(arg[2:]))
result = []
def AddInclude(path):
if os.path.realpath(path) not in specified_includes:
result.append(path)
# Always include standalone.gypi
AddInclude(os.path.join(v8_root, 'gypfiles', 'standalone.gypi'))
# Optionally add supplemental .gypi files if present.
supplements = glob.glob(os.path.join(v8_root, '*', 'supplement.gypi'))
for supplement in supplements:
AddInclude(supplement)
return result
def run_gyp(args):
if gyp.main(args) != 0:
print 'Error running GYP'
sys.exit(rc)
if __name__ == '__main__':
args = sys.argv[1:]
gyp_chromium_no_action = os.environ.get('GYP_CHROMIUM_NO_ACTION')
if gyp_chromium_no_action == '1':
print 'Skipping gyp_v8 due to GYP_CHROMIUM_NO_ACTION env var.'
sys.exit(0)
running_as_hook = '--running-as-hook'
if running_as_hook in args and gyp_chromium_no_action != '0':
print 'GYP is now disabled by default in runhooks.\n'
print 'If you really want to run this, either run '
print '`python gypfiles/gyp_v8` explicitly by hand '
print 'or set the environment variable GYP_CHROMIUM_NO_ACTION=0.'
sys.exit(0)
if running_as_hook in args:
args.remove(running_as_hook)
gyp_environment.set_environment()
# This could give false positives since it doesn't actually do real option
# parsing. Oh well.
gyp_file_specified = False
for arg in args:
if arg.endswith('.gyp'):
gyp_file_specified = True
break
# If we didn't get a file, check an env var, and then fall back to
# assuming 'all.gyp' from the same directory as the script.
if not gyp_file_specified:
gyp_file = os.environ.get('V8_GYP_FILE')
if gyp_file:
# Note that V8_GYP_FILE values can't have backslashes as
# path separators even on Windows due to the use of shlex.split().
args.extend(shlex.split(gyp_file))
else:
args.append(os.path.join(script_dir, 'all.gyp'))
args.extend(['-I' + i for i in additional_include_files(args)])
# There shouldn't be a circular dependency relationship between .gyp files
args.append('--no-circular-check')
# Set the GYP DEPTH variable to the root of the V8 project.
args.append('--depth=' + os.path.relpath(v8_root))
# If V8_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check
# to enfore syntax checking.
syntax_check = os.environ.get('V8_GYP_SYNTAX_CHECK')
if syntax_check and int(syntax_check):
args.append('--check')
print 'Updating projects from gyp files...'
sys.stdout.flush()
# Generate for the architectures supported on the given platform.
gyp_args = list(args)
gyp_args.extend(['-D', 'gyp_output_dir=' + GetOutputDirectory()])
gyp_generators = os.environ.get('GYP_GENERATORS', '')
if platform.system() == 'Linux' and gyp_generators != 'ninja':
# Work around for crbug.com/331475.
for f in glob.glob(os.path.join(v8_root, 'out', 'Makefile.*')):
os.unlink(f)
# --generator-output defines where the Makefile goes.
gyp_args.append('--generator-output=out')
# -Goutput_dir defines where the build output goes, relative to the
# Makefile. Set it to . so that the build output doesn't end up in out/out.
gyp_args.append('-Goutput_dir=.')
gyp_defines = os.environ.get('GYP_DEFINES', '')
# Automatically turn on crosscompile support for platforms that need it.
if all(('ninja' in gyp_generators,
'OS=android' in gyp_defines,
'GYP_CROSSCOMPILE' not in os.environ)):
os.environ['GYP_CROSSCOMPILE'] = '1'
run_gyp(gyp_args)
# Copyright 2013 the V8 project authors. All rights reserved.
# 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.
# This file is (possibly, depending on python version) imported by
# gyp_v8 when GYP_PARALLEL=1 and it creates sub-processes through the
# multiprocessing library.
# Importing in Python 2.6 (fixed in 2.7) on Windows doesn't search for imports
# that don't end in .py (and aren't directories with an __init__.py). This
# wrapper makes "import gyp_v8" work with those old versions and makes it
# possible to execute gyp_v8.py directly on Windows where the extension is
# useful.
import os
path = os.path.abspath(os.path.split(__file__)[0])
execfile(os.path.join(path, 'gyp_v8'))
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'v8_code': 1,
},
'includes': ['toolchain.gypi', 'features.gypi'],
'targets': [
{
'target_name': 'inspector-test',
'type': 'executable',
'dependencies': [
'v8.gyp:v8_libplatform',
'v8.gyp:v8_libbase',
'v8.gyp:v8',
],
'include_dirs': [
'..',
],
'sources': [
'../test/inspector/inspector-test.cc',
'../test/inspector/isolate-data.cc',
'../test/inspector/isolate-data.h',
'../test/inspector/task-runner.cc',
'../test/inspector/task-runner.h',
],
'conditions': [
['v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icui18n',
'<(icu_gyp_path):icuuc',
],
}],
],
},
],
}
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'protocol_path': '../third_party/inspector_protocol',
'inspector_path': '../src/inspector',
},
'includes': [
'inspector.gypi',
'../third_party/inspector_protocol/inspector_protocol.gypi',
],
'targets': [
{ 'target_name': 'inspector_injected_script',
'type': 'none',
'toolsets': ['target'],
'actions': [
{
'action_name': 'convert_js_to_cpp_char_array',
'inputs': [
'<(inspector_path)/build/xxd.py',
'<(inspector_injected_script_source)',
],
'outputs': [
'<(inspector_generated_injected_script)',
],
'action': [
'python',
'<(inspector_path)/build/xxd.py',
'InjectedScriptSource_js',
'<(inspector_path)/injected-script-source.js',
'<@(_outputs)'
],
},
],
# Since this target generates header files, it needs to be a hard dependency.
'hard_dependency': 1,
},
{ 'target_name': 'protocol_compatibility',
'type': 'none',
'toolsets': ['target'],
'actions': [
{
'action_name': 'protocol_compatibility',
'inputs': [
'<(inspector_path)/js_protocol.json',
],
'outputs': [
'<@(SHARED_INTERMEDIATE_DIR)/src/js_protocol.stamp',
],
'action': [
'python',
'<(protocol_path)/CheckProtocolCompatibility.py',
'--stamp', '<@(_outputs)',
'<(inspector_path)/js_protocol.json',
],
'message': 'Generating inspector protocol sources from protocol json definition',
},
]
},
{ 'target_name': 'protocol_generated_sources',
'type': 'none',
'dependencies': [ 'protocol_compatibility' ],
'toolsets': ['target'],
'actions': [
{
'action_name': 'protocol_generated_sources',
'inputs': [
'<(inspector_path)/js_protocol.json',
'<(inspector_path)/inspector_protocol_config.json',
'<@(inspector_protocol_files)',
],
'outputs': [
'<@(inspector_generated_sources)',
],
'action': [
'python',
'<(protocol_path)/CodeGenerator.py',
'--jinja_dir', '../third_party',
'--output_base', '<(SHARED_INTERMEDIATE_DIR)/src/inspector',
'--config', '<(inspector_path)/inspector_protocol_config.json',
],
'message': 'Generating inspector protocol sources from protocol json',
},
]
},
],
}
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'inspector_generated_sources': [
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Forward.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Protocol.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Protocol.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Console.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Console.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Debugger.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Debugger.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/HeapProfiler.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/HeapProfiler.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Profiler.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Profiler.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Runtime.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Runtime.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Schema.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Schema.h',
'<(SHARED_INTERMEDIATE_DIR)/include/inspector/Debugger.h',
'<(SHARED_INTERMEDIATE_DIR)/include/inspector/Runtime.h',
'<(SHARED_INTERMEDIATE_DIR)/include/inspector/Schema.h',
],
'inspector_injected_script_source': '../src/inspector/injected-script-source.js',
'inspector_generated_injected_script': '<(SHARED_INTERMEDIATE_DIR)/src/inspector/injected-script-source.h',
'inspector_all_sources': [
'<@(inspector_generated_sources)',
'<(inspector_generated_injected_script)',
'../include/v8-inspector.h',
'../include/v8-inspector-protocol.h',
'../src/inspector/injected-script.cc',
'../src/inspector/injected-script.h',
'../src/inspector/inspected-context.cc',
'../src/inspector/inspected-context.h',
'../src/inspector/remote-object-id.cc',
'../src/inspector/remote-object-id.h',
'../src/inspector/search-util.cc',
'../src/inspector/search-util.h',
'../src/inspector/string-16.cc',
'../src/inspector/string-16.h',
'../src/inspector/string-util.cc',
'../src/inspector/string-util.h',
'../src/inspector/test-interface.cc',
'../src/inspector/test-interface.h',
'../src/inspector/v8-console.cc',
'../src/inspector/v8-console.h',
'../src/inspector/v8-console-agent-impl.cc',
'../src/inspector/v8-console-agent-impl.h',
'../src/inspector/v8-console-message.cc',
'../src/inspector/v8-console-message.h',
'../src/inspector/v8-debugger.cc',
'../src/inspector/v8-debugger.h',
'../src/inspector/v8-debugger-agent-impl.cc',
'../src/inspector/v8-debugger-agent-impl.h',
'../src/inspector/v8-debugger-script.cc',
'../src/inspector/v8-debugger-script.h',
'../src/inspector/v8-function-call.cc',
'../src/inspector/v8-function-call.h',
'../src/inspector/v8-heap-profiler-agent-impl.cc',
'../src/inspector/v8-heap-profiler-agent-impl.h',
'../src/inspector/v8-injected-script-host.cc',
'../src/inspector/v8-injected-script-host.h',
'../src/inspector/v8-inspector-impl.cc',
'../src/inspector/v8-inspector-impl.h',
'../src/inspector/v8-inspector-session-impl.cc',
'../src/inspector/v8-inspector-session-impl.h',
'../src/inspector/v8-internal-value-type.cc',
'../src/inspector/v8-internal-value-type.h',
'../src/inspector/v8-profiler-agent-impl.cc',
'../src/inspector/v8-profiler-agent-impl.h',
'../src/inspector/v8-regex.cc',
'../src/inspector/v8-regex.h',
'../src/inspector/v8-runtime-agent-impl.cc',
'../src/inspector/v8-runtime-agent-impl.h',
'../src/inspector/v8-schema-agent-impl.cc',
'../src/inspector/v8-schema-agent-impl.h',
'../src/inspector/v8-stack-trace-impl.cc',
'../src/inspector/v8-stack-trace-impl.h',
'../src/inspector/v8-value-utils.cc',
'../src/inspector/v8-value-utils.h',
'../src/inspector/wasm-translation.cc',
'../src/inspector/wasm-translation.h',
]
}
}
# Copyright 2015 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'asan_dynamic_runtime',
'toolsets': ['target', 'host'],
'type': 'none',
'variables': {
# Every target is going to depend on asan_dynamic_runtime, so allow
# this one to depend on itself.
'prune_self_dependency': 1,
# Path is relative to this GYP file.
'asan_rtl_mask_path':
'../../third_party/llvm-build/Release+Asserts/lib/clang/*/lib/darwin',
'asan_osx_dynamic':
'<(asan_rtl_mask_path)/libclang_rt.asan_osx_dynamic.dylib',
},
'copies': [
{
'destination': '<(PRODUCT_DIR)',
'files': [
'<!(/bin/ls <(asan_osx_dynamic))',
],
},
],
},
],
}
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'v8_code': 1,
},
'includes': ['toolchain.gypi', 'features.gypi'],
'targets': [
{
'target_name': 'mkgrokdump',
'type': 'executable',
'dependencies': [
'v8.gyp:v8',
'v8.gyp:v8_libbase',
'v8.gyp:v8_libplatform',
],
'include_dirs': [
'..',
],
'sources': [
'../test/mkgrokdump/mkgrokdump.cc',
],
},
],
}
# Copyright 2013 the V8 project authors. All rights reserved.
# 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.
{
'variables': {
'v8_code': 1,
'v8_enable_i18n_support%': 1,
},
'includes': ['toolchain.gypi', 'features.gypi'],
'targets': [
{
'target_name': 'parser-shell',
'type': 'executable',
'dependencies': [
'v8.gyp:v8',
'v8.gyp:v8_libbase',
'v8.gyp:v8_libplatform',
],
'conditions': [
['v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icui18n',
'<(icu_gyp_path):icuuc',
],
}],
],
'include_dirs+': [
'..',
],
'sources': [
'../tools/parser-shell.cc',
'../tools/shell-utils.h',
],
},
],
}
#!/usr/bin/env python
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Legacy test-runner wrapper supporting a product of multiple architectures and
modes.
"""
import argparse
import itertools
from os.path import abspath, dirname, join
import subprocess
import sys
BASE_DIR = dirname(dirname(abspath(__file__)))
RUN_TESTS = join(BASE_DIR, 'tools', 'run-tests.py')
def main():
parser = argparse.ArgumentParser(description='Legacy test-runner wrapper')
parser.add_argument(
'--arch', help='Comma-separated architectures to run tests on')
parser.add_argument(
'--mode', help='Comma-separated modes to run tests on')
parser.add_argument(
'--arch-and-mode',
help='Architecture and mode in the format \'arch.mode\'',
)
args, remaining_args = parser.parse_known_args(sys.argv)
if (args.arch or args.mode) and args.arch_and_mode:
parser.error('The flags --arch-and-mode and --arch/--mode are exclusive.')
arch = (args.arch or 'ia32,x64,arm').split(',')
mode = (args.mode or 'release,debug').split(',')
if args.arch_and_mode:
arch_and_mode = map(
lambda am: am.split('.'),
args.arch_and_mode.split(','))
arch = map(lambda am: am[0], arch_and_mode)
mode = map(lambda am: am[1], arch_and_mode)
ret_code = 0
for a, m in itertools.product(arch, mode):
ret_code |= subprocess.check_call(
[RUN_TESTS] + remaining_args[1:] + ['--arch', a, '--mode', m])
return ret_code
if __name__ == '__main__':
sys.exit(main())
# Copyright 2012 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'v8_code': 1,
'v8_enable_i18n_support%': 1,
'v8_toolset_for_shell%': 'target',
},
'includes': ['toolchain.gypi', 'features.gypi'],
'target_defaults': {
'type': 'executable',
'dependencies': [
'v8.gyp:v8',
'v8.gyp:v8_libbase',
'v8.gyp:v8_libplatform',
],
'include_dirs': [
'..',
],
'conditions': [
['v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icui18n',
'<(icu_gyp_path):icuuc',
],
}],
['OS=="win" and v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icudata',
],
}],
],
},
'targets': [
{
'target_name': 'v8_shell',
'sources': [
'../samples/shell.cc',
],
'conditions': [
[ 'want_separate_host_toolset==1', {
'toolsets': [ '<(v8_toolset_for_shell)', ],
}],
],
},
{
'target_name': 'hello-world',
'sources': [
'../samples/hello-world.cc',
],
},
{
'target_name': 'process',
'sources': [
'../samples/process.cc',
],
},
],
}
# Copyright 2016 the V8 project authors. All rights reserved.
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included to set clang-specific compiler flags.
# To use this the following variable can be defined:
# clang_warning_flags: list: Compiler flags to pass to clang.
# clang_warning_flags_unset: list: Compiler flags to not pass to clang.
#
# Only use this in third-party code. In chromium_code, fix your code to not
# warn instead!
#
# Note that the gypi file is included in target_defaults, so it does not need
# to be explicitly included.
#
# Warning flags set by this will be used on all platforms. If you want to set
# warning flags on only some platforms, you have to do so manually.
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'my_target',
# 'variables': {
# 'clang_warning_flags': ['-Wno-awesome-warning'],
# 'clang_warning_flags_unset': ['-Wpreviously-set-flag'],
# }
# }
{
'variables': {
'clang_warning_flags_unset%': [], # Provide a default value.
},
'conditions': [
['clang==1', {
# This uses >@ instead of @< to also see clang_warning_flags set in
# targets directly, not just the clang_warning_flags in target_defaults.
'cflags': [ '>@(clang_warning_flags)' ],
'cflags!': [ '>@(clang_warning_flags_unset)' ],
'xcode_settings': {
'WARNING_CFLAGS': ['>@(clang_warning_flags)'],
'WARNING_CFLAGS!': ['>@(clang_warning_flags_unset)'],
},
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [ '>@(clang_warning_flags)' ],
'AdditionalOptions!': [ '>@(clang_warning_flags_unset)' ],
},
},
}],
['clang==0 and host_clang==1', {
'target_conditions': [
['_toolset=="host"', {
'cflags': [ '>@(clang_warning_flags)' ],
'cflags!': [ '>@(clang_warning_flags_unset)' ],
}],
],
}],
],
}
# Copyright 2013 the V8 project authors. All rights reserved.
# 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.
# This file is meant to be included into a target to handle shim headers
# in a consistent manner. To use this the following variables need to be
# defined:
# headers_root_path: string: path to directory containing headers
# header_filenames: list: list of header file names
{
'variables': {
'shim_headers_path': '<(SHARED_INTERMEDIATE_DIR)/shim_headers/<(_target_name)/<(_toolset)',
'shim_generator_additional_args%': [],
},
'include_dirs++': [
'<(shim_headers_path)',
],
'all_dependent_settings': {
'include_dirs+++': [
'<(shim_headers_path)',
],
},
'actions': [
{
'variables': {
'generator_path': '<(DEPTH)/tools/generate_shim_headers/generate_shim_headers.py',
'generator_args': [
'--headers-root', '<(headers_root_path)',
'--output-directory', '<(shim_headers_path)',
'<@(shim_generator_additional_args)',
'<@(header_filenames)',
],
},
'action_name': 'generate_<(_target_name)_shim_headers',
'inputs': [
'<(generator_path)',
],
'outputs': [
'<!@pymod_do_main(generate_shim_headers <@(generator_args) --outputs)',
],
'action': ['python',
'<(generator_path)',
'<@(generator_args)',
'--generate',
],
'message': 'Generating <(_target_name) shim headers.',
},
],
}
This diff is collapsed.
#!/bin/sh
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This is for backwards-compatibility after:
# https://codereview.chromium.org/2900193003
for entry in $@; do
echo -L$entry
echo -Wl,-rpath-link=$entry
done | xargs echo
This diff is collapsed.
This diff is collapsed.
# Copyright 2012 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'v8_code': 1,
},
'includes': ['toolchain.gypi', 'features.gypi'],
'targets': [
{
'target_name': 'v8_vtune',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8',
],
'sources': [
'../src/third_party/vtune/ittnotify_config.h',
'../src/third_party/vtune/ittnotify_types.h',
'../src/third_party/vtune/jitprofiling.cc',
'../src/third_party/vtune/jitprofiling.h',
'../src/third_party/vtune/v8-vtune.h',
'../src/third_party/vtune/vtune-jit.cc',
'../src/third_party/vtune/vtune-jit.h',
],
'direct_dependent_settings': {
'defines': ['ENABLE_VTUNE_JIT_INTERFACE',],
'conditions': [
['OS != "win"', {
'libraries': ['-ldl',],
}],
],
},
},
],
}
#!/usr/bin/env python
# Copyright 2015 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Script to print potentially missing source dependencies based on the actual
.h and .cc files in the source tree and which files are included in the gyp
and gn files. The latter inclusion is overapproximated.
TODO(machenbach): If two source files with the same name exist, but only one
is referenced from a gyp/gn file, we won't necessarily detect it.
"""
import itertools
import re
import os
import subprocess
import sys
V8_BASE = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
GYP_FILES = [
os.path.join(V8_BASE, 'gypfiles', 'd8.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'v8.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'inspector.gypi'),
os.path.join(V8_BASE, 'gypfiles', 'v8vtune.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'samples.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'cctest.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'fuzzer.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'unittests.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'inspector-test.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'mkgrokdump.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'gmock.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'gtest.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'parser-shell.gyp'),
]
ALL_GYP_PREFIXES = [
'..',
'common',
os.path.join('src', 'third_party', 'vtune'),
'src',
'samples',
'testing',
'tools',
os.path.join('test', 'cctest'),
os.path.join('test', 'common'),
os.path.join('test', 'fuzzer'),
os.path.join('test', 'unittests'),
os.path.join('test', 'inspector'),
os.path.join('test', 'mkgrokdump'),
]
GYP_UNSUPPORTED_FEATURES = [
'gcmole',
'setup-isolate-deserialize.cc',
'v8-version.h'
]
GN_FILES = [
os.path.join(V8_BASE, 'BUILD.gn'),
os.path.join(V8_BASE, 'build', 'secondary', 'testing', 'gmock', 'BUILD.gn'),
os.path.join(V8_BASE, 'build', 'secondary', 'testing', 'gtest', 'BUILD.gn'),
os.path.join(V8_BASE, 'src', 'inspector', 'BUILD.gn'),
os.path.join(V8_BASE, 'test', 'cctest', 'BUILD.gn'),
os.path.join(V8_BASE, 'test', 'unittests', 'BUILD.gn'),
os.path.join(V8_BASE, 'test', 'inspector', 'BUILD.gn'),
os.path.join(V8_BASE, 'test', 'mkgrokdump', 'BUILD.gn'),
os.path.join(V8_BASE, 'tools', 'BUILD.gn'),
]
GN_UNSUPPORTED_FEATURES = [
'aix',
'cygwin',
'freebsd',
'gcmole',
'openbsd',
'ppc',
'qnx',
'solaris',
'vtune',
'v8-version.h',
]
ALL_GN_PREFIXES = [
'..',
os.path.join('src', 'inspector'),
'src',
'testing',
os.path.join('test', 'cctest'),
os.path.join('test', 'unittests'),
os.path.join('test', 'inspector'),
os.path.join('test', 'mkgrokdump'),
]
def pathsplit(path):
return re.split('[/\\\\]', path)
def path_no_prefix(path, prefixes):
for prefix in prefixes:
if path.startswith(prefix + os.sep):
return path_no_prefix(path[len(prefix) + 1:], prefixes)
return path
def isources(prefixes):
cmd = ['git', 'ls-tree', '-r', 'HEAD', '--full-name', '--name-only']
for f in subprocess.check_output(cmd, universal_newlines=True).split('\n'):
if not (f.endswith('.h') or f.endswith('.cc')):
continue
yield path_no_prefix(os.path.join(*pathsplit(f)), prefixes)
def iflatten(obj):
if isinstance(obj, dict):
for value in obj.values():
for i in iflatten(value):
yield i
elif isinstance(obj, list):
for value in obj:
for i in iflatten(value):
yield i
elif isinstance(obj, basestring):
yield path_no_prefix(os.path.join(*pathsplit(obj)), ALL_GYP_PREFIXES)
def iflatten_gyp_file(gyp_file):
"""Overaproximates all values in the gyp file.
Iterates over all string values recursively. Removes '../' path prefixes.
"""
with open(gyp_file) as f:
return iflatten(eval(f.read()))
def iflatten_gn_file(gn_file):
"""Overaproximates all values in the gn file.
Iterates over all double quoted strings.
"""
with open(gn_file) as f:
for line in f.read().splitlines():
match = re.match(r'.*"([^"]*)".*', line)
if match:
yield path_no_prefix(
os.path.join(*pathsplit(match.group(1))), ALL_GN_PREFIXES)
def icheck_values(values, prefixes):
for source_file in isources(prefixes):
if source_file not in values:
yield source_file
def missing_gyp_files():
gyp_values = set(itertools.chain(
*[iflatten_gyp_file(gyp_file) for gyp_file in GYP_FILES]
))
gyp_files = sorted(icheck_values(gyp_values, ALL_GYP_PREFIXES))
return filter(
lambda x: not any(i in x for i in GYP_UNSUPPORTED_FEATURES), gyp_files)
def missing_gn_files():
gn_values = set(itertools.chain(
*[iflatten_gn_file(gn_file) for gn_file in GN_FILES]
))
gn_files = sorted(icheck_values(gn_values, ALL_GN_PREFIXES))
return filter(
lambda x: not any(i in x for i in GN_UNSUPPORTED_FEATURES), gn_files)
def main():
print "----------- Files not in gyp: ------------"
for i in missing_gyp_files():
print i
print "\n----------- Files not in gn: -------------"
for i in missing_gn_files():
print i
return 0
if '__main__' == __name__:
sys.exit(main())
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment