Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
993d6040
Commit
993d6040
authored
Oct 13, 2016
by
Feng Xiao
Committed by
GitHub
Oct 13, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1959 from abergmeier-dsfishlabs/feature/cpp
Need to expose generated protobuf C++ headers
parents
ad88f905
bbeb983b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
protobuf.bzl
protobuf.bzl
+17
-7
No files found.
protobuf.bzl
View file @
993d6040
...
...
@@ -15,14 +15,21 @@ def _GenDir(ctx):
return
_GetPath
(
ctx
,
ctx
.
attr
.
includes
[
0
])
return
_GetPath
(
ctx
,
ctx
.
label
.
package
+
'/'
+
ctx
.
attr
.
includes
[
0
])
def
_CcOuts
(
srcs
,
use_grpc_plugin
=
False
):
ret
=
[
s
[:
-
len
(
".proto"
)]
+
".pb.h"
for
s
in
srcs
]
+
\
[
s
[:
-
len
(
".proto"
)]
+
".pb.cc"
for
s
in
srcs
]
def
_CcHdrs
(
srcs
,
use_grpc_plugin
=
False
):
ret
=
[
s
[:
-
len
(
".proto"
)]
+
".pb.h"
for
s
in
srcs
]
if
use_grpc_plugin
:
ret
+=
[
s
[:
-
len
(
".proto"
)]
+
".grpc.pb.h"
for
s
in
srcs
]
return
ret
def
_CcSrcs
(
srcs
,
use_grpc_plugin
=
False
):
ret
=
[
s
[:
-
len
(
".proto"
)]
+
".pb.cc"
for
s
in
srcs
]
if
use_grpc_plugin
:
ret
+=
[
s
[:
-
len
(
".proto"
)]
+
".grpc.pb.h"
for
s
in
srcs
]
+
\
[
s
[:
-
len
(
".proto"
)]
+
".grpc.pb.cc"
for
s
in
srcs
]
ret
+=
[
s
[:
-
len
(
".proto"
)]
+
".grpc.pb.cc"
for
s
in
srcs
]
return
ret
def
_CcOuts
(
srcs
,
use_grpc_plugin
=
False
):
return
_CcHdrs
(
srcs
,
use_grpc_plugin
)
+
_CcSrcs
(
srcs
,
use_grpc_plugin
)
def
_PyOuts
(
srcs
):
return
[
s
[:
-
len
(
".proto"
)]
+
"_pb2.py"
for
s
in
srcs
]
...
...
@@ -203,7 +210,9 @@ def cc_proto_library(
if
use_grpc_plugin
:
grpc_cpp_plugin
=
"//external:grpc_cpp_plugin"
outs
=
_CcOuts
(
srcs
,
use_grpc_plugin
)
gen_srcs
=
_CcSrcs
(
srcs
,
use_grpc_plugin
)
gen_hdrs
=
_CcHdrs
(
srcs
,
use_grpc_plugin
)
outs
=
gen_srcs
+
gen_hdrs
proto_gen
(
name
=
name
+
"_genproto"
,
...
...
@@ -225,7 +234,8 @@ def cc_proto_library(
native
.
cc_library
(
name
=
name
,
srcs
=
outs
,
srcs
=
gen_srcs
,
hdrs
=
gen_hdrs
,
deps
=
cc_libs
+
deps
,
includes
=
includes
,
**
kargs
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment