11#! /usr/bin/env bash
2-
2+ # Environment variables
3+ # BAZEL : the bazel binary to invoke (default: baselisk)
4+ # BAZEL_OPTS : the preferred bazel options used
35set -eu
46
57# Which bazel and bant to use. If unset, defaults are used.
@@ -13,14 +15,16 @@ BANT="$($(dirname "$0")/get-bant-path.sh)"
1315# Important to run with --remote_download_outputs=all to make sure generated
1416# files are actually visible locally in case a remote cache (that includes
1517# --disk_cache) is used ( https://github.com/hzeller/bazel-gen-file-issue )
16- BAZEL_OPTS=" - c opt --remote_download_outputs=all"
18+ BAZEL_OPTS=" ${BAZEL_OPTS :- - c opt --remote_download_outputs=all} "
1719
1820# Tickle some build targets to fetch all dependencies and generate files,
1921# so that they can be seen by the users of the compilation db.
20- # Right now, comile everything (which should not be too taxing with the
21- # bazel cache), but it could be made more specific to only trigger specific
22- # targets that are sufficient to get and regenerate everything.
23- " ${BAZEL} " build -k ${BAZEL_OPTS} src/...
22+ # (Note, we need to limit targets to everything below //src, otherwise
23+ # it requires docker)
24+ " ${BAZEL} " fetch //src/...
25+ " ${BAZEL} " build -k ${BAZEL_OPTS} \
26+ @openmp//:omp_header \
27+ $( " ${BANT} " list-targets -g " genrule|tcl_encode|tcl_wrap_cc" -g " //src" | awk ' {print $3}' )
2428
2529# Create compilation DB. Command 'compilation-db' would create a huge *.json file,
2630# but compile_flags.txt is perfectly sufficient and easier for tools to use as
0 commit comments