Skip to content

Commit 3bc3362

Browse files
chinmaygardemboetger
authored andcommitted
Fixup formatting of gn files in the old buildroot. (flutter#174852)
`git ls-files "*.gn*" | xargs ./flutter/third_party/gn/gn format` We already seem to enforce GN format on pull-requests. These seem to old files in the buildroot no one has touched in a while.
1 parent 481da78 commit 3bc3362

File tree

21 files changed

+145
-136
lines changed

21 files changed

+145
-136
lines changed

engine/src/build/config/BUILDCONFIG.gn

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ default_library_type = "static_library"
347347

348348
# These Sanitizers all imply using the Clang compiler. On Windows they either
349349
# don't work or work differently.
350-
using_sanitizer = !is_win && (is_asan || is_hwasan || is_lsan || is_tsan || is_msan)
350+
using_sanitizer =
351+
!is_win && (is_asan || is_hwasan || is_lsan || is_tsan || is_msan)
351352
if (!is_clang && using_sanitizer) {
352353
is_clang = true
353354
}

engine/src/build/config/darwin/BUILD.gn

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ config("compiler") {
3232
# x86, arm, armv7, etc.
3333
assert(false, "unsupported cpu: $current_cpu")
3434
}
35+
3536
# OS and deployment target.
3637
if (is_ios) {
3738
_triplet_os = "apple-ios"
@@ -40,13 +41,15 @@ config("compiler") {
4041
_triplet_os = "apple-macos"
4142
_deployment_target = mac_deployment_target
4243
}
44+
4345
# Environment.
4446
if (use_ios_simulator) {
4547
_triplet_environment = "-simulator"
4648
} else {
4749
_triplet_environment = ""
4850
}
49-
_target_triplet = "$_triplet_cpu-$_triplet_os$_deployment_target$_triplet_environment"
51+
_target_triplet =
52+
"$_triplet_cpu-$_triplet_os$_deployment_target$_triplet_environment"
5053

5154
# swiftc -swift-version flag.
5255
#
@@ -71,6 +74,6 @@ config("compiler") {
7174
"-target",
7275
_target_triplet,
7376
"-swift-version",
74-
_swift_version
77+
_swift_version,
7578
]
7679
}

engine/src/build/config/gcc/BUILD.gn

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ config("relative_paths") {
7676
"-fdebug-prefix-map=$absolute_path=$relative_path",
7777
]
7878
} else {
79-
cflags += [
80-
"-fdebug-prefix-map=$absolute_path=$relative_path",
81-
]
79+
cflags += [ "-fdebug-prefix-map=$absolute_path=$relative_path" ]
8280
}
8381
cflags += [
8482
# This makes sure that include directories in the toolchain are

engine/src/build/toolchain/android/BUILD.gn

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ template("android_toolchain") {
4040
remote_wrapper = ""
4141
if (host_os == "linux") {
4242
remote_wrapper =
43-
rebase_path("//flutter/build/rbe/remote_wrapper_linux.sh", root_build_dir)
43+
rebase_path("//flutter/build/rbe/remote_wrapper_linux.sh",
44+
root_build_dir)
4445
} else if (host_os == "mac") {
4546
remote_wrapper =
4647
rebase_path("//flutter/build/rbe/remote_wrapper.sh", root_build_dir)
@@ -50,10 +51,10 @@ template("android_toolchain") {
5051
local_wrapper =
5152
rebase_path("//flutter/build/rbe/local_wrapper.sh", root_build_dir)
5253
compiler_args = rewrapper_command + [
53-
"--remote_wrapper=$remote_wrapper",
54-
"--local_wrapper=$local_wrapper",
55-
"--labels=type=compile,compiler=clang,lang=cpp ",
56-
]
54+
"--remote_wrapper=$remote_wrapper",
55+
"--local_wrapper=$local_wrapper",
56+
"--labels=type=compile,compiler=clang,lang=cpp ",
57+
]
5758
assembler_prefix = ""
5859
compiler_prefix = string_join(" ", compiler_args)
5960
link_prefix = ""

engine/src/build/toolchain/ccache.gni

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# speed, you can do:
2020
# export CCACHE_CPP2=yes
2121

22-
import("//build/toolchain/rbe.gni") # for use_rbe
22+
import("//build/toolchain/rbe.gni") # for use_rbe
2323

2424
declare_args() {
2525
# Set to true to enable ccache. Probably doesn't work on windows.

engine/src/build/toolchain/fuchsia/BUILD.gn

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# Use of this source code is governed by a BSD-style license that can be
33
# found in the LICENSE file.
44

5+
import("//build/toolchain/ccache.gni")
56
import("//build/toolchain/clang.gni")
67
import("//build/toolchain/rbe.gni")
7-
import("//build/toolchain/ccache.gni")
88
import("//build/toolchain/toolchain.gni")
99

1010
if (use_rbe) {
@@ -25,7 +25,8 @@ toolchain("fuchsia") {
2525
assert(target_cpu == "x64" || target_cpu == "arm64",
2626
"We currently only support 'x64' and 'arm64' targets for fuchsia.")
2727
toolchain_bin =
28-
rebase_path("$buildtools_path/${host_os}-${host_cpu}/clang/bin", root_out_dir)
28+
rebase_path("$buildtools_path/${host_os}-${host_cpu}/clang/bin",
29+
root_out_dir)
2930
fuchsia_sdk = rebase_path("//fuchsia/sdk/$host_os", root_out_dir)
3031

3132
# We can't do string interpolation ($ in strings) on things with dots in

engine/src/build/toolchain/linux/BUILD.gn

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ if (use_rbe) {
1818
local_wrapper =
1919
rebase_path("//flutter/build/rbe/local_wrapper.sh", root_build_dir)
2020
compiler_args = rewrapper_command + [
21-
"--remote_wrapper=$remote_wrapper",
22-
"--local_wrapper=$local_wrapper",
23-
"--labels=type=compile,compiler=clang,lang=cpp ",
24-
]
21+
"--remote_wrapper=$remote_wrapper",
22+
"--local_wrapper=$local_wrapper",
23+
"--labels=type=compile,compiler=clang,lang=cpp ",
24+
]
2525
compiler_prefix = string_join(" ", compiler_args)
2626
link_prefix = ""
2727
} else if (use_ccache) {

engine/src/build/toolchain/mac/BUILD.gn

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ assert(host_os == "mac")
66

77
import("//build/config/darwin/darwin_sdk.gni")
88
import("//build/config/sysroot.gni")
9+
import("//build/toolchain/ccache.gni")
910
import("//build/toolchain/clang.gni")
1011
import("//build/toolchain/clang_static_analyzer.gni")
1112
import("//build/toolchain/rbe.gni")
12-
import("//build/toolchain/ccache.gni")
1313
import("//build/toolchain/toolchain.gni")
1414

1515
declare_args() {
@@ -45,7 +45,7 @@ if (swift_whole_module_optimization == -1) {
4545
# would be to have inputs to tools (https://crbug.com/621119).
4646
get_tool_mtime = rebase_path("//build/toolchain/darwin/get_tool_mtime.py")
4747
tool_versions = exec_script(
48-
get_tool_mtime, # "get_tool_mtime.py",
48+
get_tool_mtime, # "get_tool_mtime.py",
4949
rebase_path(
5050
[
5151
"//build/toolchain/darwin/swift_const_gather_protocols.json",
@@ -73,13 +73,15 @@ if (use_ccache) {
7373
local_wrapper =
7474
rebase_path("//flutter/build/rbe/local_wrapper.sh", root_build_dir)
7575
compiler_args = rewrapper_command + [
76-
"--remote_wrapper=$remote_wrapper",
77-
"--local_wrapper=$local_wrapper",
78-
"--labels=type=compile,compiler=clang,lang=cpp ",
79-
]
76+
"--remote_wrapper=$remote_wrapper",
77+
"--local_wrapper=$local_wrapper",
78+
"--labels=type=compile,compiler=clang,lang=cpp ",
79+
]
8080
cxx_prefix = string_join(" ", compiler_args)
81+
8182
# RBE does not support objc out of the box.
8283
objc_prefix = ""
84+
8385
# Remote links time out without reporting an actionable error.
8486
link_prefix = ""
8587
} else {
@@ -95,7 +97,8 @@ template("mac_toolchain") {
9597
assert(defined(invoker.asm), "mac_toolchain() must specify a \"asm\" value")
9698
assert(defined(invoker.cc), "mac_toolchain() must specify a \"cc\" value")
9799
assert(defined(invoker.cxx), "mac_toolchain() must specify a \"cxx\" value")
98-
assert(defined(invoker.objc), "mac_toolchain() must specify a \"objc\" value")
100+
assert(defined(invoker.objc),
101+
"mac_toolchain() must specify a \"objc\" value")
99102
assert(defined(invoker.ld), "mac_toolchain() must specify a \"ld\" value")
100103
assert(defined(invoker.ar), "mac_toolchain() must specify a \"ar\" value")
101104
assert(defined(invoker.toolchain_cpu),
@@ -160,7 +163,9 @@ template("mac_toolchain") {
160163
command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} {{module_deps_no_self}} -fmodule-name={{label_name}} -c -x c++ -Xclang -emit-module {{source}} -o {{output}}"
161164
depsformat = "gcc"
162165
description = "CXX_MODULE {{output}}"
163-
outputs = [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.pcm" ]
166+
outputs = [
167+
"{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.pcm",
168+
]
164169
}
165170

166171
tool("asm") {
@@ -199,7 +204,8 @@ template("mac_toolchain") {
199204
depfile = "{{target_out_dir}}/{{module_name}}.d"
200205
depsformat = "gcc"
201206

202-
_header_path = "{{target_gen_dir}}/{{target_output_name}}/{{target_output_name}}.h"
207+
_header_path =
208+
"{{target_gen_dir}}/{{target_output_name}}/{{target_output_name}}.h"
203209
_output_dir = "{{target_out_dir}}/{{label_name}}"
204210

205211
outputs = [
@@ -433,7 +439,8 @@ if (is_ios) {
433439
is_clang = true
434440

435441
sysroot_rel = rebase_path(ios_sdk_path, root_build_dir)
436-
sysroot_flags = "-isysroot $sysroot_rel -miphoneos-version-min=$ios_deployment_target"
442+
sysroot_flags =
443+
"-isysroot $sysroot_rel -miphoneos-version-min=$ios_deployment_target"
437444
}
438445

439446
# Toolchain used for iOS simulator targets (arm64).

engine/src/build/toolchain/qnx/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ gcc_toolchain("qnx") {
1919
toolchain_os = "linux"
2020
is_clang = false
2121
}
22-

engine/src/build/toolchain/rbe.gni

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,32 +44,20 @@ rewrapper_command = [
4444
"--exec_root=$rbe_exec_root",
4545
]
4646
if (rbe_server_address != "") {
47-
rewrapper_command += [
48-
"--server_address=$rbe_server_address",
49-
]
47+
rewrapper_command += [ "--server_address=$rbe_server_address" ]
5048
}
5149
if (rbe_exec_strategy != "") {
52-
rewrapper_command += [
53-
"--exec_strategy=$rbe_exec_strategy",
54-
]
50+
rewrapper_command += [ "--exec_strategy=$rbe_exec_strategy" ]
5551
}
5652
if (rbe_dial_timeout != "") {
57-
rewrapper_command += [
58-
"--dial_timeout=$rbe_dial_timeout",
59-
]
53+
rewrapper_command += [ "--dial_timeout=$rbe_dial_timeout" ]
6054
}
6155
if (rbe_exec_timeout != "") {
62-
rewrapper_command += [
63-
"--exec_timeout=$rbe_exec_timeout",
64-
]
56+
rewrapper_command += [ "--exec_timeout=$rbe_exec_timeout" ]
6557
}
6658
if (rbe_reclient_timeout != "") {
67-
rewrapper_command += [
68-
"--reclient_timeout=$rbe_reclient_timeout",
69-
]
59+
rewrapper_command += [ "--reclient_timeout=$rbe_reclient_timeout" ]
7060
}
7161
if (rbe_platform != "") {
72-
rewrapper_command += [
73-
"--platform=$rbe_platform",
74-
]
62+
rewrapper_command += [ "--platform=$rbe_platform" ]
7563
}

0 commit comments

Comments
 (0)