| #!/bin/bash | |
| # Copyright 2018 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. | |
| #### CATEGORY=Build | |
| ### manually edit args.gn for the current build directory | |
| ## If FUCHSIA_BUILD_DIR is out/default, this is simply: | |
| ## gn args out/default | |
| ## It is useful for seeing and editing the arguments that are currently | |
| ## configured. | |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/vars.sh || exit $? | |
| fx-config-read | |
| set -ex | |
| cd "${FUCHSIA_DIR}" | |
| # `fx set` uses --export-compile-commands when running GN. We should do the same | |
| # here for consistency, so compile_commands.json will always be updated after | |
| # modifying GN args via fx. | |
| fx-gn args "$FUCHSIA_BUILD_DIR" "$@" --export-compile-commands | |
| if [[ -f "${FUCHSIA_BUILD_DIR}/rust-project.json" ]]; then | |
| ln -f -s "${FUCHSIA_BUILD_DIR}/rust-project.json" "${FUCHSIA_DIR}/rust-project.json" | |
| fi | |
| # Check for RBE requirements if enabled. | |
| fx-check-rbe-setup | |