diff options
author | Jisi Liu <liujisi@google.com> | 2015-10-19 15:10:00 -0700 |
---|---|---|
committer | Jisi Liu <liujisi@google.com> | 2015-10-19 15:10:00 -0700 |
commit | e63bd9be269498c5baed0eb8771e2152436774f7 (patch) | |
tree | 75723c2052778d5792efa1c9e72f08d0d79d5308 | |
parent | 70b81ba10db0f58451172f427d974baa94a80018 (diff) | |
parent | 6dac0822c4f7dab9a1f6abc6e20cd0dc80a96915 (diff) |
Merge pull request #892 from pherl/cc_bazel
Allow include to be None.
-rw-r--r-- | protobuf.bzl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/protobuf.bzl b/protobuf.bzl index 79dabd02..b83f7f5a 100644 --- a/protobuf.bzl +++ b/protobuf.bzl @@ -1,6 +1,8 @@ # -*- mode: python; -*- PYTHON-PREPROCESSING-REQUIRED def _gen_dir(ctx): + if ctx.attr.include == None: + return "" if not ctx.attr.include: return ctx.label.package if not ctx.label.package: @@ -70,7 +72,7 @@ def cc_proto_library( srcs=[], deps=[], cc_libs=[], - include="", + include=None, protoc=":protoc", internal_bootstrap_hack=False, **kargs): @@ -119,9 +121,13 @@ def cc_proto_library( outs=outs, ) + includes = [] + if include != None: + includes = [include] + native.cc_library( name=name, srcs=outs, deps=cc_libs + deps, - includes=[include], + includes=includes, **kargs) |