Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: build/toolchain/mac/BUILD.gn

Issue 2018553003: [GN] Configure a pool for copy_bundle_data and compile_xcassets tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-pool
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires 5 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires
6 # some enhancements since the commands on Mac are slightly different than on 6 # some enhancements since the commands on Mac are slightly different than on
7 # Linux. 7 # Linux.
8 8
9 import("../goma.gni") 9 import("../goma.gni")
10 import("//build/config/ios/ios_sdk.gni") 10 import("//build/config/ios/ios_sdk.gni")
11 import("//build/config/mac/mac_sdk.gni") 11 import("//build/config/mac/mac_sdk.gni")
12 12
13 assert(host_os == "mac") 13 assert(host_os == "mac")
14 14
15 import("//build/toolchain/goma.gni") 15 import("//build/toolchain/goma.gni")
16 import("//build/toolchain/toolchain.gni") 16 import("//build/toolchain/toolchain.gni")
17 17
18 if (use_goma) { 18 if (use_goma) {
19 goma_prefix = "$goma_dir/gomacc " 19 goma_prefix = "$goma_dir/gomacc "
20 } else { 20 } else {
21 goma_prefix = "" 21 goma_prefix = ""
22 } 22 }
23 23
24 if (current_toolchain == default_toolchain) {
25 # Reduce the number of tasks using the copy_bundle_data and compile_xcassets
26 # tools as they can cause lots of I/O contention when invoking ninja with a
27 # large number of parallel jobs (e.g. when using distributed build like goma).
28 pool("bundle_pool") {
29 depth = 20
Dirk Pranke 2016/05/31 22:29:44 Your desktop machine is probably a lot beefier tha
sdefresne 2016/06/01 08:22:29 Done.
30 }
31 }
32
24 # This will copy the gyp-mac-tool to the build directory. We pass in the source 33 # This will copy the gyp-mac-tool to the build directory. We pass in the source
25 # file of the mac tool. 34 # file of the mac tool.
26 gyp_mac_tool_source = 35 gyp_mac_tool_source =
27 rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", root_build_dir) 36 rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", root_build_dir)
28 exec_script("setup_toolchain.py", [ gyp_mac_tool_source ]) 37 exec_script("setup_toolchain.py", [ gyp_mac_tool_source ])
29 38
30 # Shared toolchain definition. Invocations should set toolchain_os to set the 39 # Shared toolchain definition. Invocations should set toolchain_os to set the
31 # build args in this definition. 40 # build args in this definition.
32 template("mac_toolchain") { 41 template("mac_toolchain") {
33 toolchain(target_name) { 42 toolchain(target_name) {
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 tool("copy") { 244 tool("copy") {
236 command = copy_command 245 command = copy_command
237 description = copy_description 246 description = copy_description
238 } 247 }
239 248
240 tool("copy_bundle_data") { 249 tool("copy_bundle_data") {
241 _tool = rebase_path("//build/toolchain/mac/copy_bundle_data.py", 250 _tool = rebase_path("//build/toolchain/mac/copy_bundle_data.py",
242 root_build_dir) 251 root_build_dir)
243 command = "python $_tool {{source}} {{output}}" 252 command = "python $_tool {{source}} {{output}}"
244 description = "COPY_BUNDLE_DATA {{source}} {{output}}" 253 description = "COPY_BUNDLE_DATA {{source}} {{output}}"
254 pool = ":bundle_pool($default_toolchain)"
245 } 255 }
246 tool("compile_xcassets") { 256 tool("compile_xcassets") {
247 if (is_ios) { 257 if (is_ios) {
248 _configuration = "Release" 258 _configuration = "Release"
249 if (is_debug) { 259 if (is_debug) {
250 _configuration = "Debug" 260 _configuration = "Debug"
251 } 261 }
252 262
253 _compile_xcassets_env = 263 _compile_xcassets_env =
254 "IPHONEOS_DEPLOYMENT_TARGET=$ios_deployment_target " + 264 "IPHONEOS_DEPLOYMENT_TARGET=$ios_deployment_target " +
255 "CONFIGURATION=$ios_sdk_name-$_configuration " + 265 "CONFIGURATION=$ios_sdk_name-$_configuration " +
256 "CONTENTS_FOLDER_PATH=\$(dirname {{output}})" 266 "CONTENTS_FOLDER_PATH=\$(dirname {{output}})"
257 } else { 267 } else {
258 _compile_xcassets_env = 268 _compile_xcassets_env =
259 "MACOSX_DEPLOYMENT_TARGET=$mac_deployment_target " + 269 "MACOSX_DEPLOYMENT_TARGET=$mac_deployment_target " +
260 "UNLOCALIZED_RESOURCES_FOLDER_PATH=\$(dirname {{output}})" 270 "UNLOCALIZED_RESOURCES_FOLDER_PATH=\$(dirname {{output}})"
261 } 271 }
262 272
263 command = "rm -f {{output}} && " + 273 command = "rm -f {{output}} && " +
264 "env $_compile_xcassets_env ./gyp-mac-tool compile-xcassets " + 274 "env $_compile_xcassets_env ./gyp-mac-tool compile-xcassets " +
265 "{} {{inputs}}" 275 "{} {{inputs}}"
266 description = "COMPILE_XCASSETS {{output}}" 276 description = "COMPILE_XCASSETS {{output}}"
277 pool = ":bundle_pool($default_toolchain)"
267 } 278 }
268 279
269 toolchain_args() { 280 toolchain_args() {
270 current_cpu = invoker.toolchain_cpu 281 current_cpu = invoker.toolchain_cpu
271 current_os = invoker.toolchain_os 282 current_os = invoker.toolchain_os
272 283
273 # These values need to be passed through unchanged. 284 # These values need to be passed through unchanged.
274 host_toolchain = host_toolchain 285 host_toolchain = host_toolchain
275 target_os = target_os 286 target_os = target_os
276 target_cpu = target_cpu 287 target_cpu = target_cpu
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 } 367 }
357 368
358 mac_toolchain("x64") { 369 mac_toolchain("x64") {
359 toolchain_cpu = "x64" 370 toolchain_cpu = "x64"
360 toolchain_os = "mac" 371 toolchain_os = "mac"
361 cc = "${goma_prefix}/gcc" 372 cc = "${goma_prefix}/gcc"
362 cxx = "${goma_prefix}/g++" 373 cxx = "${goma_prefix}/g++"
363 ld = cxx 374 ld = cxx
364 is_clang = false 375 is_clang = false
365 } 376 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698