summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorscottmg <scottmg@chromium.org>2014-12-01 16:25:20 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-02 00:25:35 +0000
commitb199254f481c5db36d56e83fce40594b06d2b81f (patch)
tree750cbec5b7f5e15d78cddb158b856012a20f49c5 /build
parentfb49bffb2e0bd0f9a9e0ee5982d6a0ecf5b1dc6f (diff)
downloadchromium_src-b199254f481c5db36d56e83fce40594b06d2b81f.zip
chromium_src-b199254f481c5db36d56e83fce40594b06d2b81f.tar.gz
chromium_src-b199254f481c5db36d56e83fce40594b06d2b81f.tar.bz2
gn format //build
A starting point for doing all of src, and adding a PRESUBMIT. Includes https://codereview.chromium.org/772663002/ and https://codereview.chromium.org/770053002/. I haven't pushed new binaries yet. Generated via: > cd build > git ls-files *.gn *.gni | sed -e "s/^/@..\\\\out\\\\Debug\\\\gn format --in-place /" >x.bat && x.bat The only things that I don't love in the current output are: 1. Turning args = [ "--depfile", rebase_path(depfile, root_build_dir), "--android-sdk-tools", rebased_android_sdk_build_tools, "--dex-path", rebased_output, ] into: args = [ "--depfile", rebase_path(depfile, root_build_dir), "--android-sdk-tools", rebased_android_sdk_build_tools, "--dex-path", rebased_output, ] The heuristic for this isn't trivial though, and it also affects e.g. '-Xclang' in cflags, as well as assignments to temporaries that are later assigned to args. 2. Turning single line if (defined(invoker.inputs)) { inputs = invoker.inputs } into if (defined(invoker.inputs)) { inputs = invoker.inputs } This could be argued to be an improvement, but as it's very boilerplate-y perhaps an exception to allow single line in this case is worthwhile. I think there was discussion of new syntax for this case too, something like "inputs ?= invoker.inputs" maybe. In both cases, I think it's worthwhile to get formatting turned on, and then go back and special case these if we decide it's worthwhile. R=brettw@chromium.org BUG=348474 Review URL: https://codereview.chromium.org/766573003 Cr-Commit-Position: refs/heads/master@{#306305}
Diffstat (limited to 'build')
-rw-r--r--build/android/gyp/test/BUILD.gn4
-rw-r--r--build/compiled_action.gni26
-rw-r--r--build/config/BUILD.gn15
-rw-r--r--build/config/BUILDCONFIG.gn450
-rw-r--r--build/config/allocator.gni2
-rw-r--r--build/config/android/BUILD.gn8
-rw-r--r--build/config/android/config.gni42
-rw-r--r--build/config/android/internal_rules.gni457
-rw-r--r--build/config/android/rules.gni550
-rw-r--r--build/config/arm.gni8
-rw-r--r--build/config/clang/BUILD.gn17
-rw-r--r--build/config/compiler/BUILD.gn141
-rw-r--r--build/config/features.gni6
-rw-r--r--build/config/gcc/BUILD.gn1
-rw-r--r--build/config/gcc/gcc_version.gni14
-rw-r--r--build/config/ios/BUILD.gn5
-rw-r--r--build/config/ios/ios_sdk.gni2
-rw-r--r--build/config/linux/BUILD.gn31
-rw-r--r--build/config/linux/pkg_config.gni14
-rw-r--r--build/config/mac/BUILD.gn11
-rw-r--r--build/config/mac/mac_sdk.gni7
-rw-r--r--build/config/sanitizers/BUILD.gn13
-rw-r--r--build/config/win/BUILD.gn8
-rw-r--r--build/go/rules.gni50
-rw-r--r--build/json_schema_api.gni50
-rw-r--r--build/secondary/testing/BUILD.gn4
-rw-r--r--build/secondary/testing/gmock/BUILD.gn9
-rw-r--r--build/secondary/testing/gtest/BUILD.gn11
-rw-r--r--build/secondary/third_party/android_tools/BUILD.gn27
-rw-r--r--build/secondary/third_party/cacheinvalidation/src/google/cacheinvalidation/BUILD.gn1
-rw-r--r--build/secondary/third_party/freetype/BUILD.gn4
-rw-r--r--build/secondary/third_party/icu/BUILD.gn33
-rw-r--r--build/secondary/third_party/leveldatabase/BUILD.gn3
-rw-r--r--build/secondary/third_party/libjpeg_turbo/BUILD.gn176
-rw-r--r--build/secondary/third_party/libsrtp/BUILD.gn59
-rw-r--r--build/secondary/third_party/nss/BUILD.gn61
-rw-r--r--build/secondary/third_party/openmax_dl/dl/BUILD.gn39
-rw-r--r--build/secondary/third_party/sfntly/BUILD.gn4
-rw-r--r--build/secondary/tools/grit/BUILD.gn6
-rw-r--r--build/secondary/tools/grit/grit_rule.gni203
-rw-r--r--build/toolchain/android/BUILD.gn10
-rw-r--r--build/toolchain/gcc_toolchain.gni47
-rw-r--r--build/toolchain/mac/BUILD.gn71
-rw-r--r--build/toolchain/nacl/BUILD.gn14
-rw-r--r--build/toolchain/win/BUILD.gn75
-rw-r--r--build/toolchain/win/midl.gni23
-rw-r--r--build/util/BUILD.gn9
47 files changed, 1749 insertions, 1072 deletions
diff --git a/build/android/gyp/test/BUILD.gn b/build/android/gyp/test/BUILD.gn
index 6621489..2deac1d 100644
--- a/build/android/gyp/test/BUILD.gn
+++ b/build/android/gyp/test/BUILD.gn
@@ -5,7 +5,9 @@ java_library("hello_world_java") {
}
java_binary("hello_world") {
- deps = [ ":hello_world_java" ]
+ deps = [
+ ":hello_world_java",
+ ]
java_files = [ "java/org/chromium/helloworld/HelloWorldMain.java" ]
main_class = "org.chromium.helloworld.HelloWorldMain"
}
diff --git a/build/compiled_action.gni b/build/compiled_action.gni
index b750af0..e5059aa 100644
--- a/build/compiled_action.gni
+++ b/build/compiled_action.gni
@@ -102,22 +102,23 @@ template("compiled_action") {
# If that's not the case, we'll need another argument to the script to
# specify this, since we can't know what the output name is (it might be in
# another file not processed yet).
- host_executable = get_label_info(host_tool, "root_out_dir") + "/" +
- get_label_info(host_tool, "name") + _host_executable_suffix
+ host_executable =
+ get_label_info(host_tool, "root_out_dir") + "/" +
+ get_label_info(host_tool, "name") + _host_executable_suffix
# Add the executable itself as an input.
inputs += [ host_executable ]
- deps = [ host_tool ]
+ deps = [
+ host_tool,
+ ]
if (defined(invoker.deps)) {
deps += invoker.deps
}
# The script takes as arguments the binary to run, and then the arguments
# to pass it.
- args = [
- rebase_path(host_executable, root_build_dir)
- ] + invoker.args
+ args = [ rebase_path(host_executable, root_build_dir) ] + invoker.args
}
}
@@ -151,21 +152,22 @@ template("compiled_action_foreach") {
# If that's not the case, we'll need another argument to the script to
# specify this, since we can't know what the output name is (it might be in
# another file not processed yet).
- host_executable = get_label_info(host_tool, "root_out_dir") + "/" +
- get_label_info(host_tool, "name") + _host_executable_suffix
+ host_executable =
+ get_label_info(host_tool, "root_out_dir") + "/" +
+ get_label_info(host_tool, "name") + _host_executable_suffix
# Add the executable itself as an input.
inputs += [ host_executable ]
- deps = [ host_tool ]
+ deps = [
+ host_tool,
+ ]
if (defined(invoker.deps)) {
deps += invoker.deps
}
# The script takes as arguments the binary to run, and then the arguments
# to pass it.
- args = [
- rebase_path(host_executable, root_build_dir)
- ] + invoker.args
+ args = [ rebase_path(host_executable, root_build_dir) ] + invoker.args
}
}
diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn
index 247954b..bd803ef 100644
--- a/build/config/BUILD.gn
+++ b/build/config/BUILD.gn
@@ -30,8 +30,8 @@ declare_args() {
config("feature_flags") {
# TODO(brettw) most of these need to be parameterized.
defines = [
- "CHROMIUM_BUILD",
- "V8_DEPRECATION_WARNINGS", # Don't use deprecated V8 APIs anywhere.
+ "CHROMIUM_BUILD",
+ "V8_DEPRECATION_WARNINGS", # Don't use deprecated V8 APIs anywhere.
]
if (cld_version > 0) {
@@ -234,9 +234,7 @@ config("debug") {
}
config("release") {
- defines = [
- "NDEBUG",
- ]
+ defines = [ "NDEBUG" ]
}
# Default libraries ------------------------------------------------------------
@@ -271,6 +269,7 @@ config("default_libs") {
"winmm.lib",
"winspool.lib",
"ws2_32.lib",
+
# Please don't add more stuff here. We should actually be making this
# list smaller, since all common things should be covered. If you need
# some extra libraries, please just add a libs = [ "foo.lib" ] to your
@@ -287,7 +286,7 @@ config("default_libs") {
# '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
"c",
"dl",
- "m"
+ "m",
]
} else if (is_mac) {
libs = [
@@ -308,8 +307,6 @@ config("default_libs") {
"UIKit.framework",
]
} else if (is_linux) {
- libs = [
- "dl",
- ]
+ libs = [ "dl" ]
}
}
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index 0d65c44..39372d8 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -27,12 +27,13 @@ declare_args() {
# Component build.
is_component_build = false
+
# Debug build.
is_debug = true
# Set to true when compiling with the Clang compiler. Typically this is used
# to configure warnings.
- is_clang = (os == "mac" || os == "ios" || os == "linux" || os == "chromeos")
+ is_clang = os == "mac" || os == "ios" || os == "linux" || os == "chromeos"
# Selects the desired build flavor. Official builds get additional
# processing to prepare for release. Normally you will want to develop and
@@ -238,9 +239,7 @@ if (!is_ios) {
]
}
if (!is_mac && !is_ios) {
- sources_assignment_filter += [
- "*.mm",
- ]
+ sources_assignment_filter += [ "*.mm" ]
}
if (!is_linux) {
sources_assignment_filter += [
@@ -269,6 +268,7 @@ if (!is_chromeos) {
"*\bchromeos/*",
]
}
+
# DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call
# below.
@@ -309,7 +309,6 @@ if (!is_clang && (is_asan || is_lsan || is_tsan || is_msan)) {
# duplication in each target below.
_native_compiler_configs = [
"//build/config:feature_flags",
-
"//build/config/compiler:compiler",
"//build/config/compiler:compiler_arm_fpu",
"//build/config/compiler:chromium_code",
@@ -335,13 +334,13 @@ if (is_posix) {
}
if (is_linux) {
- _native_compiler_configs += [ "//build/config/linux:sdk", ]
+ _native_compiler_configs += [ "//build/config/linux:sdk" ]
} else if (is_mac) {
- _native_compiler_configs += [ "//build/config/mac:sdk", ]
+ _native_compiler_configs += [ "//build/config/mac:sdk" ]
} else if (is_ios) {
- _native_compiler_configs += [ "//build/config/ios:sdk", ]
+ _native_compiler_configs += [ "//build/config/ios:sdk" ]
} else if (is_android) {
- _native_compiler_configs += [ "//build/config/android:sdk", ]
+ _native_compiler_configs += [ "//build/config/android:sdk" ]
}
if (is_clang) {
@@ -388,15 +387,16 @@ _native_compiler_configs += [ _default_symbols_config ]
if (is_win) {
if (is_debug) {
_default_incremental_linking_config =
- "//build/config/win:incremental_linking"
+ "//build/config/win:incremental_linking"
} else {
_default_incremental_linking_config =
- "//build/config/win:no_incremental_linking"
+ "//build/config/win:no_incremental_linking"
}
_windows_linker_configs = [
_default_incremental_linking_config,
"//build/config/win:sdk_link",
"//build/config/win:common_linker_setup",
+
# Default to console-mode apps. Most of our targets are tests and such
# that shouldn't use the windows subsystem.
"//build/config/win:console",
@@ -404,15 +404,15 @@ if (is_win) {
}
# Executable defaults.
-_executable_configs = _native_compiler_configs + [
- "//build/config:default_libs",
-]
+_executable_configs =
+ _native_compiler_configs + [ "//build/config:default_libs" ]
if (is_win) {
_executable_configs += _windows_linker_configs
} else if (is_mac) {
_executable_configs += [
"//build/config/mac:mac_dynamic_flags",
- "//build/config/mac:mac_executable_flags" ]
+ "//build/config/mac:mac_executable_flags",
+ ]
} else if (is_linux || is_android) {
_executable_configs += [ "//build/config/gcc:executable_ldconfig" ]
if (is_android) {
@@ -429,9 +429,8 @@ set_defaults("static_library") {
}
# Shared library defaults (also for components in component mode).
-_shared_library_configs = _native_compiler_configs + [
- "//build/config:default_libs",
-]
+_shared_library_configs =
+ _native_compiler_configs + [ "//build/config:default_libs" ]
if (is_win) {
_shared_library_configs += _windows_linker_configs
} else if (is_mac) {
@@ -465,7 +464,6 @@ set_defaults("test") {
}
}
-
# ==============================================================================
# TOOLCHAIN SETUP
# ==============================================================================
@@ -536,38 +534,91 @@ template("component") {
# the original target may have override it for some assignments.
set_sources_assignment_filter([])
- if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invoker.all_dependent_configs }
- if (defined(invoker.allow_circular_includes_from)) { allow_circular_includes_from = invoker.allow_circular_includes_from }
- if (defined(invoker.cflags)) { cflags = invoker.cflags }
- if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c }
- if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc }
- if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc }
- if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc }
- if (defined(invoker.check_includes)) { check_includes = invoker.check_includes }
- if (defined(invoker.data)) { data = invoker.data }
- if (defined(invoker.datadeps)) { datadeps = invoker.datadeps }
- if (defined(invoker.defines)) { defines = invoker.defines }
+ if (defined(invoker.all_dependent_configs)) {
+ all_dependent_configs = invoker.all_dependent_configs
+ }
+ if (defined(invoker.allow_circular_includes_from)) {
+ allow_circular_includes_from = invoker.allow_circular_includes_from
+ }
+ if (defined(invoker.cflags)) {
+ cflags = invoker.cflags
+ }
+ if (defined(invoker.cflags_c)) {
+ cflags_c = invoker.cflags_c
+ }
+ if (defined(invoker.cflags_cc)) {
+ cflags_cc = invoker.cflags_cc
+ }
+ if (defined(invoker.cflags_objc)) {
+ cflags_objc = invoker.cflags_objc
+ }
+ if (defined(invoker.cflags_objcc)) {
+ cflags_objcc = invoker.cflags_objcc
+ }
+ if (defined(invoker.check_includes)) {
+ check_includes = invoker.check_includes
+ }
+ if (defined(invoker.data)) {
+ data = invoker.data
+ }
+ if (defined(invoker.datadeps)) {
+ datadeps = invoker.datadeps
+ }
+ if (defined(invoker.defines)) {
+ defines = invoker.defines
+ }
+
# All shared libraries must have the sanitizer deps to properly link in
# asan mode (this target will be empty in other cases).
if (defined(invoker.deps)) {
deps = invoker.deps + [ "//build/config/sanitizers:deps" ]
} else {
- deps = [ "//build/config/sanitizers:deps" ]
- }
- if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs }
- if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_configs_from = invoker.forward_dependent_configs_from }
- if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs }
- if (defined(invoker.ldflags)) { ldflags = invoker.ldflags }
- if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs }
- if (defined(invoker.libs)) { libs = invoker.libs }
- if (defined(invoker.output_extension)) { output_extension = invoker.output_extension }
- if (defined(invoker.output_name)) { output_name = invoker.output_name }
- if (defined(invoker.public)) { public = invoker.public }
- if (defined(invoker.public_configs)) { public_configs = invoker.public_configs }
- if (defined(invoker.public_deps)) { public_deps = invoker.public_deps }
- if (defined(invoker.sources)) { sources = invoker.sources }
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
- if (defined(invoker.visibility)) { visibility = invoker.visibility }
+ deps = [
+ "//build/config/sanitizers:deps",
+ ]
+ }
+ if (defined(invoker.direct_dependent_configs)) {
+ direct_dependent_configs = invoker.direct_dependent_configs
+ }
+ if (defined(invoker.forward_dependent_configs_from)) {
+ forward_dependent_configs_from = invoker.forward_dependent_configs_from
+ }
+ if (defined(invoker.include_dirs)) {
+ include_dirs = invoker.include_dirs
+ }
+ if (defined(invoker.ldflags)) {
+ ldflags = invoker.ldflags
+ }
+ if (defined(invoker.lib_dirs)) {
+ lib_dirs = invoker.lib_dirs
+ }
+ if (defined(invoker.libs)) {
+ libs = invoker.libs
+ }
+ if (defined(invoker.output_extension)) {
+ output_extension = invoker.output_extension
+ }
+ if (defined(invoker.output_name)) {
+ output_name = invoker.output_name
+ }
+ if (defined(invoker.public)) {
+ public = invoker.public
+ }
+ if (defined(invoker.public_configs)) {
+ public_configs = invoker.public_configs
+ }
+ if (defined(invoker.public_deps)) {
+ public_deps = invoker.public_deps
+ }
+ if (defined(invoker.sources)) {
+ sources = invoker.sources
+ }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
+ if (defined(invoker.visibility)) {
+ visibility = invoker.visibility
+ }
}
} else {
source_set(target_name) {
@@ -578,32 +629,84 @@ template("component") {
# See above call.
set_sources_assignment_filter([])
- if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invoker.all_dependent_configs }
- if (defined(invoker.allow_circular_includes_from)) { allow_circular_includes_from = invoker.allow_circular_includes_from }
- if (defined(invoker.cflags)) { cflags = invoker.cflags }
- if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c }
- if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc }
- if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc }
- if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc }
- if (defined(invoker.check_includes)) { check_includes = invoker.check_includes }
- if (defined(invoker.data)) { data = invoker.data }
- if (defined(invoker.datadeps)) { datadeps = invoker.datadeps }
- if (defined(invoker.defines)) { defines = invoker.defines }
- if (defined(invoker.deps)) { deps = invoker.deps }
- if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs }
- if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_configs_from = invoker.forward_dependent_configs_from }
- if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs }
- if (defined(invoker.ldflags)) { ldflags = invoker.ldflags }
- if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs }
- if (defined(invoker.libs)) { libs = invoker.libs }
- if (defined(invoker.output_extension)) { output_extension = invoker.output_extension }
- if (defined(invoker.output_name)) { output_name = invoker.output_name }
- if (defined(invoker.public)) { public = invoker.public }
- if (defined(invoker.public_configs)) { public_configs = invoker.public_configs }
- if (defined(invoker.public_deps)) { public_deps = invoker.public_deps }
- if (defined(invoker.sources)) { sources = invoker.sources }
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
- if (defined(invoker.visibility)) { visibility = invoker.visibility }
+ if (defined(invoker.all_dependent_configs)) {
+ all_dependent_configs = invoker.all_dependent_configs
+ }
+ if (defined(invoker.allow_circular_includes_from)) {
+ allow_circular_includes_from = invoker.allow_circular_includes_from
+ }
+ if (defined(invoker.cflags)) {
+ cflags = invoker.cflags
+ }
+ if (defined(invoker.cflags_c)) {
+ cflags_c = invoker.cflags_c
+ }
+ if (defined(invoker.cflags_cc)) {
+ cflags_cc = invoker.cflags_cc
+ }
+ if (defined(invoker.cflags_objc)) {
+ cflags_objc = invoker.cflags_objc
+ }
+ if (defined(invoker.cflags_objcc)) {
+ cflags_objcc = invoker.cflags_objcc
+ }
+ if (defined(invoker.check_includes)) {
+ check_includes = invoker.check_includes
+ }
+ if (defined(invoker.data)) {
+ data = invoker.data
+ }
+ if (defined(invoker.datadeps)) {
+ datadeps = invoker.datadeps
+ }
+ if (defined(invoker.defines)) {
+ defines = invoker.defines
+ }
+ if (defined(invoker.deps)) {
+ deps = invoker.deps
+ }
+ if (defined(invoker.direct_dependent_configs)) {
+ direct_dependent_configs = invoker.direct_dependent_configs
+ }
+ if (defined(invoker.forward_dependent_configs_from)) {
+ forward_dependent_configs_from = invoker.forward_dependent_configs_from
+ }
+ if (defined(invoker.include_dirs)) {
+ include_dirs = invoker.include_dirs
+ }
+ if (defined(invoker.ldflags)) {
+ ldflags = invoker.ldflags
+ }
+ if (defined(invoker.lib_dirs)) {
+ lib_dirs = invoker.lib_dirs
+ }
+ if (defined(invoker.libs)) {
+ libs = invoker.libs
+ }
+ if (defined(invoker.output_extension)) {
+ output_extension = invoker.output_extension
+ }
+ if (defined(invoker.output_name)) {
+ output_name = invoker.output_name
+ }
+ if (defined(invoker.public)) {
+ public = invoker.public
+ }
+ if (defined(invoker.public_configs)) {
+ public_configs = invoker.public_configs
+ }
+ if (defined(invoker.public_deps)) {
+ public_deps = invoker.public_deps
+ }
+ if (defined(invoker.sources)) {
+ sources = invoker.sources
+ }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
+ if (defined(invoker.visibility)) {
+ visibility = invoker.visibility
+ }
}
}
}
@@ -628,31 +731,81 @@ template("test") {
testonly = true
- if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invoker.all_dependent_configs }
- if (defined(invoker.allow_circular_includes_from)) { allow_circular_includes_from = invoker.allow_circular_includes_from }
- if (defined(invoker.cflags)) { cflags = invoker.cflags }
- if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c }
- if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc }
- if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc }
- if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc }
- if (defined(invoker.check_includes)) { check_includes = invoker.check_includes }
- if (defined(invoker.data)) { data = invoker.data }
- if (defined(invoker.datadeps)) { datadeps = invoker.datadeps }
- if (defined(invoker.defines)) { defines = invoker.defines }
- if (defined(invoker.deps)) { deps = invoker.deps }
- if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs }
- if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_configs_from = invoker.forward_dependent_configs_from }
- if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs }
- if (defined(invoker.ldflags)) { ldflags = invoker.ldflags }
- if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs }
- if (defined(invoker.libs)) { libs = invoker.libs }
- if (defined(invoker.output_extension)) { output_extension = invoker.output_extension }
- if (defined(invoker.output_name)) { output_name = invoker.output_name }
- if (defined(invoker.public)) { public = invoker.public }
- if (defined(invoker.public_configs)) { public_configs = invoker.public_configs }
- if (defined(invoker.public_deps)) { public_deps = invoker.public_deps }
- if (defined(invoker.sources)) { sources = invoker.sources }
- if (defined(invoker.visibility)) { visibility = invoker.visibility }
+ if (defined(invoker.all_dependent_configs)) {
+ all_dependent_configs = invoker.all_dependent_configs
+ }
+ if (defined(invoker.allow_circular_includes_from)) {
+ allow_circular_includes_from = invoker.allow_circular_includes_from
+ }
+ if (defined(invoker.cflags)) {
+ cflags = invoker.cflags
+ }
+ if (defined(invoker.cflags_c)) {
+ cflags_c = invoker.cflags_c
+ }
+ if (defined(invoker.cflags_cc)) {
+ cflags_cc = invoker.cflags_cc
+ }
+ if (defined(invoker.cflags_objc)) {
+ cflags_objc = invoker.cflags_objc
+ }
+ if (defined(invoker.cflags_objcc)) {
+ cflags_objcc = invoker.cflags_objcc
+ }
+ if (defined(invoker.check_includes)) {
+ check_includes = invoker.check_includes
+ }
+ if (defined(invoker.data)) {
+ data = invoker.data
+ }
+ if (defined(invoker.datadeps)) {
+ datadeps = invoker.datadeps
+ }
+ if (defined(invoker.defines)) {
+ defines = invoker.defines
+ }
+ if (defined(invoker.deps)) {
+ deps = invoker.deps
+ }
+ if (defined(invoker.direct_dependent_configs)) {
+ direct_dependent_configs = invoker.direct_dependent_configs
+ }
+ if (defined(invoker.forward_dependent_configs_from)) {
+ forward_dependent_configs_from = invoker.forward_dependent_configs_from
+ }
+ if (defined(invoker.include_dirs)) {
+ include_dirs = invoker.include_dirs
+ }
+ if (defined(invoker.ldflags)) {
+ ldflags = invoker.ldflags
+ }
+ if (defined(invoker.lib_dirs)) {
+ lib_dirs = invoker.lib_dirs
+ }
+ if (defined(invoker.libs)) {
+ libs = invoker.libs
+ }
+ if (defined(invoker.output_extension)) {
+ output_extension = invoker.output_extension
+ }
+ if (defined(invoker.output_name)) {
+ output_name = invoker.output_name
+ }
+ if (defined(invoker.public)) {
+ public = invoker.public
+ }
+ if (defined(invoker.public_configs)) {
+ public_configs = invoker.public_configs
+ }
+ if (defined(invoker.public_deps)) {
+ public_deps = invoker.public_deps
+ }
+ if (defined(invoker.sources)) {
+ sources = invoker.sources
+ }
+ if (defined(invoker.visibility)) {
+ visibility = invoker.visibility
+ }
}
} else {
executable(target_name) {
@@ -665,37 +818,88 @@ template("test") {
testonly = true
- if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invoker.all_dependent_configs }
- if (defined(invoker.allow_circular_includes_from)) { allow_circular_includes_from = invoker.allow_circular_includes_from }
- if (defined(invoker.cflags)) { cflags = invoker.cflags }
- if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c }
- if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc }
- if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc }
- if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc }
- if (defined(invoker.check_includes)) { check_includes = invoker.check_includes }
- if (defined(invoker.data)) { data = invoker.data }
- if (defined(invoker.datadeps)) { datadeps = invoker.datadeps }
- if (defined(invoker.defines)) { defines = invoker.defines }
+ if (defined(invoker.all_dependent_configs)) {
+ all_dependent_configs = invoker.all_dependent_configs
+ }
+ if (defined(invoker.allow_circular_includes_from)) {
+ allow_circular_includes_from = invoker.allow_circular_includes_from
+ }
+ if (defined(invoker.cflags)) {
+ cflags = invoker.cflags
+ }
+ if (defined(invoker.cflags_c)) {
+ cflags_c = invoker.cflags_c
+ }
+ if (defined(invoker.cflags_cc)) {
+ cflags_cc = invoker.cflags_cc
+ }
+ if (defined(invoker.cflags_objc)) {
+ cflags_objc = invoker.cflags_objc
+ }
+ if (defined(invoker.cflags_objcc)) {
+ cflags_objcc = invoker.cflags_objcc
+ }
+ if (defined(invoker.check_includes)) {
+ check_includes = invoker.check_includes
+ }
+ if (defined(invoker.data)) {
+ data = invoker.data
+ }
+ if (defined(invoker.datadeps)) {
+ datadeps = invoker.datadeps
+ }
+ if (defined(invoker.defines)) {
+ defines = invoker.defines
+ }
+
# All shared libraries must have the sanitizer deps to properly link in
# asan mode (this target will be empty in other cases).
if (defined(invoker.deps)) {
deps = invoker.deps + [ "//build/config/sanitizers:deps" ]
} else {
- deps = [ "//build/config/sanitizers:deps" ]
- }
- if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs }
- if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_configs_from = invoker.forward_dependent_configs_from }
- if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs }
- if (defined(invoker.ldflags)) { ldflags = invoker.ldflags }
- if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs }
- if (defined(invoker.libs)) { libs = invoker.libs }
- if (defined(invoker.output_extension)) { output_extension = invoker.output_extension }
- if (defined(invoker.output_name)) { output_name = invoker.output_name }
- if (defined(invoker.public)) { public = invoker.public }
- if (defined(invoker.public_configs)) { public_configs = invoker.public_configs }
- if (defined(invoker.public_deps)) { public_deps = invoker.public_deps }
- if (defined(invoker.sources)) { sources = invoker.sources }
- if (defined(invoker.visibility)) { visibility = invoker.visibility }
+ deps = [
+ "//build/config/sanitizers:deps",
+ ]
+ }
+ if (defined(invoker.direct_dependent_configs)) {
+ direct_dependent_configs = invoker.direct_dependent_configs
+ }
+ if (defined(invoker.forward_dependent_configs_from)) {
+ forward_dependent_configs_from = invoker.forward_dependent_configs_from
+ }
+ if (defined(invoker.include_dirs)) {
+ include_dirs = invoker.include_dirs
+ }
+ if (defined(invoker.ldflags)) {
+ ldflags = invoker.ldflags
+ }
+ if (defined(invoker.lib_dirs)) {
+ lib_dirs = invoker.lib_dirs
+ }
+ if (defined(invoker.libs)) {
+ libs = invoker.libs
+ }
+ if (defined(invoker.output_extension)) {
+ output_extension = invoker.output_extension
+ }
+ if (defined(invoker.output_name)) {
+ output_name = invoker.output_name
+ }
+ if (defined(invoker.public)) {
+ public = invoker.public
+ }
+ if (defined(invoker.public_configs)) {
+ public_configs = invoker.public_configs
+ }
+ if (defined(invoker.public_deps)) {
+ public_deps = invoker.public_deps
+ }
+ if (defined(invoker.sources)) {
+ sources = invoker.sources
+ }
+ if (defined(invoker.visibility)) {
+ visibility = invoker.visibility
+ }
}
}
}
diff --git a/build/config/allocator.gni b/build/config/allocator.gni
index 2d2fed1..9fcfe49 100644
--- a/build/config/allocator.gni
+++ b/build/config/allocator.gni
@@ -1,7 +1,7 @@
# Copyright 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.
-
+
# TODO(GYP): Make tcmalloc work on win.
if (is_android || cpu_arch == "mipsel" || is_mac || is_asan || is_win) {
_default_allocator = "none"
diff --git a/build/config/android/BUILD.gn b/build/config/android/BUILD.gn
index 2528c18..0cc38b7 100644
--- a/build/config/android/BUILD.gn
+++ b/build/config/android/BUILD.gn
@@ -13,9 +13,11 @@ config("sdk") {
# Need to get some linker flags out of the sysroot.
sysroot_ld_path = rebase_path("//build/config/linux/sysroot_ld_path.py")
ldflags += [ exec_script(sysroot_ld_path,
- [ rebase_path("//build/linux/sysroot_ld_path.sh"), sysroot ],
- "value")
- ]
+ [
+ rebase_path("//build/linux/sysroot_ld_path.sh"),
+ sysroot,
+ ],
+ "value") ]
}
}
diff --git a/build/config/android/config.gni b/build/config/android/config.gni
index ce9a175..99abf95 100644
--- a/build/config/android/config.gni
+++ b/build/config/android/config.gni
@@ -5,9 +5,10 @@
# This file contains common system config stuff for the Android build.
if (is_android) {
- has_chrome_android_internal = exec_script("//build/dir_exists.py",
- [ rebase_path("//clank", root_build_dir) ],
- "string") == "True"
+ has_chrome_android_internal =
+ exec_script("//build/dir_exists.py",
+ [ rebase_path("//clank", root_build_dir) ],
+ "string") == "True"
if (has_chrome_android_internal) {
import("//clank/config.gni")
@@ -27,7 +28,8 @@ if (is_android) {
# when this is unset, but builds using the normal chromium build system.
is_android_webview_build = false
- android_default_keystore_path = "//build/android/ant/chromium-debug.keystore"
+ android_default_keystore_path =
+ "//build/android/ant/chromium-debug.keystore"
android_default_keystore_name = "chromiumdebugkey"
android_default_keystore_password = "chromium"
@@ -89,7 +91,8 @@ if (is_android) {
android_sdk = "${android_sdk_root}/platforms/android-${android_sdk_version}"
android_sdk_tools = "${android_sdk_root}/tools"
- android_sdk_build_tools = "${android_sdk_root}/build-tools/$android_sdk_build_tools_version"
+ android_sdk_build_tools =
+ "${android_sdk_root}/build-tools/$android_sdk_build_tools_version"
# Path to the SDK's android.jar
android_sdk_jar = "$android_sdk/android.jar"
@@ -99,16 +102,22 @@ if (is_android) {
# Subdirectories inside android_ndk_root that contain the sysroot for the
# associated platform.
_android_api_level = 14
- x86_android_sysroot_subdir = "platforms/android-${_android_api_level}/arch-x86"
- arm_android_sysroot_subdir = "platforms/android-${_android_api_level}/arch-arm"
- mips_android_sysroot_subdir = "platforms/android-${_android_api_level}/arch-mips"
+ x86_android_sysroot_subdir =
+ "platforms/android-${_android_api_level}/arch-x86"
+ arm_android_sysroot_subdir =
+ "platforms/android-${_android_api_level}/arch-arm"
+ mips_android_sysroot_subdir =
+ "platforms/android-${_android_api_level}/arch-mips"
# Toolchain root directory for each build. The actual binaries are inside
# a "bin" directory inside of these.
_android_toolchain_version = "4.9"
- x86_android_toolchain_root = "$android_ndk_root/toolchains/x86-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}"
- arm_android_toolchain_root = "$android_ndk_root/toolchains/arm-linux-androideabi-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}"
- mips_android_toolchain_root = "$android_ndk_root/toolchains/mipsel-linux-android-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}"
+ x86_android_toolchain_root =
+ "$android_ndk_root/toolchains/x86-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}"
+ arm_android_toolchain_root =
+ "$android_ndk_root/toolchains/arm-linux-androideabi-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}"
+ mips_android_toolchain_root =
+ "$android_ndk_root/toolchains/mipsel-linux-android-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}"
# Location of libgcc. This is only needed for the current GN toolchain, so we
# only need to define the current one, rather than one for every platform
@@ -118,24 +127,24 @@ if (is_android) {
_binary_prefix = "i686-linux-android"
android_toolchain_root = "$x86_android_toolchain_root"
android_libgcc_file =
- "$android_toolchain_root/lib/gcc/i686-linux-android/${_android_toolchain_version}/libgcc.a"
+ "$android_toolchain_root/lib/gcc/i686-linux-android/${_android_toolchain_version}/libgcc.a"
} else if (cpu_arch == "arm") {
android_prebuilt_arch = "android-arm"
_binary_prefix = "arm-linux-androideabi"
android_toolchain_root = "$arm_android_toolchain_root"
if (arm_use_thumb) {
android_libgcc_file =
- "$android_toolchain_root/lib/gcc/arm-linux-androideabi/${_android_toolchain_version}/thumb/libgcc.a"
+ "$android_toolchain_root/lib/gcc/arm-linux-androideabi/${_android_toolchain_version}/thumb/libgcc.a"
} else {
android_libgcc_file =
- "$android_toolchain_root/lib/gcc/arm-linux-androideabi/${_android_toolchain_version}/libgcc.a"
+ "$android_toolchain_root/lib/gcc/arm-linux-androideabi/${_android_toolchain_version}/libgcc.a"
}
} else if (cpu_arch == "mipsel") {
android_prebuilt_arch = "android-mips"
_binary_prefix = "mipsel-linux-android"
android_toolchain_root = "$mips_android_toolchain_root"
android_libgcc_file =
- "$android_toolchain_root/lib/gcc/mipsel-linux-android/${_android_toolchain_version}/libgcc.a"
+ "$android_toolchain_root/lib/gcc/mipsel-linux-android/${_android_toolchain_version}/libgcc.a"
} else {
assert(false, "Need android libgcc support for your target arch.")
}
@@ -143,7 +152,8 @@ if (is_android) {
android_tool_prefix = "$android_toolchain_root/bin/$_binary_prefix-"
android_readelf = "${android_tool_prefix}readelf"
android_objcopy = "${android_tool_prefix}objcopy"
- android_gdbserver = "$android_ndk_root/prebuilt/$android_prebuilt_arch/gdbserver/gdbserver"
+ android_gdbserver =
+ "$android_ndk_root/prebuilt/$android_prebuilt_arch/gdbserver/gdbserver"
# stlport stuff --------------------------------------------------------------
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index d33c200..7ed1291 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -6,16 +6,18 @@ import("//build/config/android/config.gni")
assert(is_android)
-
rebased_android_sdk = rebase_path(android_sdk, root_build_dir)
rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir)
-rebased_android_sdk_build_tools = rebase_path(android_sdk_build_tools, root_build_dir)
+rebased_android_sdk_build_tools =
+ rebase_path(android_sdk_build_tools, root_build_dir)
android_sdk_jar = "$android_sdk/android.jar"
rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir)
template("android_lint") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
jar_path = invoker.jar_path
android_manifest = invoker.android_manifest
@@ -28,35 +30,41 @@ template("android_lint") {
config_path = base_path + "/config.xml"
suppressions_file = "//build/android/lint/suppressions.xml"
inputs = [
- suppressions_file,
- android_manifest,
- jar_path,
- ] + java_files
+ suppressions_file,
+ android_manifest,
+ jar_path,
+ ] + java_files
outputs = [
config_path,
- result_path
+ result_path,
]
rebased_java_files = rebase_path(java_files, root_build_dir)
args = [
"--lint-path=$rebased_android_sdk_root/tools/lint",
- "--config-path", rebase_path(suppressions_file, root_build_dir),
- "--manifest-path", rebase_path(android_manifest, root_build_dir),
+ "--config-path",
+ rebase_path(suppressions_file, root_build_dir),
+ "--manifest-path",
+ rebase_path(android_manifest, root_build_dir),
"--product-dir=.",
- "--jar-path", rebase_path(jar_path, root_build_dir),
- "--processed-config-path", rebase_path(config_path, root_build_dir),
- "--result-path", rebase_path(result_path, root_build_dir),
+ "--jar-path",
+ rebase_path(jar_path, root_build_dir),
+ "--processed-config-path",
+ rebase_path(config_path, root_build_dir),
+ "--result-path",
+ rebase_path(result_path, root_build_dir),
"--java-files=$rebased_java_files",
"--enable",
]
}
}
-
template("dex") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
assert(defined(invoker.sources))
assert(defined(invoker.output))
@@ -64,7 +72,10 @@ template("dex") {
script = "//build/android/gyp/dex.py"
depfile = "$target_gen_dir/$target_name.d"
sources = invoker.sources
- outputs = [depfile, invoker.output]
+ outputs = [
+ depfile,
+ invoker.output,
+ ]
if (defined(invoker.inputs)) {
inputs = invoker.inputs
}
@@ -76,15 +87,16 @@ template("dex") {
rebased_output = rebase_path(invoker.output, root_build_dir)
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
- "--android-sdk-tools", rebased_android_sdk_build_tools,
- "--dex-path", rebased_output,
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--android-sdk-tools",
+ rebased_android_sdk_build_tools,
+ "--dex-path",
+ rebased_output,
]
if (defined(invoker.no_locals) && invoker.no_locals) {
- args += [
- "--no-locals=1"
- ]
+ args += [ "--no-locals=1" ]
}
if (defined(invoker.args)) {
@@ -95,11 +107,12 @@ template("dex") {
}
}
-
# Creates a zip archive of the inputs.
# If base_dir is provided, the archive paths will be relative to it.
template("zip") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
assert(defined(invoker.inputs))
assert(defined(invoker.output))
@@ -112,22 +125,23 @@ template("zip") {
inputs = invoker.inputs
outputs = [
depfile,
- invoker.output
+ invoker.output,
]
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
"--inputs=$rebase_inputs",
"--output=$rebase_output",
]
if (defined(invoker.base_dir)) {
args += [
- "--base-dir", rebase_path(invoker.base_dir, root_build_dir)
+ "--base-dir",
+ rebase_path(invoker.base_dir, root_build_dir),
]
}
}
}
-
# Write the target's .build_config file. This is a json file that contains a
# dictionary of information about how to build this target (things that
# require knowledge about this target's dependencies and cannot be calculated
@@ -138,7 +152,9 @@ template("zip") {
# See build/android/gyp/write_build_config.py and
# build/android/gyp/util/build_utils.py:ExpandFileArgs
template("write_build_config") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
assert(defined(invoker.type))
assert(defined(invoker.build_config))
@@ -146,7 +162,8 @@ template("write_build_config") {
type = invoker.type
build_config = invoker.build_config
- assert(type == "android_apk" || type == "java_library" || type == "android_resources")
+ assert(type == "android_apk" || type == "java_library" ||
+ type == "android_resources")
action(target_name) {
script = "//build/android/gyp/write_build_config.py"
@@ -168,29 +185,33 @@ template("write_build_config") {
outputs = [
depfile,
- build_config
+ build_config,
]
args = [
- "--type", type,
- "--depfile", rebase_path(depfile, root_build_dir),
+ "--type",
+ type,
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
"--possible-deps-configs=$rebase_possible_deps_configs",
- "--build-config", rebase_path(build_config, root_build_dir),
+ "--build-config",
+ rebase_path(build_config, root_build_dir),
]
is_java_library = type == "java_library"
is_apk = type == "android_apk"
is_android_resources = type == "android_resources"
- supports_android = (is_apk || is_android_resources ||
- (is_java_library && defined(invoker.supports_android) &&
- invoker.supports_android))
- requires_android = (is_apk || is_android_resources ||
- (is_java_library && defined(invoker.requires_android) &&
- invoker.requires_android))
+ supports_android = is_apk || is_android_resources ||
+ (is_java_library && defined(invoker.supports_android) &&
+ invoker.supports_android)
+ requires_android = is_apk || is_android_resources ||
+ (is_java_library && defined(invoker.requires_android) &&
+ invoker.requires_android)
+
+ assert(!requires_android || supports_android,
+ "requires_android requires" + " supports_android")
- assert(!requires_android || supports_android, "requires_android requires" +
- " supports_android")
# Mark these variables as used.
assert(is_java_library || true)
assert(is_apk || true)
@@ -198,13 +219,15 @@ template("write_build_config") {
if (is_java_library || is_apk) {
args += [
- "--jar-path", rebase_path(invoker.jar_path, root_build_dir),
+ "--jar-path",
+ rebase_path(invoker.jar_path, root_build_dir),
]
}
if (is_apk || (is_java_library && supports_android)) {
args += [
- "--dex-path", rebase_path(invoker.dex_path, root_build_dir),
+ "--dex-path",
+ rebase_path(invoker.dex_path, root_build_dir),
]
}
if (supports_android) {
@@ -221,19 +244,20 @@ template("write_build_config") {
if (is_android_resources || is_apk) {
assert(defined(invoker.resources_zip))
args += [
- "--resources-zip", rebase_path(invoker.resources_zip, root_build_dir),
+ "--resources-zip",
+ rebase_path(invoker.resources_zip, root_build_dir),
]
if (defined(invoker.android_manifest)) {
- inputs += [
- invoker.android_manifest
- ]
+ inputs += [ invoker.android_manifest ]
args += [
- "--android-manifest", rebase_path(invoker.android_manifest, root_build_dir),
+ "--android-manifest",
+ rebase_path(invoker.android_manifest, root_build_dir),
]
}
if (defined(invoker.custom_package)) {
args += [
- "--package-name", invoker.custom_package
+ "--package-name",
+ invoker.custom_package,
]
}
}
@@ -251,15 +275,17 @@ template("write_build_config") {
if (defined(invoker.srcjar)) {
args += [
- "--srcjar", rebase_path(invoker.srcjar, root_build_dir)
+ "--srcjar",
+ rebase_path(invoker.srcjar, root_build_dir),
]
}
}
}
-
template("process_java_prebuilt") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
_input_jar_path = invoker.input_jar_path
_output_jar_path = invoker.output_jar_path
@@ -287,19 +313,27 @@ template("process_java_prebuilt") {
_output_jar_path,
]
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
- "--proguard-path", rebase_path(_proguard_jar_path, root_build_dir),
- "--input-path", rebase_path(_input_jar_path, root_build_dir),
- "--output-path", rebase_path(_output_jar_path, root_build_dir),
- "--proguard-config", rebase_path(_proguard_config_path, root_build_dir),
- "--classpath", rebased_android_sdk_jar,
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--proguard-path",
+ rebase_path(_proguard_jar_path, root_build_dir),
+ "--input-path",
+ rebase_path(_input_jar_path, root_build_dir),
+ "--output-path",
+ rebase_path(_output_jar_path, root_build_dir),
+ "--proguard-config",
+ rebase_path(_proguard_config_path, root_build_dir),
+ "--classpath",
+ rebased_android_sdk_jar,
"--classpath=@FileArg($_rebased_build_config:javac:classpath)",
]
}
} else {
copy("${target_name}__copy_jar") {
- sources = [_input_jar_path]
- outputs = [_output_jar_path]
+ sources = [
+ _input_jar_path,
+ ]
+ outputs = [ _output_jar_path ]
}
}
@@ -309,28 +343,34 @@ template("process_java_prebuilt") {
outputs = [
depfile,
_jar_toc_path,
- _jar_toc_path + ".md5.stamp"
+ _jar_toc_path + ".md5.stamp",
+ ]
+ inputs = [
+ _output_jar_path,
]
- inputs = [ _output_jar_path ]
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
- "--jar-path", rebase_path(_output_jar_path, root_build_dir),
- "--toc-path", rebase_path(_jar_toc_path, root_build_dir),
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--jar-path",
+ rebase_path(_output_jar_path, root_build_dir),
+ "--toc-path",
+ rebase_path(_jar_toc_path, root_build_dir),
]
}
group(target_name) {
deps = [
- ":${target_name}__jar_toc"
+ ":${target_name}__jar_toc",
]
}
}
-
# Packages resources, assets, dex, and native libraries into an apk. Signs and
# zipaligns the apk.
template("create_apk") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
_android_manifest = invoker.android_manifest
_base_path = invoker.base_path
@@ -349,7 +389,7 @@ template("create_apk") {
_native_libs_dir = "//build/android/empty/res"
if (defined(invoker.native_libs_dir)) {
- _native_libs_dir = invoker.native_libs_dir
+ _native_libs_dir = invoker.native_libs_dir
}
_asset_location = "//build/android/empty/res"
@@ -364,8 +404,8 @@ template("create_apk") {
_resource_packaged_apk_path = _base_apk_path + ".ap_"
_packaged_apk_path = _base_apk_path + ".unfinished.apk"
- _shared_resources = defined(invoker.shared_resources) && invoker.shared_resources
-
+ _shared_resources =
+ defined(invoker.shared_resources) && invoker.shared_resources
_configuration_name = "Release"
if (is_debug) {
@@ -381,28 +421,35 @@ template("create_apk") {
_android_manifest,
_resources_zip,
]
- outputs = [depfile, _resource_packaged_apk_path]
+ outputs = [
+ depfile,
+ _resource_packaged_apk_path,
+ ]
- _rebased_resources_zips = [rebase_path(_resources_zip, root_build_dir)]
+ _rebased_resources_zips = [ rebase_path(_resources_zip, root_build_dir) ]
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
- "--android-sdk", rebased_android_sdk,
- "--android-sdk-tools", rebased_android_sdk_build_tools,
-
- "--configuration-name=$_configuration_name",
-
- "--android-manifest", rebase_path(_android_manifest, root_build_dir),
- "--version-code", _version_code,
- "--version-name", _version_name,
-
- "--asset-dir", rebase_path(_asset_location, root_build_dir),
- "--resource-zips=$_rebased_resources_zips",
-
- "--apk-path", rebase_path(_resource_packaged_apk_path, root_build_dir),
- ]
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--android-sdk",
+ rebased_android_sdk,
+ "--android-sdk-tools",
+ rebased_android_sdk_build_tools,
+ "--configuration-name=$_configuration_name",
+ "--android-manifest",
+ rebase_path(_android_manifest, root_build_dir),
+ "--version-code",
+ _version_code,
+ "--version-name",
+ _version_name,
+ "--asset-dir",
+ rebase_path(_asset_location, root_build_dir),
+ "--resource-zips=$_rebased_resources_zips",
+ "--apk-path",
+ rebase_path(_resource_packaged_apk_path, root_build_dir),
+ ]
if (_shared_resources) {
- args += ["--shared-resources"]
+ args += [ "--shared-resources" ]
}
}
@@ -415,7 +462,7 @@ template("create_apk") {
inputs = [
_dex_path,
_resource_packaged_apk_path,
- _ant_script
+ _ant_script,
]
outputs = [
@@ -424,13 +471,14 @@ template("create_apk") {
]
_rebased_emma_jar = ""
- _rebased_resource_packaged_apk_path = rebase_path(
- _resource_packaged_apk_path, root_build_dir)
+ _rebased_resource_packaged_apk_path =
+ rebase_path(_resource_packaged_apk_path, root_build_dir)
_rebased_packaged_apk_path = rebase_path(_packaged_apk_path, root_build_dir)
_rebased_native_libs_dir = rebase_path(_native_libs_dir, root_build_dir)
_rebased_dex_path = rebase_path(_dex_path, root_build_dir)
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
"--",
"-quiet",
"-DANDROID_SDK_ROOT=$rebased_android_sdk_root",
@@ -443,9 +491,9 @@ template("create_apk") {
"-DEMMA_INSTRUMENT=0",
"-DEMMA_DEVICE_JAR=$_rebased_emma_jar",
"-DDEX_FILE_PATH=$_rebased_dex_path",
-
"-Dbasedir=.",
- "-buildfile", rebase_path(_ant_script, root_build_dir)
+ "-buildfile",
+ rebase_path(_ant_script, root_build_dir),
]
}
@@ -453,40 +501,57 @@ template("create_apk") {
script = "//build/android/gyp/finalize_apk.py"
depfile = "$target_gen_dir/$target_name.d"
- sources = [_packaged_apk_path]
- inputs = [_keystore_path]
- outputs = [depfile, _final_apk_path]
+ sources = [
+ _packaged_apk_path,
+ ]
+ inputs = [
+ _keystore_path,
+ ]
+ outputs = [
+ depfile,
+ _final_apk_path,
+ ]
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
- "--zipalign-path", rebase_path(zipalign_path, root_build_dir),
- "--unsigned-apk-path", rebase_path(_packaged_apk_path, root_build_dir),
- "--final-apk-path", rebase_path(_final_apk_path, root_build_dir),
- "--key-path", rebase_path(_keystore_path, root_build_dir),
- "--key-name", _keystore_name,
- "--key-passwd", _keystore_password,
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--zipalign-path",
+ rebase_path(zipalign_path, root_build_dir),
+ "--unsigned-apk-path",
+ rebase_path(_packaged_apk_path, root_build_dir),
+ "--final-apk-path",
+ rebase_path(_final_apk_path, root_build_dir),
+ "--key-path",
+ rebase_path(_keystore_path, root_build_dir),
+ "--key-name",
+ _keystore_name,
+ "--key-passwd",
+ _keystore_password,
]
if (_load_library_from_apk) {
_rezip_jar_path = "$root_build_dir/lib.java/rezip_apk.jar"
- inputs += [
- _rezip_jar_path
- ]
+ inputs += [ _rezip_jar_path ]
args += [
"--load-library-from-zip-file=1",
- "--rezip-apk-jar-path", rebase_path(_rezip_jar_path, root_build_dir)
+ "--rezip-apk-jar-path",
+ rebase_path(_rezip_jar_path, root_build_dir),
]
}
}
group(target_name) {
- deps = [":${target_name}__finalize"]
+ deps = [
+ ":${target_name}__finalize",
+ ]
}
}
template("java_prebuilt_impl") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
- _supports_android = (
- defined(invoker.supports_android) && invoker.supports_android)
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
+ _supports_android =
+ defined(invoker.supports_android) && invoker.supports_android
assert(defined(invoker.jar_path))
_base_path = "${target_gen_dir}/$target_name"
@@ -500,13 +565,12 @@ template("java_prebuilt_impl") {
_final_deps = []
_template_name = target_name
-
_final_deps += [ ":${_template_name}__build_config" ]
write_build_config("${_template_name}__build_config") {
type = "java_library"
supports_android = _supports_android
- requires_android = (defined(invoker.requires_android) &&
- invoker.requires_android)
+ requires_android =
+ defined(invoker.requires_android) && invoker.requires_android
deps = []
if (defined(invoker.deps)) {
@@ -534,7 +598,9 @@ template("java_prebuilt_impl") {
if (_supports_android) {
_final_deps += [ ":${_template_name}__dex" ]
dex("${_template_name}__dex") {
- sources = [_jar_path]
+ sources = [
+ _jar_path,
+ ]
output = _dex_path
}
}
@@ -544,7 +610,6 @@ template("java_prebuilt_impl") {
}
}
-
# Compiles and jars a set of java files.
#
# Outputs:
@@ -561,7 +626,9 @@ template("java_prebuilt_impl") {
# jar_path: Use this to explicitly set the output jar path. Defaults to
# "${target_gen_dir}/${target_name}.jar.
template("compile_java") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
assert(defined(invoker.java_files))
assert(defined(invoker.build_config))
@@ -597,6 +664,7 @@ template("compile_java") {
_dep_name = get_label_info(dep, "name")
_java_srcjars += [ "$_dep_gen_dir/$_dep_name.srcjar" ]
}
+
# Mark srcjar_deps as used.
assert(_srcjar_deps == [] || true)
@@ -617,7 +685,7 @@ template("compile_java") {
outputs = [
depfile,
_intermediate_jar_path,
- _intermediate_jar_path + ".md5.stamp"
+ _intermediate_jar_path + ".md5.stamp",
]
sources = _java_files + _java_srcjars
inputs = _system_jars + [ _build_config ]
@@ -657,12 +725,14 @@ template("compile_java") {
}
}
-
template("java_library_impl") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
- assert(defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir)
- || defined(invoker.srcjars) || defined(invoker.srcjar_deps))
+ assert(
+ defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) ||
+ defined(invoker.srcjars) || defined(invoker.srcjar_deps))
_base_path = "$target_gen_dir/$target_name"
_jar_path = _base_path + ".jar"
if (defined(invoker.jar_path)) {
@@ -676,10 +746,10 @@ template("java_library_impl") {
_final_datadeps = invoker.datadeps
}
- _supports_android = (defined(invoker.supports_android) &&
- invoker.supports_android)
- _requires_android = (defined(invoker.requires_android) &&
- invoker.requires_android)
+ _supports_android =
+ defined(invoker.supports_android) && invoker.supports_android
+ _requires_android =
+ defined(invoker.requires_android) && invoker.requires_android
if (_supports_android) {
_dex_path = _base_path + ".dex.jar"
@@ -697,8 +767,8 @@ template("java_library_impl") {
type = "java_library"
supports_android = _supports_android
requires_android = _requires_android
- bypass_platform_checks = (defined(invoker.bypass_platform_checks) &&
- invoker.bypass_platform_checks)
+ bypass_platform_checks = defined(invoker.bypass_platform_checks) &&
+ invoker.bypass_platform_checks
deps = []
if (defined(invoker.deps)) {
@@ -734,21 +804,20 @@ template("java_library_impl") {
} else if (defined(invoker.DEPRECATED_java_in_dir)) {
_src_dir = invoker.DEPRECATED_java_in_dir + "/src"
_src_dir_exists = exec_script("//build/dir_exists.py",
- [ rebase_path(_src_dir, root_build_dir) ],
- "string")
+ [ rebase_path(_src_dir, root_build_dir) ],
+ "string")
assert(_src_dir_exists == "False",
- "In GN, java_in_dir should be the fully specified java directory " +
- "(i.e. including the trailing \"/src\")")
+ "In GN, java_in_dir should be the fully specified java directory " +
+ "(i.e. including the trailing \"/src\")")
_java_files_build_rel = exec_script(
- "//build/android/gyp/find.py",
- [
- "--pattern",
- "*.java",
- rebase_path(invoker.DEPRECATED_java_in_dir, root_build_dir)
- ],
- "list lines"
- )
+ "//build/android/gyp/find.py",
+ [
+ "--pattern",
+ "*.java",
+ rebase_path(invoker.DEPRECATED_java_in_dir, root_build_dir),
+ ],
+ "list lines")
_java_files = rebase_path(_java_files_build_rel, ".", root_build_dir)
}
assert(_java_files != [] || _srcjar_deps != [] || _srcjars != [])
@@ -763,10 +832,18 @@ template("java_library_impl") {
chromium_code = _chromium_code
android = _requires_android
- if (defined(invoker.jar_excluded_patterns)) { jar_excluded_patterns = invoker.jar_excluded_patterns }
- if (defined(invoker.proguard_preprocess)) { proguard_preprocess = invoker.proguard_preprocess }
- if (defined(invoker.proguard_config)) { proguard_config = invoker.proguard_config }
- if (defined(invoker.dist_jar_path)) { dist_jar_path = invoker.dist_jar_path }
+ if (defined(invoker.jar_excluded_patterns)) {
+ jar_excluded_patterns = invoker.jar_excluded_patterns
+ }
+ if (defined(invoker.proguard_preprocess)) {
+ proguard_preprocess = invoker.proguard_preprocess
+ }
+ if (defined(invoker.proguard_config)) {
+ proguard_config = invoker.proguard_config
+ }
+ if (defined(invoker.dist_jar_path)) {
+ dist_jar_path = invoker.dist_jar_path
+ }
}
if (defined(invoker.main_class)) {
@@ -775,18 +852,24 @@ template("java_library_impl") {
script = "//build/android/gyp/create_java_binary_script.py"
depfile = "$target_gen_dir/$target_name.d"
java_script = "$root_build_dir/bin/$_template_name"
- inputs = [ _build_config ]
+ inputs = [
+ _build_config,
+ ]
outputs = [
depfile,
java_script,
]
_rebased_build_config = rebase_path(_build_config, root_build_dir)
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
- "--output", rebase_path(java_script, root_build_dir),
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--output",
+ rebase_path(java_script, root_build_dir),
"--classpath=@FileArg($_rebased_build_config:java:full_classpath)",
- "--jar-path", rebase_path(_jar_path, root_build_dir),
- "--main-class", invoker.main_class,
+ "--jar-path",
+ rebase_path(_jar_path, root_build_dir),
+ "--main-class",
+ invoker.main_class,
]
}
}
@@ -808,7 +891,9 @@ template("java_library_impl") {
_final_deps += [ ":${_template_name}__dex" ]
dex("${_template_name}__dex") {
- sources = [_jar_path]
+ sources = [
+ _jar_path,
+ ]
output = _dex_path
}
}
@@ -822,10 +907,11 @@ template("java_library_impl") {
}
}
-
# Runs process_resources.py
template("process_resources") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
zip_path = invoker.zip_path
srcjar_path = invoker.srcjar_path
@@ -848,11 +934,9 @@ template("process_resources") {
srcjar_path,
]
- sources_build_rel = exec_script(
- "//build/android/gyp/find.py",
- rebase_path(resource_dirs, root_build_dir),
- "list lines"
- )
+ sources_build_rel = exec_script("//build/android/gyp/find.py",
+ rebase_path(resource_dirs, root_build_dir),
+ "list lines")
sources = rebase_path(sources_build_rel, ".", root_build_dir)
inputs = [
@@ -863,15 +947,19 @@ template("process_resources") {
rebase_resource_dirs = rebase_path(resource_dirs, root_build_dir)
rebase_build_config = rebase_path(build_config, root_build_dir)
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
- "--android-sdk", rebase_path(android_sdk, root_build_dir),
- "--android-sdk-tools", rebase_path(android_sdk_build_tools, root_build_dir),
- "--android-manifest", rebase_path(android_manifest, root_build_dir),
-
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--android-sdk",
+ rebase_path(android_sdk, root_build_dir),
+ "--android-sdk-tools",
+ rebase_path(android_sdk_build_tools, root_build_dir),
+ "--android-manifest",
+ rebase_path(android_manifest, root_build_dir),
"--resource-dirs=$rebase_resource_dirs",
- "--srcjar-out", rebase_path(srcjar_path, root_build_dir),
- "--resource-zip-out", rebase_path(zip_path, root_build_dir),
-
+ "--srcjar-out",
+ rebase_path(srcjar_path, root_build_dir),
+ "--resource-zip-out",
+ rebase_path(zip_path, root_build_dir),
"--dependencies-res-zips=@FileArg($rebase_build_config:resources:dependency_zips)",
"--extra-res-packages=@FileArg($rebase_build_config:resources:extra_package_names)",
]
@@ -882,24 +970,25 @@ template("process_resources") {
if (defined(invoker.custom_package)) {
args += [
- "--custom-package", invoker.custom_package,
+ "--custom-package",
+ invoker.custom_package,
]
}
if (defined(invoker.v14_verify_only) && invoker.v14_verify_only) {
- args += ["--v14-verify-only"]
+ args += [ "--v14-verify-only" ]
}
- if (defined(invoker.shared_resources) &&
- invoker.shared_resources) {
- args += ["--shared-resources"]
+ if (defined(invoker.shared_resources) && invoker.shared_resources) {
+ args += [ "--shared-resources" ]
}
if (defined(invoker.all_resources_zip_path)) {
all_resources_zip = invoker.all_resources_zip_path
outputs += [ all_resources_zip ]
args += [
- "--all-resources-zip-out", rebase_path(all_resources_zip, root_build_dir)
+ "--all-resources-zip-out",
+ rebase_path(all_resources_zip, root_build_dir),
]
}
@@ -910,12 +999,16 @@ template("process_resources") {
}
template("copy_ex") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
action(target_name) {
script = "//build/android/gyp/copy_ex.py"
- if (defined(invoker.deps)) { deps = invoker.deps }
+ if (defined(invoker.deps)) {
+ deps = invoker.deps
+ }
sources = []
if (defined(invoker.sources)) {
@@ -928,19 +1021,19 @@ template("copy_ex") {
}
depfile = "$target_gen_dir/$target_name.d"
- outputs = [
- depfile,
- ]
+ outputs = [ depfile ]
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
- "--dest", rebase_path(invoker.dest, root_build_dir),
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--dest",
+ rebase_path(invoker.dest, root_build_dir),
]
rebased_sources = rebase_path(sources, root_build_dir)
args += [ "--files=$rebased_sources" ]
if (defined(invoker.clear_dir) && invoker.clear_dir) {
- args += ["--clear"]
+ args += [ "--clear" ]
}
if (defined(invoker.args)) {
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index a5c0b0a..5a0f227 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -30,7 +30,9 @@ assert(is_android)
# jni_package = "foo"
# }
template("generate_jni") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
assert(defined(invoker.sources))
assert(defined(invoker.jni_package))
@@ -46,23 +48,29 @@ template("generate_jni") {
script = "//base/android/jni_generator/jni_generator.py"
depfile = "$target_gen_dir/$target_name.{{source_name_part}}.d"
sources = invoker.sources
- inputs = [ jni_generator_include ]
+ inputs = [
+ jni_generator_include,
+ ]
outputs = [
depfile,
- "${jni_output_dir}/{{source_name_part}}_jni.h"
+ "${jni_output_dir}/{{source_name_part}}_jni.h",
]
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
"--input_file={{source}}",
"--optimize_generation=1",
"--ptr_type=long",
- "--output_dir", rebase_path(jni_output_dir, root_build_dir),
- "--includes", rebase_path(jni_generator_include, "//"),
+ "--output_dir",
+ rebase_path(jni_output_dir, root_build_dir),
+ "--includes",
+ rebase_path(jni_generator_include, "//"),
]
if (defined(invoker.jni_generator_jarjar_file)) {
args += [
- "--jarjar", rebase_path(jni_generator_jarjar_file, root_build_dir),
+ "--jarjar",
+ rebase_path(jni_generator_jarjar_file, root_build_dir),
]
}
}
@@ -78,7 +86,9 @@ template("generate_jni") {
}
group(target_name) {
- deps = [ ":$foreach_target_name" ]
+ deps = [
+ ":$foreach_target_name",
+ ]
public_configs = [ ":jni_includes_${target_name}" ]
if (defined(invoker.deps)) {
@@ -88,11 +98,12 @@ template("generate_jni") {
public_deps = invoker.public_deps
}
- if (defined(invoker.visibility)) { visibility = invoker.visibility }
+ if (defined(invoker.visibility)) {
+ visibility = invoker.visibility
+ }
}
}
-
# Declare a jni target for a prebuilt jar
#
# This target generates the native jni bindings for a set of classes in a .jar.
@@ -117,7 +128,9 @@ template("generate_jni") {
# jni_package = "foo"
# }
template("generate_jar_jni") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
assert(defined(invoker.classes))
assert(defined(invoker.jni_package))
@@ -139,8 +152,7 @@ template("generate_jar_jni") {
jni_actions = []
foreach(class, invoker.classes) {
_classname_list = []
- _classname_list = process_file_template(
- [class], "{{source_name_part}}")
+ _classname_list = process_file_template([ class ], "{{source_name_part}}")
classname = _classname_list[0]
jni_target_name = "${target_name}__jni_${classname}"
jni_actions += [ ":$jni_target_name" ]
@@ -153,17 +165,22 @@ template("generate_jar_jni") {
]
outputs = [
depfile,
- "${jni_output_dir}/${classname}_jni.h"
+ "${jni_output_dir}/${classname}_jni.h",
]
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
- "--jar_file", rebase_path(jar_file, root_build_dir),
- "--input_file", class,
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--jar_file",
+ rebase_path(jar_file, root_build_dir),
+ "--input_file",
+ class,
"--optimize_generation=1",
"--ptr_type=long",
- "--output_dir", rebase_path(jni_output_dir, root_build_dir),
- "--includes", rebase_path(jni_generator_include, root_build_dir),
+ "--output_dir",
+ rebase_path(jni_output_dir, root_build_dir),
+ "--includes",
+ rebase_path(jni_generator_include, root_build_dir),
]
}
}
@@ -184,7 +201,6 @@ template("generate_jar_jni") {
}
}
-
# Declare a target for c-preprocessor-generated java files
#
# NOTE: For generating Java conterparts to enums prefer using the java_cpp_enum
@@ -221,7 +237,9 @@ template("generate_jar_jni") {
# include_path = "android/java/templates"
# }
template("java_cpp_template") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
assert(defined(invoker.sources))
package_name = invoker.package_name + ""
@@ -241,24 +259,31 @@ template("java_cpp_template") {
sources = invoker.sources
- gen_dir = "${target_gen_dir}/${target_name}/java_cpp_template/${package_name}"
+ gen_dir =
+ "${target_gen_dir}/${target_name}/java_cpp_template/${package_name}"
gcc_template_output_pattern = "${gen_dir}/{{source_name_part}}.java"
outputs = [
depfile,
- gcc_template_output_pattern
+ gcc_template_output_pattern,
]
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
- "--include-path", rebase_path(include_path, root_build_dir),
- "--output", rebase_path(gen_dir, root_build_dir) + "/{{source_name_part}}.java",
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--include-path",
+ rebase_path(include_path, root_build_dir),
+ "--output",
+ rebase_path(gen_dir, root_build_dir) + "/{{source_name_part}}.java",
"--template={{source}}",
]
if (defined(invoker.defines)) {
foreach(def, invoker.defines) {
- args += ["--defines", def]
+ args += [
+ "--defines",
+ def,
+ ]
}
}
}
@@ -275,7 +300,7 @@ template("java_cpp_template") {
group(target_name) {
deps = [
- ":${target_name}__zip_srcjar"
+ ":${target_name}__zip_srcjar",
]
}
}
@@ -308,7 +333,9 @@ template("java_cpp_template") {
# ]
# }
template("java_cpp_enum") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
assert(defined(invoker.sources))
assert(defined(invoker.outputs))
@@ -317,21 +344,25 @@ template("java_cpp_enum") {
sources = invoker.sources
script = "//build/android/gyp/java_cpp_enum.py"
gen_dir = "${target_gen_dir}/${target_name}/enums"
- outputs = get_path_info(
- rebase_path(invoker.outputs, ".", gen_dir), "abspath")
+ outputs =
+ get_path_info(rebase_path(invoker.outputs, ".", gen_dir), "abspath")
args = [
- "--output_dir", rebase_path(gen_dir, root_build_dir),
+ "--output_dir",
+ rebase_path(gen_dir, root_build_dir),
]
foreach(output, rebase_path(outputs, root_build_dir)) {
- args += ["--assert_file", output]
+ args += [
+ "--assert_file",
+ output,
+ ]
}
args += rebase_path(invoker.sources, root_build_dir)
}
generate_enum_outputs = get_target_outputs(":${target_name}__generate_enum")
- base_gen_dir = get_label_info(":${target_name}__generate_enum",
- "target_gen_dir")
+ base_gen_dir =
+ get_label_info(":${target_name}__generate_enum", "target_gen_dir")
srcjar_path = "${target_gen_dir}/${target_name}.srcjar"
zip("${target_name}__zip_srcjar") {
@@ -342,7 +373,7 @@ template("java_cpp_enum") {
group(target_name) {
deps = [
- ":${target_name}__zip_srcjar"
+ ":${target_name}__zip_srcjar",
]
}
}
@@ -361,13 +392,17 @@ template("java_cpp_enum") {
# output = "$target_gen_dir/AndroidManifest.xml"
# }
template("jinja_template") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
assert(defined(invoker.input))
assert(defined(invoker.output))
action(target_name) {
- sources = [invoker.input]
+ sources = [
+ invoker.input,
+ ]
script = "//build/android/gyp/jinja_template.py"
depfile = "$target_gen_dir/$target_name.d"
@@ -377,13 +412,16 @@ template("jinja_template") {
]
args = [
- "--inputs", rebase_path(invoker.input, root_build_dir),
- "--output", rebase_path(invoker.output, root_build_dir),
- "--depfile", rebase_path(depfile, root_build_dir),
+ "--inputs",
+ rebase_path(invoker.input, root_build_dir),
+ "--output",
+ rebase_path(invoker.output, root_build_dir),
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
]
if (defined(invoker.variables)) {
variables = invoker.variables
- args += ["--variables=${variables}" ]
+ args += [ "--variables=${variables}" ]
}
}
}
@@ -410,7 +448,9 @@ template("jinja_template") {
# variables = ["color=red"]
# }
template("jinja_template_resources") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
assert(defined(invoker.resources))
assert(defined(invoker.res_dir))
@@ -438,13 +478,16 @@ template("jinja_template_resources") {
rebased_resources = rebase_path(invoker.resources, root_build_dir)
args = [
"--inputs=${rebased_resources}",
- "--inputs-base-dir", rebase_path(invoker.res_dir, root_build_dir),
- "--outputs-zip", rebase_path(_resources_zip, root_build_dir),
- "--depfile", rebase_path(depfile, root_build_dir),
+ "--inputs-base-dir",
+ rebase_path(invoker.res_dir, root_build_dir),
+ "--outputs-zip",
+ rebase_path(_resources_zip, root_build_dir),
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
]
if (defined(invoker.variables)) {
variables = invoker.variables
- args += ["--variables=${variables}" ]
+ args += [ "--variables=${variables}" ]
}
}
@@ -487,7 +530,9 @@ template("jinja_template_resources") {
# custom_package = "org.chromium.foo"
# }
template("android_resources") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
assert(defined(invoker.resource_dirs))
assert(defined(invoker.android_manifest) || defined(invoker.custom_package))
@@ -501,9 +546,15 @@ template("android_resources") {
type = "android_resources"
resources_zip = zip_path
srcjar = srcjar_path
- if (defined(invoker.deps)) { deps = invoker.deps }
- if (defined(invoker.android_manifest)) { android_manifest = invoker.android_manifest }
- if (defined(invoker.custom_package)) { custom_package = invoker.custom_package }
+ if (defined(invoker.deps)) {
+ deps = invoker.deps
+ }
+ if (defined(invoker.android_manifest)) {
+ android_manifest = invoker.android_manifest
+ }
+ if (defined(invoker.custom_package)) {
+ custom_package = invoker.custom_package
+ }
}
android_manifest = "//build/android/AndroidManifest.xml"
@@ -534,7 +585,6 @@ template("android_resources") {
}
}
-
# Declare a target that generates localized strings.xml from a .grd file.
#
# If this target is included in the deps of an android resources/library/apk,
@@ -550,7 +600,9 @@ template("android_resources") {
# grd_file = "foo_strings.grd"
# }
template("java_strings_grd") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
base_path = "$target_gen_dir/$target_name"
resources_zip = base_path + ".resources.zip"
@@ -570,7 +622,8 @@ template("java_strings_grd") {
grit_output_dir = "$target_gen_dir/$extra_output_path"
grit(grit_target_name) {
grit_flags = [
- "-E", "ANDROID_JAVA_TAGGED_ONLY=false",
+ "-E",
+ "ANDROID_JAVA_TAGGED_ONLY=false",
]
output_dir = grit_output_dir
resource_ids = ""
@@ -613,7 +666,9 @@ template("java_strings_grd") {
# ]
# }
template("java_strings_grd_prebuilt") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
base_path = "$target_gen_dir/$target_name"
resources_zip = base_path + ".resources.zip"
@@ -673,21 +728,38 @@ template("java_binary") {
# TODO(cjhopman): This should not act like a java_library for dependents (i.e.
# dependents shouldn't get the jar in their classpath, etc.).
java_library_impl(target_name) {
- if (defined(invoker.DEPRECATED_java_in_dir)) { DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir }
- if (defined(invoker.chromium_code)) { chromium_code = invoker.chromium_code }
- if (defined(invoker.datadeps)) { deps = invoker.datadeps }
- if (defined(invoker.deps)) { deps = invoker.deps }
- if (defined(invoker.java_files)) { java_files = invoker.java_files }
- if (defined(invoker.srcjar_deps)) { srcjar_deps = invoker.srcjar_deps }
- if (defined(invoker.srcjars)) { srcjars = invoker.srcjars }
- if (defined(invoker.bypass_platform_checks)) { bypass_platform_checks = invoker.bypass_platform_checks }
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.DEPRECATED_java_in_dir)) {
+ DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir
+ }
+ if (defined(invoker.chromium_code)) {
+ chromium_code = invoker.chromium_code
+ }
+ if (defined(invoker.datadeps)) {
+ deps = invoker.datadeps
+ }
+ if (defined(invoker.deps)) {
+ deps = invoker.deps
+ }
+ if (defined(invoker.java_files)) {
+ java_files = invoker.java_files
+ }
+ if (defined(invoker.srcjar_deps)) {
+ srcjar_deps = invoker.srcjar_deps
+ }
+ if (defined(invoker.srcjars)) {
+ srcjars = invoker.srcjars
+ }
+ if (defined(invoker.bypass_platform_checks)) {
+ bypass_platform_checks = invoker.bypass_platform_checks
+ }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
main_class = invoker.main_class
}
}
-
# Declare an java library target
#
# Variables
@@ -739,19 +811,45 @@ template("java_binary") {
# }
template("java_library") {
java_library_impl(target_name) {
- if (defined(invoker.DEPRECATED_java_in_dir)) { DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir }
- if (defined(invoker.chromium_code)) { chromium_code = invoker.chromium_code }
- if (defined(invoker.datadeps)) { deps = invoker.datadeps }
- if (defined(invoker.deps)) { deps = invoker.deps }
- if (defined(invoker.jar_excluded_patterns)) { jar_excluded_patterns = invoker.jar_excluded_patterns }
- if (defined(invoker.java_files)) { java_files = invoker.java_files }
- if (defined(invoker.proguard_config)) { proguard_config = invoker.proguard_config }
- if (defined(invoker.proguard_preprocess)) { proguard_preprocess = invoker.proguard_preprocess }
- if (defined(invoker.srcjar_deps)) { srcjar_deps = invoker.srcjar_deps }
- if (defined(invoker.srcjars)) { srcjars = invoker.srcjars }
- if (defined(invoker.bypass_platform_checks)) { bypass_platform_checks = invoker.bypass_platform_checks }
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
- if (defined(invoker.jar_path)) { jar_path = invoker.jar_path }
+ if (defined(invoker.DEPRECATED_java_in_dir)) {
+ DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir
+ }
+ if (defined(invoker.chromium_code)) {
+ chromium_code = invoker.chromium_code
+ }
+ if (defined(invoker.datadeps)) {
+ deps = invoker.datadeps
+ }
+ if (defined(invoker.deps)) {
+ deps = invoker.deps
+ }
+ if (defined(invoker.jar_excluded_patterns)) {
+ jar_excluded_patterns = invoker.jar_excluded_patterns
+ }
+ if (defined(invoker.java_files)) {
+ java_files = invoker.java_files
+ }
+ if (defined(invoker.proguard_config)) {
+ proguard_config = invoker.proguard_config
+ }
+ if (defined(invoker.proguard_preprocess)) {
+ proguard_preprocess = invoker.proguard_preprocess
+ }
+ if (defined(invoker.srcjar_deps)) {
+ srcjar_deps = invoker.srcjar_deps
+ }
+ if (defined(invoker.srcjars)) {
+ srcjars = invoker.srcjars
+ }
+ if (defined(invoker.bypass_platform_checks)) {
+ bypass_platform_checks = invoker.bypass_platform_checks
+ }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
+ if (defined(invoker.jar_path)) {
+ jar_path = invoker.jar_path
+ }
if (defined(invoker.supports_android) && invoker.supports_android) {
supports_android = true
@@ -759,7 +857,6 @@ template("java_library") {
}
}
-
# Declare an java library target for a prebuilt jar
#
# Variables
@@ -781,10 +878,18 @@ template("java_library") {
template("java_prebuilt") {
java_prebuilt_impl(target_name) {
jar_path = invoker.jar_path
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
- if (defined(invoker.deps)) { deps = invoker.deps }
- if (defined(invoker.proguard_config)) { proguard_config = invoker.proguard_config }
- if (defined(invoker.proguard_preprocess)) { proguard_preprocess = invoker.proguard_preprocess }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
+ if (defined(invoker.deps)) {
+ deps = invoker.deps
+ }
+ if (defined(invoker.proguard_config)) {
+ proguard_config = invoker.proguard_config
+ }
+ if (defined(invoker.proguard_preprocess)) {
+ proguard_preprocess = invoker.proguard_preprocess
+ }
}
}
@@ -835,29 +940,59 @@ template("java_prebuilt") {
# }
template("android_library") {
assert(!defined(invoker.jar_path),
- "android_library does not support a custom jar path")
+ "android_library does not support a custom jar path")
java_library_impl(target_name) {
- if (defined(invoker.DEPRECATED_java_in_dir)) { DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir }
- if (defined(invoker.chromium_code)) { chromium_code = invoker.chromium_code }
- if (defined(invoker.datadeps)) { deps = invoker.datadeps }
- if (defined(invoker.deps)) { deps = invoker.deps }
- if (defined(invoker.jar_excluded_patterns)) { jar_excluded_patterns = invoker.jar_excluded_patterns }
- if (defined(invoker.java_files)) { java_files = invoker.java_files }
- if (defined(invoker.proguard_config)) { proguard_config = invoker.proguard_config }
- if (defined(invoker.proguard_preprocess)) { proguard_preprocess = invoker.proguard_preprocess }
- if (defined(invoker.srcjar_deps)) { srcjar_deps = invoker.srcjar_deps }
- if (defined(invoker.srcjars)) { srcjars = invoker.srcjars }
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
- if (defined(invoker.visibility)) { visibility = invoker.visibility }
- if (defined(invoker.dex_path)) { dex_path = invoker.dex_path }
+ if (defined(invoker.DEPRECATED_java_in_dir)) {
+ DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir
+ }
+ if (defined(invoker.chromium_code)) {
+ chromium_code = invoker.chromium_code
+ }
+ if (defined(invoker.datadeps)) {
+ deps = invoker.datadeps
+ }
+ if (defined(invoker.deps)) {
+ deps = invoker.deps
+ }
+ if (defined(invoker.jar_excluded_patterns)) {
+ jar_excluded_patterns = invoker.jar_excluded_patterns
+ }
+ if (defined(invoker.java_files)) {
+ java_files = invoker.java_files
+ }
+ if (defined(invoker.proguard_config)) {
+ proguard_config = invoker.proguard_config
+ }
+ if (defined(invoker.proguard_preprocess)) {
+ proguard_preprocess = invoker.proguard_preprocess
+ }
+ if (defined(invoker.srcjar_deps)) {
+ srcjar_deps = invoker.srcjar_deps
+ }
+ if (defined(invoker.srcjars)) {
+ srcjars = invoker.srcjars
+ }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
+ if (defined(invoker.visibility)) {
+ visibility = invoker.visibility
+ }
+ if (defined(invoker.dex_path)) {
+ dex_path = invoker.dex_path
+ }
supports_android = true
requires_android = true
- if (!defined(jar_excluded_patterns)) { jar_excluded_patterns = [] }
+ if (!defined(jar_excluded_patterns)) {
+ jar_excluded_patterns = []
+ }
jar_excluded_patterns += [
- "*/R.class", "*/R##*.class",
- "*/Manifest.class", "*/Manifest##*.class",
+ "*/R.class",
+ "*/R##*.class",
+ "*/Manifest.class",
+ "*/Manifest##*.class",
]
}
}
@@ -889,15 +1024,21 @@ template("android_java_prebuilt") {
jar_path = invoker.jar_path
supports_android = true
requires_android = true
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
- if (defined(invoker.deps)) { deps = invoker.deps }
- if (defined(invoker.proguard_config)) { proguard_config = invoker.proguard_config }
- if (defined(invoker.proguard_preprocess)) { proguard_preprocess = invoker.proguard_preprocess }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
+ if (defined(invoker.deps)) {
+ deps = invoker.deps
+ }
+ if (defined(invoker.proguard_config)) {
+ proguard_config = invoker.proguard_config
+ }
+ if (defined(invoker.proguard_preprocess)) {
+ proguard_preprocess = invoker.proguard_preprocess
+ }
}
}
-
-
# Declare an Android apk target
#
# This target creates an Android APK containing java code, resources, assets,
@@ -947,7 +1088,9 @@ template("android_java_prebuilt") {
# ]
# }
template("android_apk") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
assert(defined(invoker.final_apk_path) || defined(invoker.apk_name))
gen_dir = "$target_gen_dir/$target_name"
@@ -964,10 +1107,10 @@ template("android_apk") {
} else if (defined(invoker.apk_name)) {
_final_apk_path = "$root_build_dir/apks/" + invoker.apk_name + ".apk"
}
- _dist_jar_path_list = process_file_template(
- [ _final_apk_path ],
- "$root_build_dir/test.lib.java/{{source_name_part}}.jar"
- )
+ _dist_jar_path_list =
+ process_file_template(
+ [ _final_apk_path ],
+ "$root_build_dir/test.lib.java/{{source_name_part}}.jar")
_dist_jar_path = _dist_jar_path_list[0]
_native_libs = []
@@ -992,35 +1135,35 @@ template("android_apk") {
if (defined(invoker.native_libs)) {
_use_chromium_linker = false
if (defined(invoker.use_chromium_linker)) {
- _use_chromium_linker = (invoker.use_chromium_linker &&
- chromium_linker_supported)
+ _use_chromium_linker =
+ invoker.use_chromium_linker && chromium_linker_supported
}
if (defined(invoker.load_library_from_apk) &&
invoker.load_library_from_apk) {
_load_library_from_apk = true
- assert(_use_chromium_linker, "Loading library from the apk requires use" +
- " of the Chromium linker.")
+ assert(_use_chromium_linker,
+ "Loading library from the apk requires use" +
+ " of the Chromium linker.")
}
_enable_relocation_packing = false
if (defined(invoker.enable_relocation_packing) &&
invoker.enable_relocation_packing) {
_enable_relocation_packing = relocation_packing_supported
- assert(_use_chromium_linker, "Relocation packing requires use of the" +
- " Chromium linker.")
+ assert(_use_chromium_linker,
+ "Relocation packing requires use of the" + " Chromium linker.")
}
_native_libs = process_file_template(
- invoker.native_libs,
- "$root_build_dir/lib.stripped/{{source_file_part}}")
+ invoker.native_libs,
+ "$root_build_dir/lib.stripped/{{source_file_part}}")
_native_libs_dir = base_path + "/libs"
if (_use_chromium_linker) {
- _native_libs += [
- "$root_build_dir/lib.stripped/libchromium_android_linker.so"
- ]
+ _native_libs +=
+ [ "$root_build_dir/lib.stripped/libchromium_android_linker.so" ]
}
_enable_relocation_packing = false
@@ -1047,16 +1190,16 @@ template("android_apk") {
final_deps = []
- final_deps += [":${_template_name}__process_resources"]
+ final_deps += [ ":${_template_name}__process_resources" ]
process_resources("${_template_name}__process_resources") {
srcjar_path = "${target_gen_dir}/${target_name}.srcjar"
android_manifest = invoker.android_manifest
- resource_dirs = ["//build/android/ant/empty/res"]
+ resource_dirs = [ "//build/android/ant/empty/res" ]
zip_path = resources_zip_path
generate_constant_ids = true
build_config = _build_config
}
- _srcjar_deps += [":${_template_name}__process_resources"]
+ _srcjar_deps += [ ":${_template_name}__process_resources" ]
if (_native_libs != []) {
_enable_chromium_linker_tests = false
@@ -1077,17 +1220,17 @@ template("android_apk") {
defines = [
"NATIVE_LIBRARIES_LIST=" +
- "@FileArg($_rebased_build_config:native:java_libraries_list)",
+ "@FileArg($_rebased_build_config:native:java_libraries_list)",
"NATIVE_LIBRARIES_VERSION_NUMBER=\"$_native_lib_version_name\"",
]
if (_use_chromium_linker) {
- defines += ["ENABLE_CHROMIUM_LINKER"]
+ defines += [ "ENABLE_CHROMIUM_LINKER" ]
}
if (_load_library_from_apk) {
- defines += ["ENABLE_CHROMIUM_LINKER_LIBRARY_IN_ZIP_FILE"]
+ defines += [ "ENABLE_CHROMIUM_LINKER_LIBRARY_IN_ZIP_FILE" ]
}
if (_enable_chromium_linker_tests) {
- defines += ["ENABLE_CHROMIUM_LINKER_TESTS"]
+ defines += [ "ENABLE_CHROMIUM_LINKER_TESTS" ]
}
}
_srcjar_deps += [ ":${_template_name}__native_libraries_java" ]
@@ -1113,35 +1256,44 @@ template("android_apk") {
if (_dist_jar_path != "") {
final_deps += [ ":${_template_name}__create_dist_jar" ]
+
# TODO(cjhopman): This is only ever needed to calculate the list of tests to
# run. See build/android/pylib/instrumentation/test_jar.py. We should be
# able to just do that calculation at build time instead.
action("${_template_name}__create_dist_jar") {
script = "//build/android/gyp/create_dist_jar.py"
depfile = "$target_gen_dir/$target_name.d"
- inputs = [ _build_config ]
+ inputs = [
+ _build_config,
+ ]
outputs = [
depfile,
_dist_jar_path,
]
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
- "--output", rebase_path(_dist_jar_path, root_build_dir),
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--output",
+ rebase_path(_dist_jar_path, root_build_dir),
"--inputs=@FileArg($_rebased_build_config:dist_jar:dependency_jars)",
]
inputs += [ jar_path ]
_rebased_jar_path = rebase_path([ jar_path ], root_build_dir)
- args += [
- "--inputs=$_rebased_jar_path",
- ]
+ args += [ "--inputs=$_rebased_jar_path" ]
}
}
- final_deps += [":${_template_name}__final_dex"]
+ final_deps += [ ":${_template_name}__final_dex" ]
dex("${_template_name}__final_dex") {
- deps = [ ":${_template_name}__java" ]
- sources = [ jar_path ]
- inputs = [ _build_config ]
+ deps = [
+ ":${_template_name}__java",
+ ]
+ sources = [
+ jar_path,
+ ]
+ inputs = [
+ _build_config,
+ ]
output = final_dex_path
dex_arg_key = "${_rebased_build_config}:apk_dex:dependency_dex_files"
args = [ "--inputs=@FileArg($dex_arg_key)" ]
@@ -1152,11 +1304,9 @@ template("android_apk") {
script = "//build/android/gyp/pack_arm_relocations.py"
packed_libraries_dir = "$_native_libs_dir/$android_app_abi"
depfile = "$target_gen_dir/$target_name.d"
- outputs = [
- depfile
- ]
+ outputs = [ depfile ]
inputs = [
- _build_config
+ _build_config,
]
deps = []
skip_packing_list = [
@@ -1167,35 +1317,36 @@ template("android_apk") {
enable_packing_arg = 0
if (_enable_relocation_packing) {
enable_packing_arg = 1
- deps += [
- relocation_packer_target
- ]
+ deps += [ relocation_packer_target ]
}
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
"--enable-packing=$enable_packing_arg",
"--has-relocations-with-addends=$relocations_have_addends",
"--exclude-packing-list=$skip_packing_list",
- "--android-pack-relocations", rebase_path(relocation_packer_exe, root_build_dir),
- "--android-objcopy", rebase_path(android_objcopy, root_build_dir),
- "--stripped-libraries-dir", rebase_path(root_build_dir, root_build_dir),
- "--packed-libraries-dir", rebase_path(packed_libraries_dir, root_build_dir),
+ "--android-pack-relocations",
+ rebase_path(relocation_packer_exe, root_build_dir),
+ "--android-objcopy",
+ rebase_path(android_objcopy, root_build_dir),
+ "--stripped-libraries-dir",
+ rebase_path(root_build_dir, root_build_dir),
+ "--packed-libraries-dir",
+ rebase_path(packed_libraries_dir, root_build_dir),
"--libraries=@FileArg(${_rebased_build_config}:native:libraries)",
- "--clear-dir"
+ "--clear-dir",
]
if (is_debug) {
rebased_gdbserver = rebase_path([ android_gdbserver ], root_build_dir)
inputs += [ android_gdbserver ]
- args += [
- "--libraries=$rebased_gdbserver"
- ]
+ args += [ "--libraries=$rebased_gdbserver" ]
}
}
}
- final_deps += [":${_template_name}__create"]
+ final_deps += [ ":${_template_name}__create" ]
create_apk("${_template_name}__create") {
apk_path = _final_apk_path
android_manifest = invoker.android_manifest
@@ -1220,6 +1371,7 @@ template("android_apk") {
deps = []
if (defined(invoker.asset_location)) {
asset_location = invoker.asset_location
+
# We don't know the exact dependencies that create the assets in
# |asset_location|; we depend on all caller deps until a better solution
# is figured out (http://crbug.com/433330).
@@ -1230,7 +1382,7 @@ template("android_apk") {
if (_native_libs != []) {
native_libs_dir = _native_libs_dir
- deps += [":${_template_name}__prepare_native"]
+ deps += [ ":${_template_name}__prepare_native" ]
}
}
@@ -1243,7 +1395,6 @@ template("android_apk") {
}
}
-
# Declare an Android gtest apk
#
# This target creates an Android apk for running gtest-based unittests.
@@ -1281,12 +1432,13 @@ template("unittest_apk") {
android_apk(target_name) {
_apk_name = test_suite_name
final_apk_path = "$root_build_dir/${_apk_name}_apk/${_apk_name}-debug.apk"
- java_files = [
- "//testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java"
- ]
+ java_files =
+ [ "//testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java" ]
android_manifest = "//testing/android/java/AndroidManifest.xml"
native_libs = [ unittests_binary ]
- deps = [ "//base:base_java" ]
+ deps = [
+ "//base:base_java",
+ ]
if (defined(invoker.deps)) {
deps += invoker.deps
}
@@ -1317,7 +1469,9 @@ template("unittest_apk") {
# ]
# }
template("android_aidl") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
srcjar_path = "${target_gen_dir}/${target_name}.srcjar"
aidl_path = "${android_sdk_build_tools}/aidl"
@@ -1333,35 +1487,35 @@ template("android_aidl") {
imports += [ invoker.interface_file ]
}
- inputs = [
- aidl_path,
- ] + imports
+ inputs = [ aidl_path ] + imports
depfile = "${target_gen_dir}/${target_name}.d"
outputs = [
depfile,
- srcjar_path
+ srcjar_path,
]
rebased_imports = rebase_path(imports, root_build_dir)
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
- "--aidl-path", rebase_path(aidl_path, root_build_dir),
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--aidl-path",
+ rebase_path(aidl_path, root_build_dir),
"--imports=$rebased_imports",
- "--srcjar", rebase_path(srcjar_path, root_build_dir),
+ "--srcjar",
+ rebase_path(srcjar_path, root_build_dir),
]
if (defined(invoker.import_include) && invoker.import_include != "") {
# TODO(cjhopman): aidl supports creating a depfile. We should be able to
# switch to constructing a depfile for the overall action from that
# instead of having all the .java files in the include paths as inputs.
- rebased_import_includes = rebase_path(
- [invoker.import_include], root_build_dir)
+ rebased_import_includes =
+ rebase_path([ invoker.import_include ], root_build_dir)
args += [ "--includes=$rebased_import_includes" ]
- _java_files_build_rel = exec_script(
- "//build/android/gyp/find.py",
- rebase_path([invoker.import_include], root_build_dir),
- "list lines"
- )
+ _java_files_build_rel =
+ exec_script("//build/android/gyp/find.py",
+ rebase_path([ invoker.import_include ], root_build_dir),
+ "list lines")
_java_files = rebase_path(_java_files_build_rel, ".", root_build_dir)
inputs += _java_files
}
@@ -1390,14 +1544,17 @@ template("android_aidl") {
# binary = "$root_build_dir/exe.stripped/foo"
# }
template("create_native_executable_dist") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
dist_dir = invoker.dist_dir
binary = invoker.binary
final_deps = []
template_name = target_name
- libraries_list = "${target_gen_dir}/${template_name}_library_dependencies.list"
+ libraries_list =
+ "${target_gen_dir}/${template_name}_library_dependencies.list"
# TODO(gyp)
#'dependencies': [
@@ -1419,11 +1576,15 @@ template("create_native_executable_dist") {
]
rebased_binaries = rebase_path([ binary ], root_build_dir)
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
"--input-libraries=$rebased_binaries",
- "--libraries-dir", rebase_path(stripped_libraries_dir, root_build_dir),
- "--output", rebase_path(libraries_list, root_build_dir),
- "--readelf", rebase_path(android_readelf, root_build_dir),
+ "--libraries-dir",
+ rebase_path(stripped_libraries_dir, root_build_dir),
+ "--output",
+ rebase_path(libraries_list, root_build_dir),
+ "--readelf",
+ rebase_path(android_readelf, root_build_dir),
]
}
@@ -1432,7 +1593,7 @@ template("create_native_executable_dist") {
clear_dir = true
inputs = [
binary,
- libraries_list
+ libraries_list,
]
dest = dist_dir
rebased_binaries_list = rebase_path([ binary ], root_build_dir)
@@ -1448,7 +1609,6 @@ template("create_native_executable_dist") {
}
}
-
# Compile a protocol buffer to java.
#
# This generates java files from protocol buffers and creates an Android library
@@ -1475,7 +1635,7 @@ template("proto_java_library") {
srcjar_path = "$target_gen_dir/$target_name.srcjar"
script = "//build/protoc_java.py"
deps = [
- _protoc_dep
+ _protoc_dep,
]
sources = invoker.sources
depfile = "$target_gen_dir/$target_name.d"
@@ -1484,11 +1644,15 @@ template("proto_java_library") {
srcjar_path,
]
args = [
- "--depfile", rebase_path(depfile, root_build_dir),
- "--protoc", rebase_path(_protoc_bin, root_build_dir),
- "--proto-path", rebase_path(_proto_path, root_build_dir),
- "--srcjar", rebase_path(srcjar_path, root_build_dir),
- ] + rebase_path(sources, root_build_dir)
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--protoc",
+ rebase_path(_protoc_bin, root_build_dir),
+ "--proto-path",
+ rebase_path(_proto_path, root_build_dir),
+ "--srcjar",
+ rebase_path(srcjar_path, root_build_dir),
+ ] + rebase_path(sources, root_build_dir)
}
android_library(target_name) {
@@ -1502,7 +1666,9 @@ template("proto_java_library") {
# TODO(GYP): implement this.
template("uiautomator_test") {
- if (defined(invoker.testonly)) { testonly = invoker.testonly }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
assert(target_name != "")
assert(invoker.deps != [] || true)
group(target_name) {
diff --git a/build/config/arm.gni b/build/config/arm.gni
index 59de668..d942c3b 100644
--- a/build/config/arm.gni
+++ b/build/config/arm.gni
@@ -22,10 +22,8 @@ if (cpu_arch == "arm") {
arm_use_neon = true
}
- assert(arm_float_abi == "" ||
- arm_float_abi == "hard" ||
- arm_float_abi == "soft" ||
- arm_float_abi == "softfp")
+ assert(arm_float_abi == "" || arm_float_abi == "hard" ||
+ arm_float_abi == "soft" || arm_float_abi == "softfp")
if (is_android) {
arm_use_neon = false
@@ -41,10 +39,10 @@ if (cpu_arch == "arm") {
arm_float_abi = "softfp"
}
arm_fpu = "vfp"
+
# Thumb is a reduced instruction set available on some ARM processors that
# has increased code density.
arm_use_thumb = false
-
} else if (arm_version == 7) {
arm_arch = "armv7-a"
if (arm_tune == "") {
diff --git a/build/config/clang/BUILD.gn b/build/config/clang/BUILD.gn
index 00fb9e0..39fe251 100644
--- a/build/config/clang/BUILD.gn
+++ b/build/config/clang/BUILD.gn
@@ -7,23 +7,26 @@ import("clang.gni")
config("find_bad_constructs") {
if (clang_use_chrome_plugins) {
cflags = [
- "-Xclang", "-load",
+ "-Xclang",
+ "-load",
"-Xclang",
]
if (is_mac || is_ios) {
cflags += [ rebase_path(
- "//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib",
- root_build_dir) ]
+ "//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib",
+ root_build_dir) ]
} else if (is_linux) {
cflags += [ rebase_path(
- "//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so",
- root_build_dir) ]
+ "//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so",
+ root_build_dir) ]
}
cflags += [
- "-Xclang", "-add-plugin",
- "-Xclang", "find-bad-constructs",
+ "-Xclang",
+ "-add-plugin",
+ "-Xclang",
+ "find-bad-constructs",
]
}
}
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 31058fa..0b00e1a 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -90,19 +90,16 @@ config("compiler") {
"/FS", # Preserve previous PDB behavior.
]
if (is_component_build) {
- cflags += [
- "/EHsc", # Assume C functions can't throw exceptions and don't catch
- # structured exceptions (only C++ ones).
- ]
+ cflags += [ "/EHsc" ] # Assume C functions can't throw exceptions and don't catch
+ # structured exceptions (only C++ ones).
}
} else {
# Common GCC compiler flags setup.
# --------------------------------
- cflags += [
- "-fno-strict-aliasing", # See http://crbug.com/32204
- ]
+ cflags += [ "-fno-strict-aliasing" ] # See http://crbug.com/32204
cflags_cc += [
"-fno-threadsafe-statics",
+
# Not exporting C++ inline functions can generally be applied anywhere
# so we do so here. Normal function visibility is controlled by
# //build/config/gcc:symbol_visibility_hidden.
@@ -113,7 +110,10 @@ config("compiler") {
if (is_mac) {
cflags += [ "-fstack-protector-all" ]
} else if (is_linux) {
- cflags += [ "-fstack-protector", "--param=ssp-buffer-size=4" ]
+ cflags += [
+ "-fstack-protector",
+ "--param=ssp-buffer-size=4",
+ ]
}
# Linker warnings.
@@ -155,11 +155,10 @@ config("compiler") {
# when turning clang on or off. (defines are passed via the command line,
# and build system rebuild things when their commandline changes). Nothing
# should ever read this define.
- defines += [
- "CR_CLANG_REVISION=" +
- exec_script(
- "//tools/clang/scripts/posix-print-revision.py", [], "value")
- ]
+ defines += [ "CR_CLANG_REVISION=" +
+ exec_script("//tools/clang/scripts/posix-print-revision.py",
+ [],
+ "value") ]
}
# Mac-specific compiler flags setup.
@@ -170,16 +169,22 @@ config("compiler") {
# CPU architecture.
if (cpu_arch == "x64") {
- common_mac_flags += [ "-arch", "x86_64" ]
+ common_mac_flags += [
+ "-arch",
+ "x86_64",
+ ]
} else if (cpu_arch == "x86") {
- common_mac_flags += [ "-arch", "i386" ]
+ common_mac_flags += [
+ "-arch",
+ "i386",
+ ]
}
cflags += common_mac_flags
# Without this, the constructors and destructors of a C++ object inside
# an Objective C struct won't be called, which is very bad.
- cflags_objcc = [ "-fobjc-call-cxx-cdtors", ]
+ cflags_objcc = [ "-fobjc-call-cxx-cdtors" ]
cflags_c += [ "-std=c99" ]
cflags_cc += [ "-std=gnu++11" ]
@@ -189,9 +194,7 @@ config("compiler") {
# Non-Mac Posix compiler flags setup.
# -----------------------------------
if (gcc_version >= 48) {
- cflags_cc += [
- "-std=gnu++11",
- ]
+ cflags_cc += [ "-std=gnu++11" ]
}
if (enable_profiling && !is_debug) {
@@ -216,7 +219,10 @@ config("compiler") {
# CPU architecture. We may or may not be doing a cross compile now, so for
# simplicity we always explicitly set the architecture.
if (cpu_arch == "x64") {
- cflags += [ "-m64", "-march=x86-64", ]
+ cflags += [
+ "-m64",
+ "-march=x86-64",
+ ]
ldflags += [ "-m64" ]
} else if (cpu_arch == "x86") {
cflags += [ "-m32" ]
@@ -226,6 +232,7 @@ config("compiler") {
# Else building libyuv gives clang's register allocator issues,
# see llvm.org/PR15798 / crbug.com/233709
"-momit-leaf-frame-pointer",
+
# Align the stack on 16-byte boundaries, http://crbug.com/418554.
"-mstack-alignment=16",
"-mstackrealign",
@@ -257,6 +264,7 @@ config("compiler") {
# compiler (r5-r7). This can be verified using
# webkit_unit_tests' WTF.Checked_int8_t test.
"-fno-tree-sra",
+
# The following option is disabled to improve binary
# size and performance in gcc 4.9.
"-fno-caller-saves",
@@ -299,9 +307,7 @@ config("compiler") {
# ------------------------------------
if (is_linux) {
cflags += [ "-pthread" ]
- ldflags += [
- "-pthread",
- ]
+ ldflags += [ "-pthread" ]
}
if (use_gold) {
# Use gold for linking on 64-bit Linux only (on 32-bit it runs out of
@@ -340,12 +346,8 @@ config("compiler") {
# Clang-specific compiler flags setup.
# ------------------------------------
if (is_clang) {
- cflags += [
- "-fcolor-diagnostics",
- ]
- cflags_cc += [
- "-std=gnu++11",
- ]
+ cflags += [ "-fcolor-diagnostics" ]
+ cflags_cc += [ "-std=gnu++11" ]
}
# Android-specific flags setup.
@@ -358,9 +360,7 @@ config("compiler") {
]
if (!is_clang) {
# Clang doesn't support these flags.
- cflags += [
- "-finline-limit=64",
- ]
+ cflags += [ "-finline-limit=64" ]
}
if (is_android_webview_build) {
# Android predefines this as 1; undefine it here so Chromium can redefine
@@ -391,13 +391,14 @@ config("compiler") {
ldflags += [ "-fuse-ld=gold" ]
if (is_clang) {
# Let clang find the ld.gold in the NDK.
- ldflags += [ "--gcc-toolchain=" + rebase_path(android_toolchain_root,
- root_build_dir) ]
+ ldflags += [ "--gcc-toolchain=" +
+ rebase_path(android_toolchain_root, root_build_dir) ]
}
}
ldflags += [
"-Wl,--no-undefined",
+
# Don't export symbols from statically linked libraries.
"-Wl,--exclude-libs=ALL",
]
@@ -410,9 +411,7 @@ config("compiler") {
if (is_clang) {
if (cpu_arch == "arm") {
- cflags += [
- "-target arm-linux-androideabi",
- ]
+ cflags += [ "-target arm-linux-androideabi" ]
ldflags += [ "-target arm-linux-androideabi" ]
} else if (cpu_arch == "x86") {
cflags += [ "-target x86-linux-androideabi" ]
@@ -424,9 +423,7 @@ config("compiler") {
config("compiler_arm_fpu") {
if (cpu_arch == "arm" && !is_android_webview_build) {
- cflags = [
- "-mfpu=$arm_fpu",
- ]
+ cflags = [ "-mfpu=$arm_fpu" ]
}
}
@@ -513,10 +510,8 @@ config("runtime_library") {
# caution.
android_stlport_root = "$android_ndk_root/sources/cxx-stl/stlport"
- cflags += [
- "-isystem" + rebase_path("$android_stlport_root/stlport",
- root_build_dir)
- ]
+ cflags += [ "-isystem" +
+ rebase_path("$android_stlport_root/stlport", root_build_dir) ]
if (cpu_arch == "arm" && arm_use_thumb) {
lib_dirs += [ "$android_stlport_root/libs/$android_app_abi/thumb" ]
} else {
@@ -550,7 +545,6 @@ config("runtime_library") {
"dl",
"m",
]
-
}
}
@@ -561,9 +555,7 @@ config("runtime_library") {
config("chromium_code") {
if (is_win) {
- cflags = [
- "/W4", # Warning level 4.
- ]
+ cflags = [ "/W4" ] # Warning level 4.
} else {
cflags = [
"-Wall",
@@ -661,8 +653,7 @@ config("no_rtti") {
config("default_warnings") {
if (is_win) {
cflags = [
- "/WX", # Treat warnings as errors.
-
+ "/WX", # Treat warnings as errors.
# Warnings permanently disabled:
# TODO(GYP) The GYP build doesn't have this globally enabled but disabled
@@ -717,8 +708,6 @@ config("default_warnings") {
# have to turn off this warning (and be careful about how object
# destruction happens in such cases).
"/wd4611",
-
-
# Warnings to evaluate and possibly fix/reenable later:
"/wd4100", # Unreferenced formal function parameter.
@@ -745,9 +734,7 @@ config("default_warnings") {
cflags_cc = []
if (is_mac) {
- cflags += [
- "-Wnewline-eof",
- ]
+ cflags += [ "-Wnewline-eof" ]
}
if (is_clang) {
@@ -785,6 +772,7 @@ config("default_warnings") {
cflags_cc += [
# See comment for -Wno-c++11-narrowing.
"-Wno-narrowing",
+
# TODO(thakis): Remove, http://crbug.com/263960
"-Wno-literal-suffix",
]
@@ -811,6 +799,7 @@ config("default_warnings") {
# correctly when building with the Android build system.
# TODO(torne): Fix this in WebKit.
"-Wno-error=c++0x-compat",
+
# Other things unrelated to -Wextra:
"-Wno-non-virtual-dtor",
"-Wno-sign-promo",
@@ -821,9 +810,7 @@ config("default_warnings") {
# Don't warn about the "typedef 'foo' locally defined but not used"
# for gcc 4.8.
# TODO: remove this flag once all builds work. See crbug.com/227506
- cflags += [
- "-Wno-unused-local-typedefs",
- ]
+ cflags += [ "-Wno-unused-local-typedefs" ]
}
}
}
@@ -854,7 +841,7 @@ if (is_win) {
"/O2",
"/Ob2", # both explicit and auto inlining.
"/Oy-", # disable omitting frame pointers, must be after /o2.
- "/Os", # favor size over speed.
+ "/Os", # favor size over speed.
]
common_optimize_on_ldflags = []
} else {
@@ -862,6 +849,7 @@ if (is_win) {
# Don't emit the GCC version ident directives, they just end up in the
# .comment section taking up binary size.
"-fno-ident",
+
# Put data and code in their own sections, so that unused symbols
# can be removed at link time with --gc-sections.
"-fdata-sections",
@@ -882,9 +870,7 @@ if (is_win) {
if (is_mac) {
if (symbol_level == 2) {
# Mac dead code stripping requires symbols.
- common_optimize_on_ldflags += [
- "-Wl,-dead_strip",
- ]
+ common_optimize_on_ldflags += [ "-Wl,-dead_strip" ]
}
} else {
# Non-Mac Posix linker flags.
@@ -903,17 +889,11 @@ config("optimize") {
cflags = common_optimize_on_cflags
ldflags = common_optimize_on_ldflags
if (is_win) {
- cflags += [
- "/Os", # favor size over speed.
- ]
+ cflags += [ "/Os" ] # favor size over speed.
} else if (is_android || is_ios) {
- cflags += [
- "-Os", # Favor size over speed.
- ]
+ cflags += [ "-Os" ] # Favor size over speed.
} else {
- cflags += [
- "-O2",
- ]
+ cflags += [ "-O2" ]
}
}
@@ -949,32 +929,25 @@ config("optimize_max") {
cflags = common_optimize_on_cflags
ldflags = common_optimize_on_ldflags
if (is_win) {
- cflags -= [
- "/Os",
- ]
- cflags += [
- "/Ot", # Favor speed over size.
- ]
+ cflags -= [ "/Os" ]
+ cflags += [ "/Ot" ] # Favor speed over size.
if (is_official_build) {
# TODO(GYP): TODO(dpranke): Should these only be on in an official
# build, or on all the time? For now we'll require official build so
# that the compile is clean.
cflags += [
- "/GL", # Whole program optimization.
+ "/GL", # Whole program optimization.
+
# Disable Warning 4702 ("Unreachable code") for the WPO/PGO builds.
# Probably anything that this would catch that wouldn't be caught in a
# normal build isn't going to actually be a bug, so the incremental
# value of C4702 for PGO builds is likely very small.
"/wd4702",
]
- ldflags += [
- "/LTCG",
- ]
+ ldflags += [ "/LTCG" ]
}
} else {
- cflags += [
- "-O2",
- ]
+ cflags += [ "-O2" ]
}
}
diff --git a/build/config/features.gni b/build/config/features.gni
index 2426af0..ac48896 100644
--- a/build/config/features.gni
+++ b/build/config/features.gni
@@ -75,7 +75,7 @@ enable_print_preview = !is_android
# Do not disable seccomp_bpf anywhere without talking to
# security@chromium.org!
use_seccomp_bpf = (is_linux || is_android) &&
- (cpu_arch == "x86" || cpu_arch == "x64" || cpu_arch == "arm")
+ (cpu_arch == "x86" || cpu_arch == "x64" || cpu_arch == "arm")
# Enable notifications everywhere except iOS.
enable_notifications = !is_ios
@@ -83,11 +83,11 @@ enable_notifications = !is_ios
# TODO(brettw) this should be moved to net and only dependents get this define.
disable_ftp_support = is_ios
-enable_web_speech = (!is_android && !is_ios)
+enable_web_speech = !is_android && !is_ios
use_dbus = is_linux
-enable_extensions = (!is_android && !is_ios)
+enable_extensions = !is_android && !is_ios
# Variable safe_browsing is used to control the build time configuration for
# safe browsing feature. Safe browsing can be compiled in 3 different levels: 0
diff --git a/build/config/gcc/BUILD.gn b/build/config/gcc/BUILD.gn
index 28502c2..c6cfe72 100644
--- a/build/config/gcc/BUILD.gn
+++ b/build/config/gcc/BUILD.gn
@@ -23,7 +23,6 @@ config("executable_ldconfig") {
ldflags = [
# Want to pass "\$". GN will re-escape as required for ninja.
"-Wl,-rpath=\$ORIGIN/",
-
"-Wl,-rpath-link=",
# Newer binutils don't set DT_RPATH unless you disable "new" dtags
diff --git a/build/config/gcc/gcc_version.gni b/build/config/gcc/gcc_version.gni
index 1ff464a..2ecc54a 100644
--- a/build/config/gcc/gcc_version.gni
+++ b/build/config/gcc/gcc_version.gni
@@ -11,11 +11,21 @@ if (is_android) {
}
} else if (current_toolchain == "//build/toolchain/cros:target") {
# TODO(benchan): Generalize the check for platforms other than Chrome OS.
- gcc_version = exec_script("../../compiler_version.py", [ "target", "compiler" ], "value")
+ gcc_version = exec_script("../../compiler_version.py",
+ [
+ "target",
+ "compiler",
+ ],
+ "value")
} else if (current_toolchain == "//build/toolchain/linux:x64" ||
current_toolchain == "//build/toolchain/linux:x86") {
# These are both the same and just use the default gcc on the system.
- gcc_version = exec_script("../../compiler_version.py", [ "host", "compiler" ], "value")
+ gcc_version = exec_script("../../compiler_version.py",
+ [
+ "host",
+ "compiler",
+ ],
+ "value")
} else {
gcc_version = 0
}
diff --git a/build/config/ios/BUILD.gn b/build/config/ios/BUILD.gn
index 0886be4..471f28a 100644
--- a/build/config/ios/BUILD.gn
+++ b/build/config/ios/BUILD.gn
@@ -6,7 +6,10 @@ import("//build/config/sysroot.gni")
import("//build/config/ios/ios_sdk.gni")
config("sdk") {
- common_flags = [ "-isysroot", sysroot ]
+ common_flags = [
+ "-isysroot",
+ sysroot,
+ ]
cflags = common_flags
ldflags = common_flags
diff --git a/build/config/ios/ios_sdk.gni b/build/config/ios/ios_sdk.gni
index 6b81a03..cb2708b 100644
--- a/build/config/ios/ios_sdk.gni
+++ b/build/config/ios/ios_sdk.gni
@@ -25,6 +25,6 @@ if (ios_sdk_path == "") {
_ios_sdk_to_query = "iphoneos"
}
_ios_sdk_result =
- exec_script("ios_sdk.py", [ _ios_sdk_to_query ], "list lines")
+ exec_script("ios_sdk.py", [ _ios_sdk_to_query ], "list lines")
ios_sdk_path = _ios_sdk_result[0]
}
diff --git a/build/config/linux/BUILD.gn b/build/config/linux/BUILD.gn
index dec1017..e132116 100644
--- a/build/config/linux/BUILD.gn
+++ b/build/config/linux/BUILD.gn
@@ -8,11 +8,10 @@ import("//build/config/sysroot.gni")
import("//build/config/ui.gni")
import("//tools/generate_library_loader/generate_library_loader.gni")
-gypi_values = exec_script(
- "//build/gypi_to_gn.py",
- [ rebase_path("../../linux/system.gyp") ],
- "scope",
- [ "../../linux/system.gyp" ])
+gypi_values = exec_script("//build/gypi_to_gn.py",
+ [ rebase_path("../../linux/system.gyp") ],
+ "scope",
+ [ "../../linux/system.gyp" ])
config("sdk") {
if (sysroot != "") {
@@ -21,9 +20,12 @@ config("sdk") {
# Need to get some linker flags out of the sysroot.
ldflags += [ exec_script("sysroot_ld_path.py",
- [ rebase_path("//build/linux/sysroot_ld_path.sh", root_build_dir),
- sysroot ],
- "value") ]
+ [
+ rebase_path("//build/linux/sysroot_ld_path.sh",
+ root_build_dir),
+ sysroot,
+ ],
+ "value") ]
}
# Set here because OS_CHROMEOS cannot be autodetected in build_config.h like
@@ -42,7 +44,12 @@ pkg_config("freetype2") {
}
pkg_config("glib") {
- packages = [ "glib-2.0", "gmodule-2.0", "gobject-2.0", "gthread-2.0" ]
+ packages = [
+ "glib-2.0",
+ "gmodule-2.0",
+ "gobject-2.0",
+ "gthread-2.0",
+ ]
}
pkg_config("pangocairo") {
@@ -148,6 +155,7 @@ if (use_brlapi) {
pkg_config("gio_config") {
packages = [ "gio-2.0" ]
+
# glib >=2.40 deprecate g_settings_list_schemas in favor of
# g_settings_schema_source_list_schemas. This function is not available on
# earlier versions that we still need to support (specifically, 2.32), so
@@ -155,7 +163,10 @@ pkg_config("gio_config") {
# TODO(mgiuca): Remove this suppression when we drop support for Ubuntu 13.10
# (saucy) and earlier. Update the code to use
# g_settings_schema_source_list_schemas instead.
- defines = [ "USE_GIO", "GLIB_DISABLE_DEPRECATION_WARNINGS" ]
+ defines = [
+ "USE_GIO",
+ "GLIB_DISABLE_DEPRECATION_WARNINGS",
+ ]
# TODO(brettw) Theoretically I think ignore_libs should be set so that we
# don't link directly to GIO and use the loader generated below. But the gio
diff --git a/build/config/linux/pkg_config.gni b/build/config/linux/pkg_config.gni
index 687afc5..631d60a 100644
--- a/build/config/linux/pkg_config.gni
+++ b/build/config/linux/pkg_config.gni
@@ -39,16 +39,24 @@ pkg_config_script = "//build/config/linux/pkg-config.py"
# need to invoke it manually.
if (sysroot != "") {
# Pass the sysroot if we're using one (it requires the CPU arch also).
- pkg_config_args = ["-s", sysroot, "-a", cpu_arch]
+ pkg_config_args = [
+ "-s",
+ sysroot,
+ "-a",
+ cpu_arch,
+ ]
} else if (pkg_config != "") {
- pkg_config_args = ["-p", pkg_config]
+ pkg_config_args = [
+ "-p",
+ pkg_config,
+ ]
} else {
pkg_config_args = []
}
template("pkg_config") {
assert(defined(invoker.packages),
- "Variable |packages| must be defined to be a list in pkg_config.")
+ "Variable |packages| must be defined to be a list in pkg_config.")
config(target_name) {
args = pkg_config_args + invoker.packages
if (defined(invoker.extra_args)) {
diff --git a/build/config/mac/BUILD.gn b/build/config/mac/BUILD.gn
index 2ebf458..9288add 100644
--- a/build/config/mac/BUILD.gn
+++ b/build/config/mac/BUILD.gn
@@ -6,8 +6,9 @@ import("//build/config/sysroot.gni")
config("sdk") {
common_flags = [
- "-isysroot", sysroot,
- "-mmacosx-version-min=10.6"
+ "-isysroot",
+ sysroot,
+ "-mmacosx-version-min=10.6",
]
cflags = common_flags
@@ -19,8 +20,10 @@ config("mac_dynamic_flags") {
ldflags = [
"-Wl,-search_paths_first",
"-L.",
+
# Path for loading shared libraries for unbundled binaries.
"-Wl,-rpath,@loader_path/.",
+
# Path for loading shared libraries for bundled binaries. Get back from
# Binary.app/Contents/MacOS.
"-Wl,-rpath,@loader_path/../../..",
@@ -29,7 +32,5 @@ config("mac_dynamic_flags") {
# On Mac, this is used only for executables.
config("mac_executable_flags") {
- ldflags = [
- "-Wl,-pie", # Position independent.
- ]
+ ldflags = [ "-Wl,-pie" ] # Position independent.
}
diff --git a/build/config/mac/mac_sdk.gni b/build/config/mac/mac_sdk.gni
index aa03332..44995a3 100644
--- a/build/config/mac/mac_sdk.gni
+++ b/build/config/mac/mac_sdk.gni
@@ -14,10 +14,15 @@ declare_args() {
find_sdk_args = [ "--print_sdk_path" ]
if (is_chrome_branded && is_official_build) {
- find_sdk_args += [ "--verify", mac_sdk_min, "--sdk_path=" + mac_sdk_path ]
+ find_sdk_args += [
+ "--verify",
+ mac_sdk_min,
+ "--sdk_path=" + mac_sdk_path,
+ ]
} else {
find_sdk_args += [ mac_sdk_min ]
}
+
# The tool will print the SDK path on the first line, and the version on the
# second line.
find_sdk_lines =
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn
index 6012b48..63728d9 100644
--- a/build/config/sanitizers/BUILD.gn
+++ b/build/config/sanitizers/BUILD.gn
@@ -8,17 +8,24 @@
group("deps") {
if (is_asan) {
public_configs = [ ":sanitizer_options_link_helper" ]
- deps = [ ":options_sources" ]
+ deps = [
+ ":options_sources",
+ ]
}
}
config("sanitizer_options_link_helper") {
- ldflags = [ "-Wl,-u_sanitizer_options_link_helper", "-fsanitize=address" ]
+ ldflags = [
+ "-Wl,-u_sanitizer_options_link_helper",
+ "-fsanitize=address",
+ ]
}
source_set("options_sources") {
visibility = [ ":deps" ]
- sources = [ "//build/sanitizers/sanitizer_options.cc" ]
+ sources = [
+ "//build/sanitizers/sanitizer_options.cc",
+ ]
if (is_tsan) {
sources += [ "//build/sanitizers/tsan_suppressions.cc" ]
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
index f623064..bc2ea88 100644
--- a/build/config/win/BUILD.gn
+++ b/build/config/win/BUILD.gn
@@ -122,9 +122,7 @@ config("unicode") {
# to have a separate config for it. Remove this config from your target to
# get the "bloaty and accomodating" version of windows.h.
config("lean_and_mean") {
- defines = [
- "WIN32_LEAN_AND_MEAN",
- ]
+ defines = [ "WIN32_LEAN_AND_MEAN" ]
}
# Nominmax --------------------------------------------------------------------
@@ -134,7 +132,5 @@ config("lean_and_mean") {
# For such targets, this config can be removed.
config("nominmax") {
- defines = [
- "NOMINMAX",
- ]
+ defines = [ "NOMINMAX" ]
}
diff --git a/build/go/rules.gni b/build/go/rules.gni
index 55dd386..d4b1f50 100644
--- a/build/go/rules.gni
+++ b/build/go/rules.gni
@@ -40,23 +40,24 @@ template("go_test_binary") {
]
script = "//build/go/go.py"
outputs = [ "${target_out_dir}/${target_name}" ]
+
# Since go test does not permit specifying an output directory or output
# binary name, we create a temporary build directory, and the python
# script will later identify the output, copy it to the target location,
# and clean up the temporary build directory.
build_dir = "${target_out_dir}/${target_name}_build"
args = [
- "--",
- "${go_build_tool}",
- rebase_path(build_dir, root_build_dir),
- rebase_path(target_out_dir, root_build_dir) + "/${target_name}",
- rebase_path("//", root_build_dir),
- "-I" + rebase_path("//"),
- " -L" + rebase_path(target_out_dir) +
- " -l" + static_library_name +
- " -lstdc++ -lpthread -lm -lglib-2.0",
- "test", "-c",
- ] + rebase_path(invoker.sources, build_dir)
+ "--",
+ "${go_build_tool}",
+ rebase_path(build_dir, root_build_dir),
+ rebase_path(target_out_dir, root_build_dir) + "/${target_name}",
+ rebase_path("//", root_build_dir),
+ "-I" + rebase_path("//"),
+ " -L" + rebase_path(target_out_dir) + " -l" + static_library_name +
+ " -lstdc++ -lpthread -lm -lglib-2.0",
+ "test",
+ "-c",
+ ] + rebase_path(invoker.sources, build_dir)
}
}
@@ -74,24 +75,27 @@ template("go_shared_library") {
}
action(target_name) {
- deps = [ ":$static_library_name" ]
+ deps = [
+ ":$static_library_name",
+ ]
script = "//build/go/go.py"
outputs = [ "${target_out_dir}/${target_name}" ]
+
# Since go test does not permit specifying an output directory or output
# binary name, we create a temporary build directory, and the python
# script will later identify the output, copy it to the target location,
# and clean up the temporary build directory.
build_dir = "${target_out_dir}/${target_name}_build"
args = [
- "--",
- "CGO_ENABLED=1 GOOS=android GOARCH=arm GOARM=7 ${go_build_tool}",
- rebase_path(build_dir, root_build_dir),
- rebase_path(target_out_dir, root_build_dir) + "/${target_name}",
- rebase_path("//", root_build_dir),
- "-I" + rebase_path("//"),
- " -L" + rebase_path(target_out_dir) +
- " -l" + static_library_name + "",
- "build -ldflags=-shared",
- ] + rebase_path(invoker.sources, build_dir)
+ "--",
+ "CGO_ENABLED=1 GOOS=android GOARCH=arm GOARM=7 ${go_build_tool}",
+ rebase_path(build_dir, root_build_dir),
+ rebase_path(target_out_dir, root_build_dir) + "/${target_name}",
+ rebase_path("//", root_build_dir),
+ "-I" + rebase_path("//"),
+ " -L" + rebase_path(target_out_dir) + " -l" + static_library_name +
+ "",
+ "build -ldflags=-shared",
+ ] + rebase_path(invoker.sources, build_dir)
}
-} \ No newline at end of file
+}
diff --git a/build/json_schema_api.gni b/build/json_schema_api.gni
index 5857739..dd8ab92 100644
--- a/build/json_schema_api.gni
+++ b/build/json_schema_api.gni
@@ -57,8 +57,8 @@ template("json_schema_api") {
schemas = defined(invoker.schemas) && invoker.schemas
bundle = defined(invoker.bundle) && invoker.bundle
- bundle_registration = defined(invoker.bundle_registration) &&
- invoker.bundle_registration
+ bundle_registration =
+ defined(invoker.bundle_registration) && invoker.bundle_registration
schema_include_rules = ""
if (defined(invoker.schema_include_rules)) {
@@ -108,11 +108,15 @@ template("json_schema_api") {
"--destdir=" + rebase_path(root_gen_dir, root_build_dir),
"--namespace=$root_namespace",
"--generator=cpp",
- "--include-rules=$schema_include_rules" ]
+ "--include-rules=$schema_include_rules",
+ ]
if (defined(invoker.visibility)) {
# If visibility is restricted, add our own target to it.
- visibility = [ invoker.visibility, target_visibility ]
+ visibility = [
+ invoker.visibility,
+ target_visibility,
+ ]
}
}
}
@@ -120,7 +124,7 @@ template("json_schema_api") {
if (bundle) {
uncompiled_sources = []
if (defined(invoker.uncompiled_sources)) {
- uncompiled_sources = invoker.uncompiled_sources
+ uncompiled_sources = invoker.uncompiled_sources
}
bundle_generator_schema_name = target_name + "_bundle_generator_schema"
@@ -132,28 +136,28 @@ template("json_schema_api") {
"$target_gen_dir/generated_schemas.h",
]
args = [
- "--root=" + rebase_path("//", root_build_dir),
- "--destdir=" + rebase_path(root_gen_dir, root_build_dir),
- "--namespace=$root_namespace",
- "--generator=cpp-bundle-schema",
- "--include-rules=$schema_include_rules" ]
- + rebase_path(sources, root_build_dir)
- + rebase_path(uncompiled_sources, root_build_dir)
+ "--root=" + rebase_path("//", root_build_dir),
+ "--destdir=" + rebase_path(root_gen_dir, root_build_dir),
+ "--namespace=$root_namespace",
+ "--generator=cpp-bundle-schema",
+ "--include-rules=$schema_include_rules",
+ ] + rebase_path(sources, root_build_dir) +
+ rebase_path(uncompiled_sources, root_build_dir)
}
}
if (bundle_registration) {
uncompiled_sources = []
if (defined(invoker.uncompiled_sources)) {
- uncompiled_sources = invoker.uncompiled_sources
+ uncompiled_sources = invoker.uncompiled_sources
}
assert(defined(invoker.impl_dir),
"\"impl_dir\" must be defined for the $target_name template.")
impl_dir = invoker.impl_dir
- bundle_generator_registration_name = target_name +
- "_bundle_generator_registration"
+ bundle_generator_registration_name =
+ target_name + "_bundle_generator_registration"
action(bundle_generator_registration_name) {
script = compiler_script
inputs = compiler_sources + sources + uncompiled_sources
@@ -162,14 +166,14 @@ template("json_schema_api") {
"$root_gen_dir/$impl_dir/generated_api_registration.h",
]
args = [
- "--root=" + rebase_path("//", root_build_dir),
- "--destdir=" + rebase_path(root_gen_dir, root_build_dir),
- "--namespace=$root_namespace",
- "--generator=cpp-bundle-registration",
- "--impl-dir=" + rebase_path(impl_dir, "//"),
- "--include-rules=$schema_include_rules" ]
- + rebase_path(sources, root_build_dir)
- + rebase_path(uncompiled_sources, root_build_dir)
+ "--root=" + rebase_path("//", root_build_dir),
+ "--destdir=" + rebase_path(root_gen_dir, root_build_dir),
+ "--namespace=$root_namespace",
+ "--generator=cpp-bundle-registration",
+ "--impl-dir=" + rebase_path(impl_dir, "//"),
+ "--include-rules=$schema_include_rules",
+ ] + rebase_path(sources, root_build_dir) +
+ rebase_path(uncompiled_sources, root_build_dir)
}
}
diff --git a/build/secondary/testing/BUILD.gn b/build/secondary/testing/BUILD.gn
index 2cafa68..fc5063749 100644
--- a/build/secondary/testing/BUILD.gn
+++ b/build/secondary/testing/BUILD.gn
@@ -7,5 +7,7 @@ source_set("gmock_mutant") {
"gmock_mutant.h", # gMock helpers
]
- deps = [ "//base" ]
+ deps = [
+ "//base",
+ ]
}
diff --git a/build/secondary/testing/gmock/BUILD.gn b/build/secondary/testing/gmock/BUILD.gn
index a0dbad7..4ec6224 100644
--- a/build/secondary/testing/gmock/BUILD.gn
+++ b/build/secondary/testing/gmock/BUILD.gn
@@ -24,6 +24,7 @@ static_library("gmock") {
"include/gmock/internal/gmock-generated-internal-utils.h",
"include/gmock/internal/gmock-internal-utils.h",
"include/gmock/internal/gmock-port.h",
+
#"src/gmock-all.cc", # Not needed by our build.
"src/gmock-cardinalities.cc",
"src/gmock-internal-utils.cc",
@@ -44,6 +45,10 @@ static_library("gmock") {
static_library("gmock_main") {
# TODO http://crbug.com/412064 enable this flag all the time.
testonly = !is_component_build
- sources = [ "src/gmock_main.cc" ]
- deps = [ ":gmock" ]
+ sources = [
+ "src/gmock_main.cc",
+ ]
+ deps = [
+ ":gmock",
+ ]
}
diff --git a/build/secondary/testing/gtest/BUILD.gn b/build/secondary/testing/gtest/BUILD.gn
index f50afb6..96f4112 100644
--- a/build/secondary/testing/gtest/BUILD.gn
+++ b/build/secondary/testing/gtest/BUILD.gn
@@ -9,10 +9,10 @@ config("gtest_config") {
]
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",
+
# Chrome doesn't support / require C++11, yet.
"GTEST_LANG_CXX11=0",
]
@@ -81,6 +81,7 @@ static_library("gtest") {
"include/gtest/internal/gtest-string.h",
"include/gtest/internal/gtest-tuple.h",
"include/gtest/internal/gtest-type-util.h",
+
#"gtest/src/gtest-all.cc", # Not needed by our build.
"src/gtest-death-test.cc",
"src/gtest-filepath.cc",
@@ -115,6 +116,10 @@ static_library("gtest") {
source_set("gtest_main") {
# TODO http://crbug.com/412064 enable this flag all the time.
testonly = !is_component_build
- sources = [ "src/gtest_main.cc" ]
- deps = [ ":gtest" ]
+ sources = [
+ "src/gtest_main.cc",
+ ]
+ deps = [
+ ":gtest",
+ ]
}
diff --git a/build/secondary/third_party/android_tools/BUILD.gn b/build/secondary/third_party/android_tools/BUILD.gn
index 14e6c07..0df6545 100644
--- a/build/secondary/third_party/android_tools/BUILD.gn
+++ b/build/secondary/third_party/android_tools/BUILD.gn
@@ -11,7 +11,9 @@ config("cpu_features_include") {
# This is the GN version of
# //build/android/cpufeatures.gypi:cpufeatures
source_set("cpu_features") {
- sources = [ "ndk/sources/android/cpufeatures/cpu-features.c" ]
+ sources = [
+ "ndk/sources/android/cpufeatures/cpu-features.c",
+ ]
public_configs = [ ":cpu_features_include" ]
configs -= [ "//build/config/compiler:chromium_code" ]
@@ -27,27 +29,29 @@ android_java_prebuilt("uiautomator_java") {
}
android_java_prebuilt("android_support_v13_java") {
- jar_path = "$android_sdk_root/extras/android/support/v13/android-support-v13.jar"
+ jar_path =
+ "$android_sdk_root/extras/android/support/v13/android-support-v13.jar"
}
android_resources("android_support_v7_appcompat_resources") {
v14_verify_only = true
- resource_dirs = [
- "$android_sdk_root/extras/android/support/v7/appcompat/res"
- ]
+ resource_dirs =
+ [ "$android_sdk_root/extras/android/support/v7/appcompat/res" ]
custom_package = "android.support.v7.appcompat"
}
android_java_prebuilt("android_support_v7_appcompat_java") {
- deps = [ ":android_support_v7_appcompat_resources" ]
- jar_path = "$android_sdk_root/extras/android/support/v7/appcompat/libs/android-support-v7-appcompat.jar"
+ deps = [
+ ":android_support_v7_appcompat_resources",
+ ]
+ jar_path =
+ "$android_sdk_root/extras/android/support/v7/appcompat/libs/android-support-v7-appcompat.jar"
}
android_resources("android_support_v7_mediarouter_resources") {
v14_verify_only = true
- resource_dirs = [
- "$android_sdk_root/extras/android/support/v7/mediarouter/res"
- ]
+ resource_dirs =
+ [ "$android_sdk_root/extras/android/support/v7/mediarouter/res" ]
deps = [
":android_support_v7_appcompat_resources",
]
@@ -59,5 +63,6 @@ android_java_prebuilt("android_support_v7_mediarouter_java") {
":android_support_v7_mediarouter_resources",
":android_support_v7_appcompat_java",
]
- jar_path = "$android_sdk_root/extras/android/support/v7/mediarouter/libs/android-support-v7-mediarouter.jar"
+ jar_path =
+ "$android_sdk_root/extras/android/support/v7/mediarouter/libs/android-support-v7-mediarouter.jar"
}
diff --git a/build/secondary/third_party/cacheinvalidation/src/google/cacheinvalidation/BUILD.gn b/build/secondary/third_party/cacheinvalidation/src/google/cacheinvalidation/BUILD.gn
index 2dc1b999..3bbb844 100644
--- a/build/secondary/third_party/cacheinvalidation/src/google/cacheinvalidation/BUILD.gn
+++ b/build/secondary/third_party/cacheinvalidation/src/google/cacheinvalidation/BUILD.gn
@@ -25,4 +25,3 @@ proto_library("cacheinvalidation_proto_cpp") {
proto_out_dir = "google/cacheinvalidation"
}
-
diff --git a/build/secondary/third_party/freetype/BUILD.gn b/build/secondary/third_party/freetype/BUILD.gn
index 2b96239..2181d87 100644
--- a/build/secondary/third_party/freetype/BUILD.gn
+++ b/build/secondary/third_party/freetype/BUILD.gn
@@ -39,9 +39,7 @@ source_set("freetype") {
"DARWIN_NO_CARBON",
]
- include_dirs = [
- "build",
- ]
+ include_dirs = [ "build" ]
public_configs = [ ":freetype_config" ]
diff --git a/build/secondary/third_party/icu/BUILD.gn b/build/secondary/third_party/icu/BUILD.gn
index 865a5e4..b618673 100644
--- a/build/secondary/third_party/icu/BUILD.gn
+++ b/build/secondary/third_party/icu/BUILD.gn
@@ -224,9 +224,7 @@ component("icui18n") {
"source/i18n/zrule.cpp",
"source/i18n/ztrans.cpp",
]
- defines = [
- "U_I18N_IMPLEMENTATION",
- ]
+ defines = [ "U_I18N_IMPLEMENTATION" ]
deps = [
":icuuc",
]
@@ -259,6 +257,7 @@ component("icui18n") {
cflags += [
"-Wno-header-hygiene",
+
# Looks like a real issue, see http://crbug.com/114660
"-Wno-return-type-c-linkage",
]
@@ -439,9 +438,7 @@ component("icuuc") {
"source/common/uvectr64.cpp",
"source/common/wintz.c",
]
- defines = [
- "U_COMMON_IMPLEMENTATION",
- ]
+ defines = [ "U_COMMON_IMPLEMENTATION" ]
deps = [
":icudata",
]
@@ -475,9 +472,13 @@ if (icu_use_data_file) {
} else {
copy("icudata") {
if (is_android) {
- sources = [ "android/icudtl.dat" ]
+ sources = [
+ "android/icudtl.dat",
+ ]
} else {
- sources = [ "source/data/in/icudtl.dat" ]
+ sources = [
+ "source/data/in/icudtl.dat",
+ ]
}
outputs = [ "$root_out_dir/icudtl.dat" ]
@@ -487,7 +488,9 @@ if (icu_use_data_file) {
if (is_win) {
# On Windows the target DLL is pre-built so just use a copy rule.
copy("icudata") {
- sources = [ "windows/icudt.dll" ]
+ sources = [
+ "windows/icudt.dll",
+ ]
outputs = [ "$root_out_dir/icudt.dll" ]
}
} else {
@@ -497,11 +500,17 @@ if (icu_use_data_file) {
# TODO(GYP): Gyp has considerations here for QNX and for the host toolchain
# that have not been ported over.
if (is_linux) {
- sources = [ "linux/icudtl_dat.S" ]
+ sources = [
+ "linux/icudtl_dat.S",
+ ]
} else if (is_mac) {
- sources = [ "mac/icudtl_dat.S" ]
+ sources = [
+ "mac/icudtl_dat.S",
+ ]
} else if (is_android) {
- sources = [ "android/icudtl_dat.S" ]
+ sources = [
+ "android/icudtl_dat.S",
+ ]
} else {
assert(false, "No icu data for this platform")
}
diff --git a/build/secondary/third_party/leveldatabase/BUILD.gn b/build/secondary/third_party/leveldatabase/BUILD.gn
index 3653a98..67cda92 100644
--- a/build/secondary/third_party/leveldatabase/BUILD.gn
+++ b/build/secondary/third_party/leveldatabase/BUILD.gn
@@ -70,6 +70,7 @@ static_library("leveldatabase") {
"src/include/leveldb/write_batch.h",
"src/port/port.h",
"src/port/port_example.h",
+
#"src/port/port_posix.cc", # We use the chromium port instead of this.
#"src/port/port_posix.h",
"src/table/block.cc",
@@ -205,7 +206,7 @@ if (!is_android) {
test("leveldb_crc32c_test") {
sources = [
- "src/util/crc32c_test.cc"
+ "src/util/crc32c_test.cc",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
diff --git a/build/secondary/third_party/libjpeg_turbo/BUILD.gn b/build/secondary/third_party/libjpeg_turbo/BUILD.gn
index 4dbca97..82472e7 100644
--- a/build/secondary/third_party/libjpeg_turbo/BUILD.gn
+++ b/build/secondary/third_party/libjpeg_turbo/BUILD.gn
@@ -10,106 +10,92 @@ if (cpu_arch == "arm") {
}
if (cpu_arch == "x86" || cpu_arch == "x64") {
+ import("//third_party/yasm/yasm_assemble.gni")
-import("//third_party/yasm/yasm_assemble.gni")
+ yasm_assemble("simd_asm") {
+ defines = []
-yasm_assemble("simd_asm") {
- defines = []
-
- if (cpu_arch == "x86") {
- sources = [
- "simd/jccolmmx.asm",
- "simd/jccolss2.asm",
- "simd/jcgrammx.asm",
- "simd/jcgrass2.asm",
- "simd/jcqnt3dn.asm",
- "simd/jcqntmmx.asm",
- "simd/jcqnts2f.asm",
- "simd/jcqnts2i.asm",
- "simd/jcqntsse.asm",
- "simd/jcsammmx.asm",
- "simd/jcsamss2.asm",
- "simd/jdcolmmx.asm",
- "simd/jdcolss2.asm",
- "simd/jdmermmx.asm",
- "simd/jdmerss2.asm",
- "simd/jdsammmx.asm",
- "simd/jdsamss2.asm",
- "simd/jf3dnflt.asm",
- "simd/jfmmxfst.asm",
- "simd/jfmmxint.asm",
- "simd/jfss2fst.asm",
- "simd/jfss2int.asm",
- "simd/jfsseflt.asm",
- "simd/ji3dnflt.asm",
- "simd/jimmxfst.asm",
- "simd/jimmxint.asm",
- "simd/jimmxred.asm",
- "simd/jiss2flt.asm",
- "simd/jiss2fst.asm",
- "simd/jiss2int.asm",
- "simd/jiss2red.asm",
- "simd/jisseflt.asm",
- "simd/jsimdcpu.asm",
- ]
- defines += [
- "__x86__",
- ]
- } else if (cpu_arch == "x64") {
- sources = [
- "simd/jccolss2-64.asm",
- "simd/jcgrass2-64.asm",
- "simd/jcqnts2f-64.asm",
- "simd/jcqnts2i-64.asm",
- "simd/jcsamss2-64.asm",
- "simd/jdcolss2-64.asm",
- "simd/jdmerss2-64.asm",
- "simd/jdsamss2-64.asm",
- "simd/jfss2fst-64.asm",
- "simd/jfss2int-64.asm",
- "simd/jfsseflt-64.asm",
- "simd/jiss2flt-64.asm",
- "simd/jiss2fst-64.asm",
- "simd/jiss2int-64.asm",
- "simd/jiss2red-64.asm",
- ]
- defines += [
- "__x86_64__",
- ]
- }
-
- if (is_win) {
- defines += [
- "MSVC",
- ]
- include_dirs = [ "win" ]
if (cpu_arch == "x86") {
- defines += [
- "WIN32",
+ sources = [
+ "simd/jccolmmx.asm",
+ "simd/jccolss2.asm",
+ "simd/jcgrammx.asm",
+ "simd/jcgrass2.asm",
+ "simd/jcqnt3dn.asm",
+ "simd/jcqntmmx.asm",
+ "simd/jcqnts2f.asm",
+ "simd/jcqnts2i.asm",
+ "simd/jcqntsse.asm",
+ "simd/jcsammmx.asm",
+ "simd/jcsamss2.asm",
+ "simd/jdcolmmx.asm",
+ "simd/jdcolss2.asm",
+ "simd/jdmermmx.asm",
+ "simd/jdmerss2.asm",
+ "simd/jdsammmx.asm",
+ "simd/jdsamss2.asm",
+ "simd/jf3dnflt.asm",
+ "simd/jfmmxfst.asm",
+ "simd/jfmmxint.asm",
+ "simd/jfss2fst.asm",
+ "simd/jfss2int.asm",
+ "simd/jfsseflt.asm",
+ "simd/ji3dnflt.asm",
+ "simd/jimmxfst.asm",
+ "simd/jimmxint.asm",
+ "simd/jimmxred.asm",
+ "simd/jiss2flt.asm",
+ "simd/jiss2fst.asm",
+ "simd/jiss2int.asm",
+ "simd/jiss2red.asm",
+ "simd/jisseflt.asm",
+ "simd/jsimdcpu.asm",
]
- } else {
- defines += [
- "WIN64",
+ defines += [ "__x86__" ]
+ } else if (cpu_arch == "x64") {
+ sources = [
+ "simd/jccolss2-64.asm",
+ "simd/jcgrass2-64.asm",
+ "simd/jcqnts2f-64.asm",
+ "simd/jcqnts2i-64.asm",
+ "simd/jcsamss2-64.asm",
+ "simd/jdcolss2-64.asm",
+ "simd/jdmerss2-64.asm",
+ "simd/jdsamss2-64.asm",
+ "simd/jfss2fst-64.asm",
+ "simd/jfss2int-64.asm",
+ "simd/jfsseflt-64.asm",
+ "simd/jiss2flt-64.asm",
+ "simd/jiss2fst-64.asm",
+ "simd/jiss2int-64.asm",
+ "simd/jiss2red-64.asm",
]
+ defines += [ "__x86_64__" ]
}
- } else if (is_mac) {
- defines += [
- "MACHO",
- ]
- include_dirs = [ "mac" ]
- } else if (is_linux) {
- defines += [
- "ELF",
- ]
- include_dirs = [ "linux" ]
- }
-}
+ if (is_win) {
+ defines += [ "MSVC" ]
+ include_dirs = [ "win" ]
+ if (cpu_arch == "x86") {
+ defines += [ "WIN32" ]
+ } else {
+ defines += [ "WIN64" ]
+ }
+ } else if (is_mac) {
+ defines += [ "MACHO" ]
+ include_dirs = [ "mac" ]
+ } else if (is_linux) {
+ defines += [ "ELF" ]
+ include_dirs = [ "linux" ]
+ }
+ }
}
source_set("simd") {
if (cpu_arch == "x86") {
- deps = [ ":simd_asm" ]
+ deps = [
+ ":simd_asm",
+ ]
sources = [
"simd/jsimd_i386.c",
]
@@ -117,7 +103,9 @@ source_set("simd") {
cflags = [ "/wd4245" ]
}
} else if (cpu_arch == "x64") {
- deps = [ ":simd_asm" ]
+ deps = [
+ ":simd_asm",
+ ]
sources = [
"simd/jsimd_x86_64.c",
]
@@ -128,7 +116,9 @@ source_set("simd") {
"simd/jsimd_arm_neon.S",
]
} else {
- sources = [ "jsimd_none.c" ]
+ sources = [
+ "jsimd_none.c",
+ ]
}
}
@@ -212,7 +202,9 @@ source_set("libjpeg") {
if (is_msan || is_linux) {
sources += [ "jsimd_none.c" ]
} else {
- deps = [ ":simd" ]
+ deps = [
+ ":simd",
+ ]
}
# TODO(GYP): Compile the .asm files with YASM as GYP does.
diff --git a/build/secondary/third_party/libsrtp/BUILD.gn b/build/secondary/third_party/libsrtp/BUILD.gn
index b0e0a91..506d19f 100644
--- a/build/secondary/third_party/libsrtp/BUILD.gn
+++ b/build/secondary/third_party/libsrtp/BUILD.gn
@@ -38,6 +38,7 @@ config("libsrtp_config") {
defines += [
"INLINE=__inline",
"HAVE_BYTESWAP_METHODS_H",
+
# All Windows architectures are this way.
"SIZEOF_UNSIGNED_LONG=4",
"SIZEOF_UNSIGNED_LONG_LONG=8",
@@ -67,7 +68,10 @@ config("system_libsrtp_config") {
if (use_system_libsrtp) {
group("libsrtp") {
- public_configs = [ ":libsrtp_config", ":system_libsrtp_config" ]
+ public_configs = [
+ ":libsrtp_config",
+ ":system_libsrtp_config",
+ ]
libs = [ "-lsrtp" ]
}
} else {
@@ -118,7 +122,6 @@ if (use_system_libsrtp) {
# sources
"srtp/srtp/ekt.c",
"srtp/srtp/srtp.c",
-
"srtp/crypto/cipher/aes.c",
"srtp/crypto/cipher/aes_cbc.c",
"srtp/crypto/cipher/aes_icm.c",
@@ -154,7 +157,9 @@ if (use_system_libsrtp) {
executable("rdbx_driver") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
- deps = [ ":libsrtp" ]
+ deps = [
+ ":libsrtp",
+ ]
sources = [
"srtp/include/getopt_s.h",
"srtp/test/getopt_s.c",
@@ -165,7 +170,9 @@ if (use_system_libsrtp) {
executable("srtp_driver") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
- deps = [ ":libsrtp" ]
+ deps = [
+ ":libsrtp",
+ ]
sources = [
"srtp/include/getopt_s.h",
"srtp/include/srtp_priv.h",
@@ -177,7 +184,9 @@ if (use_system_libsrtp) {
executable("roc_driver") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
- deps = [ ":libsrtp" ]
+ deps = [
+ ":libsrtp",
+ ]
sources = [
"srtp/crypto/include/rdbx.h",
"srtp/include/ut_sim.h",
@@ -188,7 +197,9 @@ if (use_system_libsrtp) {
executable("replay_driver") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
- deps = [ ":libsrtp" ]
+ deps = [
+ ":libsrtp",
+ ]
sources = [
"srtp/crypto/include/rdbx.h",
"srtp/include/ut_sim.h",
@@ -199,7 +210,9 @@ if (use_system_libsrtp) {
executable("rtpw") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
- deps = [ ":libsrtp" ]
+ deps = [
+ ":libsrtp",
+ ]
sources = [
"srtp/include/getopt_s.h",
"srtp/include/rtp.h",
@@ -220,7 +233,9 @@ if (use_system_libsrtp) {
executable("srtp_test_cipher_driver") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
- deps = [ ":libsrtp" ]
+ deps = [
+ ":libsrtp",
+ ]
sources = [
"srtp/crypto/test/cipher_driver.c",
]
@@ -229,7 +244,9 @@ if (use_system_libsrtp) {
executable("srtp_test_datatypes_driver") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
- deps = [ ":libsrtp" ]
+ deps = [
+ ":libsrtp",
+ ]
sources = [
"srtp/crypto/test/datatypes_driver.c",
]
@@ -238,7 +255,9 @@ if (use_system_libsrtp) {
executable("srtp_test_stat_driver") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
- deps = [ ":libsrtp" ]
+ deps = [
+ ":libsrtp",
+ ]
sources = [
"srtp/crypto/test/stat_driver.c",
]
@@ -247,7 +266,9 @@ if (use_system_libsrtp) {
executable("srtp_test_sha1_driver") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
- deps = [ ":libsrtp" ]
+ deps = [
+ ":libsrtp",
+ ]
sources = [
"srtp/crypto/test/sha1_driver.c",
]
@@ -256,7 +277,9 @@ if (use_system_libsrtp) {
executable("srtp_test_kernel_driver") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
- deps = [ ":libsrtp" ]
+ deps = [
+ ":libsrtp",
+ ]
sources = [
"srtp/crypto/test/kernel_driver.c",
]
@@ -265,7 +288,9 @@ if (use_system_libsrtp) {
executable("srtp_test_aes_calc") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
- deps = [ ":libsrtp" ]
+ deps = [
+ ":libsrtp",
+ ]
sources = [
"srtp/crypto/test/aes_calc.c",
]
@@ -274,7 +299,9 @@ if (use_system_libsrtp) {
executable("srtp_test_rand_gen") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
- deps = [ ":libsrtp" ]
+ deps = [
+ ":libsrtp",
+ ]
sources = [
"srtp/crypto/test/rand_gen.c",
]
@@ -283,7 +310,9 @@ if (use_system_libsrtp) {
executable("srtp_test_env") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
- deps = [ ":libsrtp" ]
+ deps = [
+ ":libsrtp",
+ ]
sources = [
"srtp/crypto/test/env.c",
]
diff --git a/build/secondary/third_party/nss/BUILD.gn b/build/secondary/third_party/nss/BUILD.gn
index 16568c0..768a85d 100644
--- a/build/secondary/third_party/nss/BUILD.gn
+++ b/build/secondary/third_party/nss/BUILD.gn
@@ -14,7 +14,10 @@ if (is_linux) {
# platform and build config.
pkg_config("system_nss_no_ssl_config") {
packages = [ "nss" ]
- extra_args = [ "-v", "-lssl3" ]
+ extra_args = [
+ "-v",
+ "-lssl3",
+ ]
}
} else {
include_nss_root_certs = is_ios
@@ -207,9 +210,7 @@ if (is_linux) {
public_configs = [ ":nspr_config" ]
- configs -= [
- "//build/config/compiler:chromium_code",
- ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
if (is_win) {
configs -= [
"//build/config/win:unicode", # Requires 8-bit mode.
@@ -224,9 +225,7 @@ if (is_linux) {
"FORCE_PR_LOG",
]
- include_dirs = [
- "nspr/pr/include/private",
- ]
+ include_dirs = [ "nspr/pr/include/private" ]
if (is_win) {
cflags = [
@@ -314,9 +313,7 @@ if (is_linux) {
}
if (is_mac) {
- defines += [
- "HAVE_CRT_EXTERNS_H",
- ]
+ defines += [ "HAVE_CRT_EXTERNS_H" ]
libs = [
"CoreFoundation.framework",
"CoreServices.framework",
@@ -328,8 +325,10 @@ if (is_linux) {
# nspr uses a bunch of deprecated functions (NSLinkModule etc) in
# prlink.c on mac.
"-Wno-deprecated-declarations",
+
# nspr passes "const char*" through "void*".
"-Wno-incompatible-pointer-types",
+
# nspr passes "int*" through "unsigned int*".
"-Wno-pointer-sign",
]
@@ -348,7 +347,9 @@ if (is_linux) {
"nss/lib/nss/nssver.c",
]
- public_deps = [ ":nss_static" ]
+ public_deps = [
+ ":nss_static",
+ ]
if (include_nss_root_certs) {
public_deps += [ ":nssckbi" ]
@@ -359,9 +360,8 @@ if (is_linux) {
ldflags = [ "-all_load" ]
} else if (is_win) {
# Pass the def file to the linker.
- ldflags = [
- "/DEF:" + rebase_path("nss/exports_win.def", root_build_dir)
- ]
+ ldflags =
+ [ "/DEF:" + rebase_path("nss/exports_win.def", root_build_dir) ]
}
}
}
@@ -429,14 +429,10 @@ if (is_linux) {
"nss/lib/ckfw/wrap.c",
]
- configs -= [
- "//build/config/compiler:chromium_code"
- ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
if (is_win) {
- configs -= [
- "//build/config/win:unicode", # Requires 8-bit mode.
- ]
+ configs -= [ "//build/config/win:unicode" ] # Requires 8-bit mode.
}
configs += [ "//build/config/compiler:no_chromium_code" ]
@@ -870,22 +866,21 @@ if (is_linux) {
# NOTE: mpi_arm.c can be used directly on Linux. mpi_arm.c will need
# to be excluded conditionally if we start to build NSS on Linux.
"nss/lib/freebl/mpi/mpi_arm.c",
+
# primes.c is included by mpprime.c.
"nss/lib/freebl/mpi/primes.c",
+
# unix_rand.c and win_rand.c are included by sysrand.c.
"nss/lib/freebl/unix_rand.c",
"nss/lib/freebl/win_rand.c",
+
# debug_module.c is included by pk11load.c.
"nss/lib/pk11wrap/debug_module.c",
]
- configs -= [
- "//build/config/compiler:chromium_code"
- ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
if (is_win) {
- configs -= [
- "//build/config/win:unicode", # Requires 8-bit mode.
- ]
+ configs -= [ "//build/config/win:unicode" ] # Requires 8-bit mode.
}
configs += [ "//build/config/compiler:no_chromium_code" ]
public_configs = [ ":nss_static_config" ]
@@ -1112,9 +1107,7 @@ if (is_linux) {
}
if (is_mac || is_ios) {
- sources -= [
- "nss/lib/freebl/mpi/mpi_amd64.c",
- ]
+ sources -= [ "nss/lib/freebl/mpi/mpi_amd64.c" ]
cflags += [
"-include",
rebase_path("//third_party/nss/nss/lib/freebl/nss_build_config_mac.h",
@@ -1159,10 +1152,7 @@ if (is_linux) {
"USE_HW_AES",
"INTEL_GCM",
]
- sources -= [
- "nss/lib/freebl/mpi/mpi_amd64.c",
- ]
-
+ sources -= [ "nss/lib/freebl/mpi/mpi_amd64.c" ]
} else if (cpu_arch == "x64") {
sources -= [
"nss/lib/freebl/intel-aes-x86-masm.asm",
@@ -1191,12 +1181,16 @@ if (is_linux) {
cflags += [
# nss doesn"t explicitly cast between different enum types.
"-Wno-conversion",
+
# nss passes "const char*" through "void*".
"-Wno-incompatible-pointer-types",
+
# nss prefers `a && b || c` over `(a && b) || c`.
"-Wno-logical-op-parentheses",
+
# nss doesn"t use exhaustive switches on enums
"-Wno-switch",
+
# nss has some `unsigned < 0` checks.
"-Wno-tautological-compare",
]
@@ -1215,4 +1209,3 @@ if (is_linux) {
}
}
} # Windows/Mac/iOS.
-
diff --git a/build/secondary/third_party/openmax_dl/dl/BUILD.gn b/build/secondary/third_party/openmax_dl/dl/BUILD.gn
index 158e3f8..40c1513 100644
--- a/build/secondary/third_party/openmax_dl/dl/BUILD.gn
+++ b/build/secondary/third_party/openmax_dl/dl/BUILD.gn
@@ -19,8 +19,7 @@ config("dl_config") {
# Enable run-time NEON selection.
defines = [ "DL_ARM_NEON_OPTIONAL" ]
}
- }
- else if (cpu_arch == "arm64") {
+ } else if (cpu_arch == "arm64") {
# Enable build-time NEON selection.
defines = [ "DL_ARM_NEON" ]
}
@@ -40,9 +39,7 @@ source_set("dl") {
defines = []
if (openmax_big_float_fft) {
- defines += [
- "BIG_FFT_TABLE",
- ]
+ defines += [ "BIG_FFT_TABLE" ]
}
if (cpu_arch == "arm" || cpu_arch == "arm64") {
@@ -63,14 +60,10 @@ source_set("dl") {
if (cpu_arch == "arm") {
if (arm_use_neon || is_android) {
- deps += [
- ":openmax_dl_armv7"
- ]
+ deps += [ ":openmax_dl_armv7" ]
}
configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
- cflags += [
- "-mfpu=neon"
- ]
+ cflags += [ "-mfpu=neon" ]
if (arm_use_neon || is_android) {
sources += [
@@ -95,10 +88,12 @@ source_set("dl") {
"sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix8_fs_unsafe_s.S",
"sp/src/arm/neon/omxSP_FFTFwd_CToC_SC32_Sfs_s.S",
"sp/src/arm/neon/omxSP_FFTInv_CToC_SC32_Sfs_s.S",
+
# Real 32-bit fixed-point FFT
"sp/src/arm/neon/armSP_FFTInv_CCSToR_S32_preTwiddleRadix2_unsafe_s.S",
"sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S32_Sfs_s.S",
"sp/src/arm/neon/omxSP_FFTInv_CCSToR_S32_Sfs_s.S",
+
# Complex 16-bit fixed-point FFT
"sp/src/arm/neon/armSP_FFTInv_CCSToR_S16_preTwiddleRadix2_unsafe_s.S",
"sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_fs_unsafe_s.S",
@@ -111,11 +106,13 @@ source_set("dl") {
"sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix8_fs_unsafe_s.S",
"sp/src/arm/neon/omxSP_FFTFwd_CToC_SC16_Sfs_s.S",
"sp/src/arm/neon/omxSP_FFTInv_CToC_SC16_Sfs_s.S",
+
# Real 16-bit fixed-point FFT
"sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S16_Sfs_s.S",
"sp/src/arm/neon/omxSP_FFTInv_CCSToR_S16_Sfs_s.S",
"sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S16S32_Sfs_s.S",
"sp/src/arm/neon/omxSP_FFTInv_CCSToR_S32S16_Sfs_s.S",
+
# Complex floating-point FFT
"sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_fs_unsafe_s.S",
"sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_ls_unsafe_s.S",
@@ -126,6 +123,7 @@ source_set("dl") {
"sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix8_fs_unsafe_s.S",
"sp/src/arm/neon/omxSP_FFTFwd_CToC_FC32_Sfs_s.S",
"sp/src/arm/neon/omxSP_FFTInv_CToC_FC32_Sfs_s.S",
+
# Real floating-point FFT
"sp/src/arm/neon/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_unsafe_s.S",
"sp/src/arm/neon/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
@@ -135,9 +133,7 @@ source_set("dl") {
}
if (cpu_arch == "ia32" || cpu_arch == "x64") {
- cflags += [
- "-msse2"
- ]
+ cflags += [ "-msse2" ]
sources += [
# Real 32-bit floating-point FFT.
@@ -185,6 +181,7 @@ source_set("dl") {
"sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix8_fs_s.S",
"sp/src/arm/arm64/omxSP_FFTInv_CToC_FC32.c",
"sp/src/arm/arm64/omxSP_FFTFwd_CToC_FC32.c",
+
# Real floating-point FFT
"sp/src/arm/arm64/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_s.S",
"sp/src/arm/arm64/omxSP_FFTFwd_RToCCS_F32.c",
@@ -193,12 +190,8 @@ source_set("dl") {
]
}
if (cpu_arch == "mipsel") {
- cflags += [
- "-std=c99",
- ]
- sources -= [
- "sp/src/armSP_FFT_F32TwiddleTable.c",
- ]
+ cflags += [ "-std=c99" ]
+ sources -= [ "sp/src/armSP_FFT_F32TwiddleTable.c" ]
sources += [
"sp/api/mipsSP.h",
@@ -236,6 +229,7 @@ if (cpu_arch == "arm") {
"sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix8_fs_unsafe_s.S",
"sp/src/arm/armv7/omxSP_FFTInv_CToC_FC32_Sfs_s.S",
"sp/src/arm/armv7/omxSP_FFTFwd_CToC_FC32_Sfs_s.S",
+
# Real floating-point FFT
"sp/src/arm/armv7/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_unsafe_s.S",
"sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
@@ -243,8 +237,11 @@ if (cpu_arch == "arm") {
]
if (is_android) {
# We only do run-time NEON detection on Android.
- deps = [ "//third_party/android_tools:cpu_features" ]
+ deps = [
+ "//third_party/android_tools:cpu_features",
+ ]
libs = [ "log" ]
+
# Detection routine
sources += [ "sp/src/arm/detect.c" ]
}
diff --git a/build/secondary/third_party/sfntly/BUILD.gn b/build/secondary/third_party/sfntly/BUILD.gn
index 74107af..a4dbd23 100644
--- a/build/secondary/third_party/sfntly/BUILD.gn
+++ b/build/secondary/third_party/sfntly/BUILD.gn
@@ -125,5 +125,7 @@ static_library("sfntly") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
- deps = [ "//third_party/icu:icuuc" ]
+ deps = [
+ "//third_party/icu:icuuc",
+ ]
}
diff --git a/build/secondary/tools/grit/BUILD.gn b/build/secondary/tools/grit/BUILD.gn
index f954537..dee3d06 100644
--- a/build/secondary/tools/grit/BUILD.gn
+++ b/build/secondary/tools/grit/BUILD.gn
@@ -9,7 +9,9 @@ action("grit_sources") {
depfile = "$target_out_dir/grit_sources.d"
script = "//build/secondary/tools/grit/stamp_grit_sources.py"
- inputs = [ "grit.py" ]
+ inputs = [
+ "grit.py",
+ ]
# Note that we can't call this "grit_sources.stamp" because that file is
# implicitly created by GN for script actions.
@@ -18,6 +20,6 @@ action("grit_sources") {
args = [
rebase_path("//tools/grit", root_build_dir),
rebase_path(outputs[0], root_build_dir),
- rebase_path(depfile, root_build_dir)
+ rebase_path(depfile, root_build_dir),
]
}
diff --git a/build/secondary/tools/grit/grit_rule.gni b/build/secondary/tools/grit/grit_rule.gni
index d49c4ed..9010abc 100644
--- a/build/secondary/tools/grit/grit_rule.gni
+++ b/build/secondary/tools/grit/grit_rule.gni
@@ -71,131 +71,215 @@
# # You can also put deps here if the grit source depends on generated
# # files.
# }
-import ("//build/config/crypto.gni")
-import ("//build/config/features.gni")
-import ("//build/config/ui.gni")
+import("//build/config/crypto.gni")
+import("//build/config/features.gni")
+import("//build/config/ui.gni")
grit_defines = []
# Mac and iOS want Title Case strings.
use_titlecase_in_grd_files = is_mac || is_ios
if (use_titlecase_in_grd_files) {
- grit_defines += [ "-D", "use_titlecase" ]
+ grit_defines += [
+ "-D",
+ "use_titlecase",
+ ]
}
if (is_chrome_branded) {
grit_defines += [
- "-D", "_google_chrome",
- "-E", "CHROMIUM_BUILD=google_chrome",
+ "-D",
+ "_google_chrome",
+ "-E",
+ "CHROMIUM_BUILD=google_chrome",
]
} else {
grit_defines += [
- "-D", "_chromium",
- "-E", "CHROMIUM_BUILD=chromium",
+ "-D",
+ "_chromium",
+ "-E",
+ "CHROMIUM_BUILD=chromium",
]
}
if (is_chromeos) {
grit_defines += [
- "-D", "chromeos",
- "-D", "scale_factors=2x"
+ "-D",
+ "chromeos",
+ "-D",
+ "scale_factors=2x",
]
}
if (is_desktop_linux) {
- grit_defines += [ "-D", "desktop_linux" ]
+ grit_defines += [
+ "-D",
+ "desktop_linux",
+ ]
}
if (toolkit_views) {
- grit_defines += [ "-D", "toolkit_views" ]
+ grit_defines += [
+ "-D",
+ "toolkit_views",
+ ]
}
if (use_aura) {
- grit_defines += [ "-D", "use_aura" ]
+ grit_defines += [
+ "-D",
+ "use_aura",
+ ]
}
if (use_ash) {
- grit_defines += [ "-D", "use_ash" ]
+ grit_defines += [
+ "-D",
+ "use_ash",
+ ]
}
if (use_nss_certs) {
- grit_defines += [ "-D", "use_nss" ]
+ grit_defines += [
+ "-D",
+ "use_nss",
+ ]
}
if (use_ozone) {
- grit_defines += [ "-D", "use_ozone" ]
+ grit_defines += [
+ "-D",
+ "use_ozone",
+ ]
}
if (enable_image_loader_extension) {
- grit_defines += [ "-D", "image_loader_extension" ]
+ grit_defines += [
+ "-D",
+ "image_loader_extension",
+ ]
}
if (enable_remoting) {
- grit_defines += [ "-D", "remoting" ]
+ grit_defines += [
+ "-D",
+ "remoting",
+ ]
}
if (is_android) {
grit_defines += [
- "-t", "android",
- "-E", "ANDROID_JAVA_TAGGED_ONLY=true",
+ "-t",
+ "android",
+ "-E",
+ "ANDROID_JAVA_TAGGED_ONLY=true",
]
}
if (is_mac || is_ios) {
- grit_defines += [ "-D", "scale_factors=2x" ]
+ grit_defines += [
+ "-D",
+ "scale_factors=2x",
+ ]
}
if (is_ios) {
grit_defines += [
- "-t", "ios",
+ "-t",
+ "ios",
+
# iOS uses a whitelist to filter resources.
- "-w", rebase_path("//build/ios/grit_whitelist.txt", root_build_dir),
+ "-w",
+ rebase_path("//build/ios/grit_whitelist.txt", root_build_dir),
]
}
if (enable_extensions) {
- grit_defines += [ "-D", "enable_extensions" ]
+ grit_defines += [
+ "-D",
+ "enable_extensions",
+ ]
}
if (enable_plugins) {
- grit_defines += [ "-D", "enable_plugins" ]
+ grit_defines += [
+ "-D",
+ "enable_plugins",
+ ]
}
if (enable_basic_printing || enable_print_preview) {
- grit_defines += [ "-D", "enable_printing" ]
+ grit_defines += [
+ "-D",
+ "enable_printing",
+ ]
if (enable_print_preview) {
- grit_defines += [ "-D", "enable_print_preview" ]
+ grit_defines += [
+ "-D",
+ "enable_print_preview",
+ ]
}
}
if (enable_themes) {
- grit_defines += [ "-D", "enable_themes" ]
+ grit_defines += [
+ "-D",
+ "enable_themes",
+ ]
}
if (enable_app_list) {
- grit_defines += [ "-D", "enable_app_list" ]
+ grit_defines += [
+ "-D",
+ "enable_app_list",
+ ]
}
if (enable_settings_app) {
- grit_defines += [ "-D", "enable_settings_app" ]
+ grit_defines += [
+ "-D",
+ "enable_settings_app",
+ ]
}
if (enable_google_now) {
- grit_defines += [ "-D", "enable_google_now" ]
+ grit_defines += [
+ "-D",
+ "enable_google_now",
+ ]
}
+
# Note: use_concatenated_impulse_responses is omitted. It is never used and
# should probably be removed from GYP build.
if (enable_webrtc) {
- grit_defines += [ "-D", "enable_webrtc" ]
+ grit_defines += [
+ "-D",
+ "enable_webrtc",
+ ]
}
if (enable_hangout_services_extension) {
- grit_defines += [ "-D", "enable_hangout_services_extension" ]
+ grit_defines += [
+ "-D",
+ "enable_hangout_services_extension",
+ ]
}
if (enable_task_manager) {
- grit_defines += [ "-D", "enable_task_manager" ]
+ grit_defines += [
+ "-D",
+ "enable_task_manager",
+ ]
}
if (enable_notifications) {
- grit_defines += [ "-D", "enable_notifications" ]
+ grit_defines += [
+ "-D",
+ "enable_notifications",
+ ]
}
if (enable_wifi_bootstrapping) {
- grit_defines += [ "-D", "enable_wifi_bootstrapping" ]
+ grit_defines += [
+ "-D",
+ "enable_wifi_bootstrapping",
+ ]
}
if (enable_service_discovery) {
- grit_defines += [ "-D", "enable_service_discovery" ]
+ grit_defines += [
+ "-D",
+ "enable_service_discovery",
+ ]
}
grit_resource_id_file = "//tools/gritsettings/resource_ids"
@@ -249,12 +333,10 @@ template("grit") {
"$target_out_dir/${grit_output_name}_expected_outputs.txt"
write_file(asserted_list_file,
rebase_path(invoker.outputs, root_build_dir, output_dir))
- assert_files_flags += [
- "--assert-file-list=" + rebase_path(asserted_list_file, root_build_dir),
- ]
- grit_outputs = get_path_info(
- rebase_path(invoker.outputs, ".", output_dir),
- "abspath")
+ assert_files_flags += [ "--assert-file-list=" +
+ rebase_path(asserted_list_file, root_build_dir) ]
+ grit_outputs =
+ get_path_info(rebase_path(invoker.outputs, ".", output_dir), "abspath")
# The config and the action below get this visibility son only the generated
# source set can depend on them. The variable "target_name" will get
@@ -282,21 +364,32 @@ template("grit") {
depfile = "$output_dir/${grit_output_name}.d"
args = [
- "-i", source_path, "build",
+ "-i",
+ source_path,
+ "build",
]
if (resource_ids != "") {
- args += [ "-f", resource_ids ]
+ args += [
+ "-f",
+ resource_ids,
+ ]
}
args += [
- "-o", rebased_output_dir,
- "--depdir", ".",
- "--depfile", rebase_path(depfile, root_build_dir),
- ] + grit_defines
+ "-o",
+ rebased_output_dir,
+ "--depdir",
+ ".",
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ ] + grit_defines
# Add extra defines with -D flags.
if (defined(invoker.defines)) {
- foreach (i, invoker.defines) {
- args += [ "-D", i ]
+ foreach(i, invoker.defines) {
+ args += [
+ "-D",
+ i,
+ ]
}
}
@@ -313,7 +406,9 @@ template("grit") {
visibility = target_visibility + invoker.visibility
}
- deps = [ "//tools/grit:grit_sources" ]
+ deps = [
+ "//tools/grit:grit_sources",
+ ]
if (defined(invoker.deps)) {
deps += invoker.deps
}
@@ -328,7 +423,9 @@ template("grit") {
# Deps set on the template invocation will go on the grit script running
# target rather than this library.
- deps = [ ":$grit_custom_target" ]
+ deps = [
+ ":$grit_custom_target",
+ ]
public_configs = [ ":$grit_config" ]
if (defined(invoker.public_configs)) {
diff --git a/build/toolchain/android/BUILD.gn b/build/toolchain/android/BUILD.gn
index 78ef847..e074333 100644
--- a/build/toolchain/android/BUILD.gn
+++ b/build/toolchain/android/BUILD.gn
@@ -24,8 +24,8 @@ template("android_gcc_toolchain") {
gcc_toolchain(target_name) {
# Make our manually injected libs relative to the build dir.
android_ndk_lib = rebase_path(
- invoker.android_ndk_sysroot + "/" + invoker.android_ndk_lib_dir,
- root_build_dir)
+ invoker.android_ndk_sysroot + "/" + invoker.android_ndk_lib_dir,
+ root_build_dir)
libs_section_prefix = "$android_ndk_lib/crtbegin_dynamic.o"
libs_section_postfix = "$android_ndk_lib/crtend_android.o"
@@ -63,8 +63,10 @@ template("android_gcc_toolchain") {
android_strip = "${tool_prefix}strip"
mkdir_command = "mkdir -p lib.stripped"
- strip_command = "$android_strip --strip-unneeded -o $temp_stripped_soname $soname"
- replace_command = "if ! cmp -s $temp_stripped_soname $stripped_soname; then mv $temp_stripped_soname $stripped_soname; fi"
+ strip_command =
+ "$android_strip --strip-unneeded -o $temp_stripped_soname $soname"
+ replace_command =
+ "if ! cmp -s $temp_stripped_soname $stripped_soname; then mv $temp_stripped_soname $stripped_soname; fi"
postsolink = "$mkdir_command && $strip_command && $replace_command"
solink_outputs = [ stripped_soname ]
diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni
index e415459..4a4ef45 100644
--- a/build/toolchain/gcc_toolchain.gni
+++ b/build/toolchain/gcc_toolchain.gni
@@ -84,33 +84,33 @@ template("gcc_toolchain") {
tool("cc") {
depfile = "{{output}}.d"
- command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
+ command =
+ "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "CC {{output}}"
- outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
- ]
+ outputs =
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
}
tool("cxx") {
depfile = "{{output}}.d"
- command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
+ command =
+ "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "CXX {{output}}"
- outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
- ]
+ outputs =
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
}
tool("asm") {
# For GCC we can just use the C compiler to compile assembly.
depfile = "{{output}}.d"
- command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
+ command =
+ "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "ASM {{output}}"
- outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
- ]
+ outputs =
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
}
tool("alink") {
@@ -118,9 +118,8 @@ template("gcc_toolchain") {
command = "rm -f {{output}} && $ar rcs {{output}} @$rspfile"
description = "AR {{output}}"
rspfile_content = "{{inputs}}"
- outputs = [
- "{{target_out_dir}}/{{target_output_name}}{{output_extension}}"
- ]
+ outputs =
+ [ "{{target_out_dir}}/{{target_output_name}}{{output_extension}}" ]
default_output_extension = ".a"
output_prefix = "lib"
}
@@ -136,15 +135,19 @@ template("gcc_toolchain") {
# existing .TOC file, overwrite it, otherwise, don't change it.
tocfile = sofile + ".TOC"
temporary_tocname = sofile + ".tmp"
- link_command = "$ld -shared {{ldflags}} -o $sofile -Wl,-soname=$soname @$rspfile"
- toc_command = "{ readelf -d $sofile | grep SONAME ; nm -gD -f p $soname | cut -f1-2 -d' '; } > $temporary_tocname"
- replace_command = "if ! cmp -s $temporary_tocname $tocfile; then mv $temporary_tocname $tocfile; fi"
+ link_command =
+ "$ld -shared {{ldflags}} -o $sofile -Wl,-soname=$soname @$rspfile"
+ toc_command =
+ "{ readelf -d $sofile | grep SONAME ; nm -gD -f p $soname | cut -f1-2 -d' '; } > $temporary_tocname"
+ replace_command =
+ "if ! cmp -s $temporary_tocname $tocfile; then mv $temporary_tocname $tocfile; fi"
command = "$link_command && $toc_command && $replace_command"
if (defined(invoker.postsolink)) {
command += " && " + invoker.postsolink
}
- rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix"
+ rspfile_content =
+ "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix"
description = "SOLINK $sofile"
@@ -176,7 +179,8 @@ template("gcc_toolchain") {
tool("link") {
outfile = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}"
rspfile = "$outfile.rsp"
- command = "$ld {{ldflags}} -o $outfile -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group $libs_section_prefix {{libs}} $libs_section_postfix"
+ command =
+ "$ld {{ldflags}} -o $outfile -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group $libs_section_prefix {{libs}} $libs_section_postfix"
if (defined(invoker.postlink)) {
command += " && " + invoker.postlink
}
@@ -194,7 +198,8 @@ template("gcc_toolchain") {
}
tool("copy") {
- command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})"
+ command =
+ "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})"
description = "COPY {{source}} {{output}}"
}
diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn
index b1cd36b..052e76c 100644
--- a/build/toolchain/mac/BUILD.gn
+++ b/build/toolchain/mac/BUILD.gn
@@ -28,7 +28,7 @@ ld = cxx
# This will copy the gyp-mac-tool to the build directory. We pass in the source
# file of the win tool.
gyp_mac_tool_source =
- rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", root_build_dir)
+ rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", root_build_dir)
exec_script("setup_toolchain.py", [ gyp_mac_tool_source ])
# Shared toolchain definition. Invocations should set toolchain_os to set the
@@ -57,61 +57,61 @@ template("mac_clang_toolchain") {
tool("cc") {
depfile = "{{output}}.d"
- command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
+ command =
+ "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "CC {{output}}"
- outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
- ]
+ outputs =
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
}
tool("cxx") {
depfile = "{{output}}.d"
- command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
+ command =
+ "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "CXX {{output}}"
- outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
- ]
+ outputs =
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
}
tool("asm") {
# For GCC we can just use the C compiler to compile assembly.
depfile = "{{output}}.d"
- command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
+ command =
+ "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "ASM {{output}}"
- outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
- ]
+ outputs =
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
}
tool("objc") {
depfile = "{{output}}.d"
- command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} {{cflags_objc}} -c {{source}} -o {{output}}"
+ command =
+ "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} {{cflags_objc}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "OBJC {{output}}"
- outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
- ]
+ outputs =
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
}
tool("objcxx") {
depfile = "{{output}}.d"
- command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} {{cflags_objcc}} -c {{source}} -o {{output}}"
+ command =
+ "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} {{cflags_objcc}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "OBJCXX {{output}}"
- outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
- ]
+ outputs =
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ]
}
tool("alink") {
- command = "rm -f {{output}} && ./gyp-mac-tool filter-libtool libtool -static -o {{output}} {{inputs}}"
+ command =
+ "rm -f {{output}} && ./gyp-mac-tool filter-libtool libtool -static -o {{output}} {{inputs}}"
description = "LIBTOOL-STATIC {{output}}"
- outputs = [
- "{{target_out_dir}}/{{target_output_name}}{{output_extension}}"
- ]
+ outputs =
+ [ "{{target_out_dir}}/{{target_output_name}}{{output_extension}}" ]
default_output_extension = ".a"
output_prefix = "lib"
}
@@ -131,12 +131,17 @@ template("mac_clang_toolchain") {
tocname = dylib + ".TOC"
temporary_tocname = dylib + ".tmp"
- does_reexport_command = "[ ! -e $dylib -o ! -e $tocname ] || otool -l $dylib | grep -q LC_REEXPORT_DYLIB"
- link_command = "$ld -shared {{ldflags}} -o $dylib -Wl,-filelist,$rspfile {{solibs}} {{libs}}"
- replace_command = "if ! cmp -s $temporary_tocname $tocname; then mv $temporary_tocname $tocname"
- extract_toc_command = "{ otool -l $dylib | grep LC_ID_DYLIB -A 5; nm -gP $dylib | cut -f1-2 -d' ' | grep -v U\$\$; true; }"
+ does_reexport_command =
+ "[ ! -e $dylib -o ! -e $tocname ] || otool -l $dylib | grep -q LC_REEXPORT_DYLIB"
+ link_command =
+ "$ld -shared {{ldflags}} -o $dylib -Wl,-filelist,$rspfile {{solibs}} {{libs}}"
+ replace_command =
+ "if ! cmp -s $temporary_tocname $tocname; then mv $temporary_tocname $tocname"
+ extract_toc_command =
+ "{ otool -l $dylib | grep LC_ID_DYLIB -A 5; nm -gP $dylib | cut -f1-2 -d' ' | grep -v U\$\$; true; }"
- command = "if $does_reexport_command ; then $link_command && $extract_toc_command > $tocname; else $link_command && $extract_toc_command > $temporary_tocname && $replace_command ; fi; fi"
+ command =
+ "if $does_reexport_command ; then $link_command && $extract_toc_command > $tocname; else $link_command && $extract_toc_command > $temporary_tocname && $replace_command ; fi; fi"
rspfile_content = "{{inputs_newline}}"
@@ -167,7 +172,8 @@ template("mac_clang_toolchain") {
tool("link") {
outfile = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}"
rspfile = "$outfile.rsp"
- command = "$ld {{ldflags}} -o $outfile -Wl,-filelist,$rspfile {{solibs}} {{libs}}"
+ command =
+ "$ld {{ldflags}} -o $outfile -Wl,-filelist,$rspfile {{solibs}} {{libs}}"
description = "LINK $outfile"
rspfile_content = "{{inputs_newline}}"
outputs = [ outfile ]
@@ -179,7 +185,8 @@ template("mac_clang_toolchain") {
}
tool("copy") {
- command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})"
+ command =
+ "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})"
description = "COPY {{source}} {{output}}"
}
diff --git a/build/toolchain/nacl/BUILD.gn b/build/toolchain/nacl/BUILD.gn
index 8c76f5a..bea30e0 100644
--- a/build/toolchain/nacl/BUILD.gn
+++ b/build/toolchain/nacl/BUILD.gn
@@ -9,14 +9,16 @@ toolchain("x86_newlib") {
ld = toolprefix + "g++"
tool("cc") {
- command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c -c \$in -o \$out"
+ command =
+ "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c -c \$in -o \$out"
description = "CC(NaCl x86 Newlib) \$out"
depfile = "\$out.d"
depsformat = "gcc"
}
tool("cxx") {
# cflags_pch_cc
- command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc -c \$in -o \$out"
+ command =
+ "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc -c \$in -o \$out"
description = "CXX(NaCl x86 Newlib) \$out"
depfile = "\$out.d"
depsformat = "gcc"
@@ -26,14 +28,18 @@ toolchain("x86_newlib") {
description = "AR(NaCl x86 Newlib) \$out"
}
tool("solink") {
- command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ]; then $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi"
+ command =
+ "if [ ! -e \$lib -o ! -e \${lib}.TOC ]; then $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi"
description = "SOLINK(NaCl x86 Newlib) \$lib"
+
#pool = "link_pool"
restat = "1"
}
tool("link") {
- command = "$ld \$ldflags -o \$out -Wl,--start-group \$in \$solibs -Wl,--end-group \$libs"
+ command =
+ "$ld \$ldflags -o \$out -Wl,--start-group \$in \$solibs -Wl,--end-group \$libs"
description = "LINK(NaCl x86 Newlib) \$out"
+
#pool = "link_pool"
}
diff --git a/build/toolchain/win/BUILD.gn b/build/toolchain/win/BUILD.gn
index 87bd254..1bd6730 100644
--- a/build/toolchain/win/BUILD.gn
+++ b/build/toolchain/win/BUILD.gn
@@ -13,14 +13,14 @@ assert(is_win)
# Its arguments are the VS path and the compiler wrapper tool. It will write
# "environment.x86" and "environment.x64" to the build directory and return a
# list to us.
-gyp_win_tool_path = rebase_path("//tools/gyp/pylib/gyp/win_tool.py",
- root_build_dir)
+gyp_win_tool_path =
+ rebase_path("//tools/gyp/pylib/gyp/win_tool.py", root_build_dir)
exec_script("setup_toolchain.py",
[
visual_studio_path,
gyp_win_tool_path,
windows_sdk_path,
- visual_studio_runtime_dirs
+ visual_studio_runtime_dirs,
])
# This value will be inherited in the toolchain below.
@@ -41,62 +41,67 @@ template("msvc_toolchain") {
} else {
configuration = "Release"
}
- exec_script("../../vs_toolchain.py", ["copy_dlls",
- rebase_path(root_build_dir),
- configuration,
- invoker.cpu_arch])
+ exec_script("../../vs_toolchain.py",
+ [
+ "copy_dlls",
+ rebase_path(root_build_dir),
+ configuration,
+ invoker.cpu_arch,
+ ])
toolchain(target_name) {
# Make these apply to all tools below.
lib_switch = ""
- lib_dir_switch="/LIBPATH:"
+ lib_dir_switch = "/LIBPATH:"
tool("cc") {
rspfile = "{{output}}.rsp"
pdbname = "{{target_out_dir}}/{{target_output_name}}_c.pdb"
- command = "ninja -t msvc -e $env -- cl.exe /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname"
+ command =
+ "ninja -t msvc -e $env -- cl.exe /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname"
depsformat = "msvc"
description = "CC {{output}}"
- outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj",
- ]
+ outputs =
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj" ]
rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}"
}
tool("cxx") {
rspfile = "{{output}}.rsp"
+
# The PDB name needs to be different between C and C++ compiled files.
pdbname = "{{target_out_dir}}/{{target_output_name}}_cc.pdb"
- command = "ninja -t msvc -e $env -- cl.exe /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname"
+ command =
+ "ninja -t msvc -e $env -- cl.exe /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname"
depsformat = "msvc"
description = "CXX {{output}}"
- outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj",
- ]
+ outputs =
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj" ]
rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}"
}
tool("rc") {
- command = "$python_path gyp-win-tool rc-wrapper $env rc.exe {{defines}} {{include_dirs}} /fo{{output}} {{source}}"
- outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.res",
- ]
+ command =
+ "$python_path gyp-win-tool rc-wrapper $env rc.exe {{defines}} {{include_dirs}} /fo{{output}} {{source}}"
+ outputs =
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.res" ]
description = "RC {{output}}"
}
tool("asm") {
# TODO(brettw): "/safeseh" assembler argument is hardcoded here. Extract
# assembler flags to a variable like cflags. crbug.com/418613
- command = "$python_path gyp-win-tool asm-wrapper $env ml.exe {{defines}} {{include_dirs}} /safeseh /c /Fo {{output}} {{source}}"
+ command =
+ "$python_path gyp-win-tool asm-wrapper $env ml.exe {{defines}} {{include_dirs}} /safeseh /c /Fo {{output}} {{source}}"
description = "ASM {{output}}"
- outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj",
- ]
+ outputs =
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj" ]
}
tool("alink") {
rspfile = "{{output}}.rsp"
- command = "$python_path gyp-win-tool link-wrapper $env False lib.exe /nologo /ignore:4221 /OUT:{{output}} @$rspfile"
+ command =
+ "$python_path gyp-win-tool link-wrapper $env False lib.exe /nologo /ignore:4221 /OUT:{{output}} @$rspfile"
description = "LIB {{output}}"
outputs = [
# Ignore {{output_extension}} and always use .lib, there's no reason to
@@ -104,6 +109,7 @@ template("msvc_toolchain") {
"{{target_out_dir}}/{{target_output_name}}.lib",
]
default_output_extension = ".lib"
+
# The use of inputs_newline is to work around a fixed per-line buffer
# size in the linker.
rspfile_content = "{{inputs_newline}}"
@@ -111,10 +117,12 @@ template("msvc_toolchain") {
tool("solink") {
dllname = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" # e.g. foo.dll
- libname = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}.lib" # e.g. foo.dll.lib
+ libname =
+ "{{root_out_dir}}/{{target_output_name}}{{output_extension}}.lib" # e.g. foo.dll.lib
rspfile = "${dllname}.rsp"
- link_command = "$python_path gyp-win-tool link-wrapper $env False link.exe /nologo /IMPLIB:$libname /DLL /OUT:$dllname /PDB:${dllname}.pdb @$rspfile"
+ link_command =
+ "$python_path gyp-win-tool link-wrapper $env False link.exe /nologo /IMPLIB:$libname /DLL /OUT:$dllname /PDB:${dllname}.pdb @$rspfile"
# TODO(brettw) support manifests
#manifest_command = "$python_path gyp-win-tool manifest-wrapper $env mt.exe -nologo -manifest $manifests -out:${dllname}.manifest"
@@ -129,6 +137,7 @@ template("msvc_toolchain") {
]
link_output = libname
depend_output = libname
+
# The use of inputs_newline is to work around a fixed per-line buffer
# size in the linker.
rspfile_content = "{{libs}} {{solibs}} {{inputs_newline}} {{ldflags}}"
@@ -137,7 +146,8 @@ template("msvc_toolchain") {
tool("link") {
rspfile = "{{output}}.rsp"
- link_command = "$python_path gyp-win-tool link-wrapper $env False link.exe /nologo /OUT:{{output}} /PDB:{{output}}.pdb @$rspfile"
+ link_command =
+ "$python_path gyp-win-tool link-wrapper $env False link.exe /nologo /OUT:{{output}} /PDB:{{output}}.pdb @$rspfile"
# TODO(brettw) support manifests
#manifest_command = "$python_path gyp-win-tool manifest-wrapper $env mt.exe -nologo -manifest $manifests -out:{{output}}.manifest"
@@ -146,9 +156,9 @@ template("msvc_toolchain") {
default_output_extension = ".exe"
description = "LINK {{output}}"
- outputs = [
- "{{root_out_dir}}/{{target_output_name}}{{output_extension}}",
- ]
+ outputs =
+ [ "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" ]
+
# The use of inputs_newline is to work around a fixed per-line buffer
# size in the linker.
rspfile_content = "{{inputs_newline}} {{libs}} {{solibs}} {{ldflags}}"
@@ -160,7 +170,8 @@ template("msvc_toolchain") {
}
tool("copy") {
- command = "$python_path gyp-win-tool recursive-mirror {{source}} {{output}}"
+ command =
+ "$python_path gyp-win-tool recursive-mirror {{source}} {{output}}"
description = "COPY {{source}} {{output}}"
}
diff --git a/build/toolchain/win/midl.gni b/build/toolchain/win/midl.gni
index 7f068d0..9fda96b 100644
--- a/build/toolchain/win/midl.gni
+++ b/build/toolchain/win/midl.gni
@@ -67,7 +67,8 @@ template("midl") {
}
args = [
- "midl-wrapper", win_tool_arch,
+ "midl-wrapper",
+ win_tool_arch,
rebase_path(out_dir, root_build_dir),
type_library_file,
header_file,
@@ -75,13 +76,18 @@ template("midl") {
interface_identifier_file,
proxy_file,
"{{source}}",
- "/char", "signed",
- "/env", idl_target_platform,
+ "/char",
+ "signed",
+ "/env",
+ idl_target_platform,
"/Oicf",
]
foreach(include, system_include_dirs) {
- args += [ "/I", include ]
+ args += [
+ "/I",
+ include,
+ ]
}
}
@@ -91,10 +97,11 @@ template("midl") {
}
# We only compile the IID files from the IDL tool rather than all outputs.
- sources = process_file_template(
- invoker.sources,
- [ "$out_dir/$interface_identifier_file" ])
+ sources = process_file_template(invoker.sources,
+ [ "$out_dir/$interface_identifier_file" ])
- deps = [ ":$action_name" ]
+ deps = [
+ ":$action_name",
+ ]
}
}
diff --git a/build/util/BUILD.gn b/build/util/BUILD.gn
index 320c5ee..3fc7757 100644
--- a/build/util/BUILD.gn
+++ b/build/util/BUILD.gn
@@ -6,15 +6,20 @@ action("webkit_version") {
script = "version.py"
lastchange_file = "LASTCHANGE.blink"
+
# TODO(brettw) move from content to this directory.
template_file = "//content/webkit_version.h.in"
- inputs = [ lastchange_file, template_file ]
+ inputs = [
+ lastchange_file,
+ template_file,
+ ]
output_file = "$root_gen_dir/webkit_version.h"
outputs = [ output_file ]
args = [
- "-f", rebase_path(lastchange_file, root_build_dir),
+ "-f",
+ rebase_path(lastchange_file, root_build_dir),
rebase_path(template_file, root_build_dir),
rebase_path(output_file, root_build_dir),
]