| # Copyright 2019 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/lto/config.gni") |
| import("//build/toolchain/goma.gni") |
| |
| _script = "get_concurrent_jobs.py" |
| _args = [ |
| "-S", # https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=62771 |
| rebase_path(_script, root_build_dir), |
| "--reserve-memory=1GB", |
| ] |
| |
| if (use_lto) { |
| # As per logic in //build/config/lto/config.gni, only use thinlto |
| # if lto is set |
| if (use_thinlto) { |
| _args += [ |
| "--memory-per-job", |
| "local=2GB", |
| ] |
| } else { |
| _args += [ |
| "--memory-per-job", |
| "local=4GB", |
| ] |
| } |
| } else { |
| # No lto |
| _args += [ |
| "--memory-per-job", |
| "local=1GB", |
| ] |
| } |
| default_concurrent_jobs = |
| exec_script(python_exe_src, _args, "json", [ _script ]) |
| |
| concurrent_jobs = { |
| # Specific configuration for tools that run on Goma |
| goma = { |
| if (!use_goma) { |
| # Without Goma, these tools resort to running locally |
| pool = "//build/config:local($default_toolchain)" |
| } |
| } |
| |
| # Configuration for tools that must run locally |
| local = { |
| pool = "//build/config:local($default_toolchain)" |
| } |
| } |