This file contains helpers to work with Bazel-declared runfiles – declared data dependencies used by C++ code.
The functions in this file only succeed when used within a Bazel build.
All source code within Drake should use FindResource() or FindResourceOrThrow() instead of these Runfiles routines, because FindResource will operate correctly in pre-compiled / installed builds of Drake whereas FindRunfile will not.
These runfiles-related helpers are intended for use by downstream Bazel projects that use Drake as a library, so that those projects can reuse the relatively complicated logic within these routines during source builds.
#include <string>Classes | |
| struct | RlocationOrError |
| (Advanced.) The return type of FindRunfile(). More... | |
Namespaces | |
| namespace | drake |
Functions | |
| bool | HasRunfiles () |
| (Advanced.) Returns true iff this process has Bazel runfiles available. | |
| RlocationOrError | FindRunfile (const std::string &resource_path, const std::string &source_repository={}) |
| (Advanced.) Returns the absolute path to the given resource_path from Bazel runfiles, or else an error message when not found. | |