Skip to content

Commit

Permalink
[gyp] move gyp files from src to gypfiles.
Browse files Browse the repository at this point in the history
Bug: v8:7341
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I90879be3a94745859b7da7c9bb9b6533af11cc2d
Reviewed-on: https://chromium-review.googlesource.com/878221
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50790}
  • Loading branch information
hashseed authored and Commit Bot committed Jan 23, 2018
1 parent 15605fe commit f9934aa
Show file tree
Hide file tree
Showing 35 changed files with 2,929 additions and 2,993 deletions.
8 changes: 2 additions & 6 deletions Makefile
Expand Up @@ -278,14 +278,10 @@ GYPFILES = third_party/icu/icu.gypi third_party/icu/icu.gyp \
gypfiles/standalone.gypi \
gypfiles/toolchain.gypi gypfiles/all.gyp gypfiles/mac/asan.gyp \
test/cctest/cctest.gyp test/fuzzer/fuzzer.gyp \
test/unittests/unittests.gyp src/v8.gyp \
test/unittests/unittests.gyp gypfiles/v8.gyp \
tools/parser-shell.gyp testing/gmock.gyp testing/gtest.gyp \
samples/samples.gyp src/third_party/vtune/v8vtune.gyp src/d8.gyp
gypfiles/samples.gyp gypfiles/v8vtune.gyp gypfiles/d8.gyp

# If vtunejit=on, the v8vtune.gyp will be appended.
ifeq ($(vtunejit), on)
GYPFILES += src/third_party/vtune/v8vtune.gyp
endif
# Generates all combinations of ARCHES and MODES, e.g. "ia32.release".
BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES)))
ANDROID_BUILDS = $(foreach mode,$(MODES), \
Expand Down
7 changes: 3 additions & 4 deletions PRESUBMIT.py
Expand Up @@ -239,8 +239,8 @@ def _CheckMissingFiles(input_api, output_api):
# eval-ed and thus doesn't have __file__.
original_sys_path = sys.path
try:
sys.path = sys.path + [input_api.os_path.join(
input_api.PresubmitLocalPath(), 'tools')]
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.
Expand All @@ -249,6 +249,7 @@ def _CheckMissingFiles(input_api, output_api):
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"
Expand All @@ -266,8 +267,6 @@ def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
results = []
results.extend(_CheckCommitMessageBugEntry(input_api, output_api))
results.extend(input_api.canned_checks.CheckOwners(
input_api, output_api, source_file_filter=None))
results.extend(input_api.canned_checks.CheckPatchFormatted(
input_api, output_api))
results.extend(input_api.canned_checks.CheckGenderNeutral(
Expand Down
4 changes: 2 additions & 2 deletions gypfiles/all.gyp
Expand Up @@ -8,7 +8,7 @@
'target_name': 'All',
'type': 'none',
'dependencies': [
'../src/d8.gyp:d8',
'../gypfiles/d8.gyp:d8',
'../test/inspector/inspector.gyp:*',
'../test/mkgrokdump/mkgrokdump.gyp:*',
],
Expand All @@ -21,7 +21,7 @@
# These items don't compile for Android on Mac.
['host_os!="mac" or OS!="android"', {
'dependencies': [
'../samples/samples.gyp:*',
'samples.gyp:*',
'../test/cctest/cctest.gyp:*',
'../test/fuzzer/fuzzer.gyp:*',
'../test/unittests/unittests.gyp:*',
Expand Down
53 changes: 15 additions & 38 deletions src/d8.gyp → gypfiles/d8.gyp
@@ -1,29 +1,6 @@
# 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.
# 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': {
Expand All @@ -32,7 +9,7 @@
'v8_enable_vtunejit%': 0,
'v8_enable_i18n_support%': 1,
},
'includes': ['../gypfiles/toolchain.gypi', '../gypfiles/features.gypi'],
'includes': ['toolchain.gypi', 'features.gypi'],
'targets': [
{
'target_name': 'd8',
Expand All @@ -48,10 +25,10 @@
'<(DEPTH)',
],
'sources': [
'd8.h',
'd8.cc',
'd8-console.h',
'd8-console.cc',
'../src/d8.h',
'../src/d8.cc',
'../src/d8-console.h',
'../src/d8-console.cc',
'<(SHARED_INTERMEDIATE_DIR)/d8-js.cc',
],
'conditions': [
Expand All @@ -68,10 +45,10 @@
['(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': [ 'd8-posix.cc', ]
'sources': [ '../src/d8-posix.cc', ]
}],
[ 'OS=="win"', {
'sources': [ 'd8-windows.cc', ]
'sources': [ '../src/d8-windows.cc', ]
}],
[ 'component!="shared_library"', {
'conditions': [
Expand All @@ -86,7 +63,7 @@
}],
['v8_enable_vtunejit==1', {
'dependencies': [
'../src/third_party/vtune/v8vtune.gyp:v8_vtune',
'v8vtune.gyp:v8_vtune',
],
}],
['v8_enable_i18n_support==1', {
Expand All @@ -107,8 +84,8 @@
'type': 'none',
'variables': {
'js_files': [
'd8.js',
'js/macros.py',
'../src/d8.js',
'../src/js/macros.py',
],
},
'conditions': [
Expand Down Expand Up @@ -149,10 +126,10 @@
'd8',
],
'includes': [
'../gypfiles/isolate.gypi',
'isolate.gypi',
],
'sources': [
'd8.isolate',
'../src/d8.isolate',
],
},
],
Expand Down
23 changes: 12 additions & 11 deletions src/inspector/inspector.gyp → gypfiles/inspector.gyp
Expand Up @@ -4,11 +4,12 @@

{
'variables': {
'protocol_path': '../../third_party/inspector_protocol',
'protocol_path': '../third_party/inspector_protocol',
'inspector_path': '../src/inspector',
},
'includes': [
'inspector.gypi',
'<(PRODUCT_DIR)/../../../third_party/inspector_protocol/inspector_protocol.gypi',
'../third_party/inspector_protocol/inspector_protocol.gypi',
],
'targets': [
{ 'target_name': 'inspector_injected_script',
Expand All @@ -18,17 +19,17 @@
{
'action_name': 'convert_js_to_cpp_char_array',
'inputs': [
'build/xxd.py',
'<(inspector_path)/build/xxd.py',
'<(inspector_injected_script_source)',
],
'outputs': [
'<(inspector_generated_injected_script)',
],
'action': [
'python',
'build/xxd.py',
'<(inspector_path)/build/xxd.py',
'InjectedScriptSource_js',
'injected-script-source.js',
'<(inspector_path)/injected-script-source.js',
'<@(_outputs)'
],
},
Expand All @@ -43,7 +44,7 @@
{
'action_name': 'protocol_compatibility',
'inputs': [
'js_protocol.json',
'<(inspector_path)/js_protocol.json',
],
'outputs': [
'<@(SHARED_INTERMEDIATE_DIR)/src/js_protocol.stamp',
Expand All @@ -52,7 +53,7 @@
'python',
'<(protocol_path)/CheckProtocolCompatibility.py',
'--stamp', '<@(_outputs)',
'js_protocol.json',
'<(inspector_path)/js_protocol.json',
],
'message': 'Generating inspector protocol sources from protocol json definition',
},
Expand All @@ -66,8 +67,8 @@
{
'action_name': 'protocol_generated_sources',
'inputs': [
'js_protocol.json',
'inspector_protocol_config.json',
'<(inspector_path)/js_protocol.json',
'<(inspector_path)/inspector_protocol_config.json',
'<@(inspector_protocol_files)',
],
'outputs': [
Expand All @@ -76,9 +77,9 @@
'action': [
'python',
'<(protocol_path)/CodeGenerator.py',
'--jinja_dir', '../../third_party',
'--jinja_dir', '../third_party',
'--output_base', '<(SHARED_INTERMEDIATE_DIR)/src/inspector',
'--config', 'inspector_protocol_config.json',
'--config', '<(inspector_path)/inspector_protocol_config.json',
],
'message': 'Generating inspector protocol sources from protocol json',
},
Expand Down
90 changes: 90 additions & 0 deletions gypfiles/inspector.gypi
@@ -0,0 +1,90 @@
# 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',
]
}
}
61 changes: 61 additions & 0 deletions gypfiles/samples.gyp
@@ -0,0 +1,61 @@
# 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',
],
},
],
}

0 comments on commit f9934aa

Please sign in to comment.