Bazel can build protobuf when it's not in the root
That is, Bazel can now build protobuf when the latter resides in a subdirectory of a project.
This commit is contained in:
parent
c00274313d
commit
6fffd4adb4
1 changed files with 3 additions and 2 deletions
|
@ -263,10 +263,11 @@ def internal_gen_well_known_protos_java(srcs):
|
||||||
srcs: the well known protos
|
srcs: the well known protos
|
||||||
"""
|
"""
|
||||||
root = Label("%s//protobuf_java" % (REPOSITORY_NAME)).workspace_root
|
root = Label("%s//protobuf_java" % (REPOSITORY_NAME)).workspace_root
|
||||||
|
pkg = PACKAGE_NAME + "/" if PACKAGE_NAME else ""
|
||||||
if root == "":
|
if root == "":
|
||||||
include = " -Isrc "
|
include = " -I%ssrc " % pkg
|
||||||
else:
|
else:
|
||||||
include = " -I%s/src " % root
|
include = " -I%s/%ssrc " % (root, pkg)
|
||||||
native.genrule(
|
native.genrule(
|
||||||
name = "gen_well_known_protos_java",
|
name = "gen_well_known_protos_java",
|
||||||
srcs = srcs,
|
srcs = srcs,
|
||||||
|
|
Loading…
Add table
Reference in a new issue