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
fb714b36
Commit
fb714b36
authored
Feb 25, 2016
by
Jisi Liu
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1275 from keveman/grpc_support
Fixed grpc C++ plugin support.
parents
cc775f7a
f5c73635
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
protobuf.bzl
protobuf.bzl
+11
-6
No files found.
protobuf.bzl
View file @
fb714b36
...
@@ -15,9 +15,13 @@ def _GenDir(ctx):
...
@@ -15,9 +15,13 @@ def _GenDir(ctx):
return
_GetPath
(
ctx
,
ctx
.
attr
.
includes
[
0
])
return
_GetPath
(
ctx
,
ctx
.
attr
.
includes
[
0
])
return
_GetPath
(
ctx
,
ctx
.
label
.
package
+
'/'
+
ctx
.
attr
.
includes
[
0
])
return
_GetPath
(
ctx
,
ctx
.
label
.
package
+
'/'
+
ctx
.
attr
.
includes
[
0
])
def
_CcOuts
(
srcs
):
def
_CcOuts
(
srcs
,
use_grpc_plugin
=
False
):
return
[
s
[:
-
len
(
".proto"
)]
+
".pb.h"
for
s
in
srcs
]
+
\
ret
=
[
s
[:
-
len
(
".proto"
)]
+
".pb.h"
for
s
in
srcs
]
+
\
[
s
[:
-
len
(
".proto"
)]
+
".pb.cc"
for
s
in
srcs
]
[
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
]
return
ret
def
_PyOuts
(
srcs
):
def
_PyOuts
(
srcs
):
return
[
s
[:
-
len
(
".proto"
)]
+
"_pb2.py"
for
s
in
srcs
]
return
[
s
[:
-
len
(
".proto"
)]
+
"_pb2.py"
for
s
in
srcs
]
...
@@ -169,7 +173,8 @@ def cc_proto_library(
...
@@ -169,7 +173,8 @@ def cc_proto_library(
if
use_grpc_plugin
:
if
use_grpc_plugin
:
grpc_cpp_plugin
=
"//external:grpc_cpp_plugin"
grpc_cpp_plugin
=
"//external:grpc_cpp_plugin"
outs
=
_CcOuts
(
srcs
)
outs
=
_CcOuts
(
srcs
,
use_grpc_plugin
)
_proto_gen
(
_proto_gen
(
name
=
name
+
"_genproto"
,
name
=
name
+
"_genproto"
,
srcs
=
srcs
,
srcs
=
srcs
,
...
@@ -184,6 +189,8 @@ def cc_proto_library(
...
@@ -184,6 +189,8 @@ def cc_proto_library(
if
default_runtime
and
not
default_runtime
in
cc_libs
:
if
default_runtime
and
not
default_runtime
in
cc_libs
:
cc_libs
+=
[
default_runtime
]
cc_libs
+=
[
default_runtime
]
if
use_grpc_plugin
:
cc_libs
+=
[
"//external:grpc_lib"
]
native
.
cc_library
(
native
.
cc_library
(
name
=
name
,
name
=
name
,
...
@@ -192,7 +199,6 @@ def cc_proto_library(
...
@@ -192,7 +199,6 @@ def cc_proto_library(
includes
=
includes
,
includes
=
includes
,
**
kargs
)
**
kargs
)
def
internal_copied_filegroup
(
def
internal_copied_filegroup
(
name
,
name
,
srcs
,
srcs
,
...
@@ -222,7 +228,6 @@ def internal_copied_filegroup(
...
@@ -222,7 +228,6 @@ def internal_copied_filegroup(
srcs
=
outs
,
srcs
=
outs
,
**
kargs
)
**
kargs
)
def
py_proto_library
(
def
py_proto_library
(
name
,
name
,
srcs
=
[],
srcs
=
[],
...
...
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