Skip to content

Commit

Permalink
Move //build/module_args/v8.gni to //build_overrides.
Browse files Browse the repository at this point in the history
The original intent of the build/module_args directory was to
provide a place where different repos could customize settings
as needed depending on their dependencies and needs.

However, given that you can't really yet embed GN by just
deps-ing in //build/config and //build/toolchain, you end up
needing to deps-in all of build, and so there was no good way to
have different settings per-repo in //build/module_args.

This CL changes the approach such that we will have an additional
top-level directory called //build_overrides, which is therefore
separate from //build and can be properly customized.

It is unfortunate that we need to use two top-level directories
for GN, but we don't have a good alternative at this time. Once
we can remove the GYP build and further clean up the structure
and dependencies of //build we will hopefully be able to do better.

R=brettw@chromium.org
BUG=541791

Review URL: https://codereview.chromium.org/1397493004

Cr-Commit-Position: refs/heads/master@{#353690}
  • Loading branch information
dpranke authored and Commit bot committed Oct 13, 2015
1 parent db54eaf commit d4da5ab
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 34 deletions.
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import("//build/config/crypto.gni")
import("//build/config/features.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni")
import("//build/module_args/v8.gni")
import("//build_overrides/v8.gni")
import("//media/media_options.gni")

if (is_android) {
Expand Down
2 changes: 1 addition & 1 deletion build/config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import("//build/config/crypto.gni")
import("//build/config/features.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni")
import("//build/module_args/v8.gni")
import("//build_overrides/v8.gni")
import("//build/toolchain/goma.gni")

declare_args() {
Expand Down
18 changes: 3 additions & 15 deletions build/module_args/v8.gni
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

if (is_android) {
import("//build/config/android/config.gni")
}
# TODO(dpranke): Remove this file altogether once v8 has been updated
# to import //build_overrides/v8.gni instead.

# TODO(sky): nuke this. Temporary while sorting out http://crbug.com/465456.
enable_correct_v8_arch = false

v8_use_external_startup_data = !(is_chromeos || is_win || is_ios)

# V8 extras
# Adding V8 extras files requires API owners review
# Be sure to synchronize with build/common.gypi

v8_extra_library_files = []
v8_experimental_extra_library_files =
[ "../third_party/WebKit/Source/core/streams/ByteLengthQueuingStrategy.js" ]
import("//build_overrides/v8.gni")
20 changes: 20 additions & 0 deletions build_overrides/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Build overrides in GN

This directory is used to allow different products to customize settings
for repos that are DEPS'ed in or shared.

For example: V8 could be built on its own (in a "standalone" configuration),
and it could be built as part of Chromium. V8 might define a top-level
target, //v8:d8 (a simple executable), that should only be built in the
standalone configuration. To figure out whether or not it should be
in a standalone configuration, v8 can create a file, build_overrides/v8.gni,
that contains a variable, `build_standalone_d8 = true`.
and import it (as import("//build_overrides/v8.gni") from its top-level
BUILD.gn file.

Chromium, on the other hand, might not need to build d8, and so it would
create its own build_overrides/v8.gni file, and in it set
`build_standalone_d8 = false`.

The two files should define the same set of variables, but the values can
vary as appropriate to the needs of the two different builds.
20 changes: 20 additions & 0 deletions build_overrides/v8.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2015 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.

if (is_android) {
import("//build/config/android/config.gni")
}

# TODO(sky): nuke this. Temporary while sorting out http://crbug.com/465456.
enable_correct_v8_arch = false

v8_use_external_startup_data = !(is_chromeos || is_win || is_ios)

# V8 extras
# Adding V8 extras files requires API owners review
# Be sure to synchronize with build/common.gypi

v8_extra_library_files = []
v8_experimental_extra_library_files =
[ "../third_party/WebKit/Source/core/streams/ByteLengthQueuingStrategy.js" ]
2 changes: 1 addition & 1 deletion chrome/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//build/module_args/v8.gni")
import("//build_overrides/v8.gni")
import("//chrome/version.gni")
import("//testing/test.gni")
import("//third_party/icu/config.gni")
Expand Down
2 changes: 1 addition & 1 deletion chrome/installer/mini_installer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//build/module_args/v8.gni")
import("//build_overrides/v8.gni")
import("//chrome/version.gni")
import("//third_party/icu/config.gni")

Expand Down
2 changes: 1 addition & 1 deletion chrome/test/base/js2gtest.gni
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/module_args/v8.gni")
import("//build_overrides/v8.gni")
import("//v8/snapshot_toolchain.gni")

# Variables:
Expand Down
6 changes: 2 additions & 4 deletions components/html_viewer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/module_args/v8.gni")
import("//build_overrides/v8.gni")
import("//mojo/public/mojo_application.gni")
import("//testing/test.gni")
import("//tools/grit/grit_rule.gni")
Expand Down Expand Up @@ -357,9 +357,7 @@ mojo_native_application("apptests") {
"//third_party/mojo/src/mojo/public/c/system:for_shared_library",
]

data_deps = [
":html_viewer",
]
data_deps = [ ":html_viewer" ]

if (is_linux && !is_android) {
data_deps += [ "//components/font_service" ]
Expand Down
6 changes: 2 additions & 4 deletions content/shell/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//build/module_args/v8.gni")
import("//build_overrides/v8.gni")
import("//third_party/icu/config.gni")

generate_jni("content_shell_jni_headers") {
Expand Down Expand Up @@ -159,9 +159,7 @@ instrumentation_test_apk("content_shell_test_apk") {
"//base:base_javatests",
"//net/android:net_javatests",
]
data_deps = [
":content_shell_apk",
]
data_deps = [ ":content_shell_apk" ]
apk_under_test = ":content_shell_apk"
apk_name = "ContentShellTest"
android_manifest = "javatests/AndroidManifest.xml"
Expand Down
6 changes: 2 additions & 4 deletions content/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import("//build/config/chrome_build.gni")
import("//build/config/crypto.gni")
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//build/module_args/v8.gni")
import("//build_overrides/v8.gni")
import("//media/media_options.gni")
import("//testing/test.gni")
import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
Expand Down Expand Up @@ -579,9 +579,7 @@ test("content_unittests") {
]
}

data_deps = [
"//third_party/mesa:osmesa",
]
data_deps = [ "//third_party/mesa:osmesa" ]

if (!is_win) {
sources += [ "../browser/file_descriptor_info_impl_unittest.cc" ]
Expand Down
2 changes: 1 addition & 1 deletion gin/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/module_args/v8.gni")
import("//build_overrides/v8.gni")
import("//testing/test.gni")

component("gin") {
Expand Down
2 changes: 1 addition & 1 deletion net/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import("//build/config/compiler/compiler.gni")
import("//build/config/crypto.gni")
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//build/module_args/v8.gni")
import("//build_overrides/v8.gni")
import("//testing/test.gni")
import("//third_party/icu/config.gni")
import("//third_party/protobuf/proto_library.gni")
Expand Down

0 comments on commit d4da5ab

Please sign in to comment.