Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit 8b207da

Browse files
zandersoeyebrowsoffire
authored andcommitted
Simplify GN pools, use for some toolchain actions (#856)
Companion to flutter/engine#52721
1 parent a4d5d30 commit 8b207da

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

build/toolchain/BUILD.gn

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright 2013 The Flutter Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
import("//build/toolchain/toolchain.gni")
6+
7+
pool("toolchain_pool") {
8+
depth = concurrent_toolchain_jobs
9+
}

build/toolchain/gcc_toolchain.gni

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ template("gcc_toolchain") {
141141
}
142142

143143
tool("asm") {
144+
pool = "//build/toolchain:toolchain_pool($current_toolchain)"
144145
depfile = "{{output}}.d"
145146
command = "$asm -MMD -MF$depfile {{defines}} {{include_dirs}} {{asmflags}} {{cflags}} {{cflags_c}} $coverage_flags -c {{source}} -o {{output}}"
146147
depsformat = "gcc"
@@ -150,6 +151,7 @@ template("gcc_toolchain") {
150151
}
151152

152153
tool("alink") {
154+
pool = "//build/toolchain:toolchain_pool($current_toolchain)"
153155
rspfile = "{{output}}.rsp"
154156
command = "rm -f {{output}} && $ar rcs {{output}} @$rspfile"
155157
description = "AR {{output}}"
@@ -161,6 +163,7 @@ template("gcc_toolchain") {
161163
}
162164

163165
tool("solink") {
166+
pool = "//build/toolchain:toolchain_pool($current_toolchain)"
164167
soname = "{{target_output_name}}{{output_extension}}" # e.g. "libfoo.so".
165168
sofile = "{{root_out_dir}}/$soname" # Possibly including toolchain dir.
166169
rspfile = sofile + ".rsp"
@@ -228,6 +231,7 @@ template("gcc_toolchain") {
228231
}
229232

230233
tool("link") {
234+
pool = "//build/toolchain:toolchain_pool($current_toolchain)"
231235
exename = "{{target_output_name}}{{output_extension}}"
232236
outfile = "{{root_out_dir}}/$exename"
233237
rspfile = "$outfile.rsp"

build/toolchain/mac/BUILD.gn

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ template("mac_toolchain") {
115115
}
116116

117117
tool("asm") {
118+
pool = "//build/toolchain:toolchain_pool($current_toolchain)"
118119
depfile = "{{output}}.d"
119120
command = "$asm -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} {{cflags}} {{cflags_c}} $sysroot_flags -c {{source}} -o {{output}}"
120121
depsformat = "gcc"
@@ -124,6 +125,7 @@ template("mac_toolchain") {
124125
}
125126

126127
tool("objc") {
128+
pool = "//build/toolchain:toolchain_pool($current_toolchain)"
127129
depfile = "{{output}}.d"
128130
command = "$objc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} {{cflags_objc}} $sysroot_flags $coverage_flags -c {{source}} -o {{output}}"
129131
depsformat = "gcc"
@@ -133,6 +135,7 @@ template("mac_toolchain") {
133135
}
134136

135137
tool("objcxx") {
138+
pool = "//build/toolchain:toolchain_pool($current_toolchain)"
136139
depfile = "{{output}}.d"
137140
command = "$objc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} {{cflags_objcc}} $sysroot_flags $coverage_flags -c {{source}} -o {{output}}"
138141
depsformat = "gcc"
@@ -142,6 +145,7 @@ template("mac_toolchain") {
142145
}
143146

144147
tool("alink") {
148+
pool = "//build/toolchain:toolchain_pool($current_toolchain)"
145149
command = "rm -f {{output}} && $ar rcs {{output}} {{inputs}}"
146150
description = "CREATE ARCHIVE {{output}}"
147151
outputs =
@@ -151,6 +155,7 @@ template("mac_toolchain") {
151155
}
152156

153157
tool("solink") {
158+
pool = "//build/toolchain:toolchain_pool($current_toolchain)"
154159
dylib = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" # eg
155160
# "./libfoo.dylib"
156161
rspfile = dylib + ".rsp"
@@ -202,6 +207,7 @@ template("mac_toolchain") {
202207
}
203208

204209
tool("link") {
210+
pool = "//build/toolchain:toolchain_pool($current_toolchain)"
205211
outfile = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}"
206212
rspfile = "$outfile.rsp"
207213

build/toolchain/toolchain.gni

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
# Copyright 2020 The Flutter Authors. All rights reserved.
1+
# Copyright 2013 The Flutter Authors. All rights reserved.
22
# Use of this source code is governed by a BSD-style license that can be
33
# found in the LICENSE file.
44

55
declare_args() {
66
buildtools_path = "//buildtools"
7+
8+
# Maximum number of local toolchain tasks to run in parallel.
9+
concurrent_toolchain_jobs = 1
710
}
811

912
use_xcode_clang = false

0 commit comments

Comments
 (0)