Skip to content

Commit

Permalink
Copybara Merge: #269
Browse files Browse the repository at this point in the history
BEGIN_PUBLIC
Copybara import of the project:

--
0c245a4 by Ivo List <[email protected]>:

Revert "Remove cc_proto_library from defs.bzl"

This reverts commit b15fed2.

--
d4311f4 by Ivo List <[email protected]>:

Move back WORKSPACE.bzlmod (unrevert)

--
e62ddd0 by Ivo List <[email protected]>:

Rename protobuf to com_google_protobuf

This keeps compatiblity with WORKSPACE mode in older Bazel versions

--
0e1618f by Ivo List <[email protected]>:

Adding deprecated comment

--
a272300 by Ivo List <[email protected]>:

Restore # @unsorted-dict-items

END_PUBLIC

COPYBARA_INTEGRATE_REVIEW=#269 from comius:add-back-cc_proto_library a272300
PiperOrigin-RevId: 694079850
Change-Id: Iaa57586636997fd3db9cf9289bddc40c673033c9
  • Loading branch information
comius authored and copybara-github committed Nov 7, 2024
1 parent da65f24 commit 28cf2e8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module(
bazel_dep(name = "bazel_features", version = "1.19.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "protobuf", version = "27.0", repo_name = "com_google_protobuf")

This comment has been minimized.

Copy link
@wasphin

wasphin Nov 18, 2024

Does this really require protobuf 27.0?


cc_configure = use_extension("//cc:extensions.bzl", "cc_configure_extension")
use_repo(cc_configure, "local_config_cc", "local_config_cc_toolchains")
Expand Down
7 changes: 7 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,10 @@ http_archive(
strip_prefix = "rules_testing-0.6.0",
url = "https://github.com/bazelbuild/rules_testing/releases/download/v0.6.0/rules_testing-v0.6.0.tar.gz",
)

http_archive(
name = "com_google_protobuf",
sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa",
strip_prefix = "protobuf-27.0",
url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz",
)
8 changes: 8 additions & 0 deletions cc/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""Starlark rules for building C++ projects."""

load("@com_google_protobuf//bazel:cc_proto_library.bzl", _cc_proto_library = "cc_proto_library")
load("//cc:cc_binary.bzl", _cc_binary = "cc_binary")
load("//cc:cc_import.bzl", _cc_import = "cc_import")
load("//cc:cc_library.bzl", _cc_library = "cc_library")
Expand Down Expand Up @@ -42,6 +43,13 @@ cc_shared_library = _cc_shared_library
objc_library = _objc_library
objc_import = _objc_import

# DEPRECATED: use rule from com_google_protobuf repository
def cc_proto_library(**kwargs):
if "deprecation" not in kwargs:
_cc_proto_library(deprecation = "Use cc_proto_library from com_google_protobuf", **kwargs)
else:
_cc_proto_library(**kwargs)

# Toolchain rules

cc_toolchain = _cc_toolchain
Expand Down

0 comments on commit 28cf2e8

Please sign in to comment.