Commit 155c5590 authored by Yong Tang's avatar Yong Tang Committed by Wouter van Oortmerssen

Add repository name to build_defs.bzl (#5104)

In flatbuffers, build_defs.bzl has been updated to have the
bazel rule `flatbuffer_cc_library` defined. Therefore, it should
be possible to build another application and using `flatbuffer_cc_library`
directly (by `load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")`)

However, when I tried to do the above, I saw the following errors in bazel:
```
ERROR: /root/.cache/bazel/_bazel_root/c27e9809996ce9a9c0ed8dd79ef0897b/external/arrow/BUILD.bazel:12:1: in deps attribute of cc_library rule @arrow//:arrow_format: target '@arrow//:runtime_cc' does not exist. Since this rule was created by the macro 'flatbuffer_cc_library', the error might have been caused by the macro implementation in /root/.cache/bazel/_bazel_root/c27e9809996ce9a9c0ed8dd79ef0897b/external/com_github_google_flatbuffers/build_defs.bzl:216:16
```

The reason for the bazel error was that `//:runtime_cc` and `//:flatc` does not have
the repo name prefixed.

By prefix `` the above bazel build error could be resolved.

This fix should help other programs to use flatbuffers directly through bazel.
Signed-off-by: 's avatarYong Tang <yong.tang.github@outlook.com>
parent 0eb7b3be
# Description: # Description:
# BUILD rules for generating flatbuffer files in various languages. # BUILD rules for generating flatbuffer files in various languages.
flatc_path = "//:flatc" flatc_path = "@com_github_google_flatbuffers//:flatc"
DEFAULT_INCLUDE_PATHS = [ DEFAULT_INCLUDE_PATHS = [
"./", "./",
...@@ -214,7 +214,7 @@ def flatbuffer_cc_library( ...@@ -214,7 +214,7 @@ def flatbuffer_cc_library(
"-parse_headers", "-parse_headers",
], ],
deps = [ deps = [
"//:runtime_cc", "@com_github_google_flatbuffers//:runtime_cc",
], ],
includes = [], includes = [],
linkstatic = 1, linkstatic = 1,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment