Skip to content

Commit

Permalink
Merge pull request #179 from mmorel-35/bzlmod
Browse files Browse the repository at this point in the history
chore(bazel): add MODULE.bazel files for bzlmod
  • Loading branch information
danilak-G authored Aug 18, 2024
2 parents 07406b9 + 09d30d3 commit b49982c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# googletest requires C++14 or above
build --cxxopt='-std=c++17'
# Enable Bzlmod for every Bazel command
common --enable_bzlmod
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
# Build directory.
build/
/bazel-*
MODULE.bazel.lock
out/
15 changes: 8 additions & 7 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ config_setting(
cc_library(
name = "config",
hdrs = ["config.h"],
defines = ["HAVE_CONFIG_H"]
defines = ["HAVE_CONFIG_H"],
)

cc_library(
Expand Down Expand Up @@ -70,10 +70,11 @@ cc_library(
"snappy-sinksource.h",
],
copts = select({
":windows": [],
"//conditions:default": [
"-Wno-sign-compare",
]}),
":windows": [],
"//conditions:default": [
"-Wno-sign-compare",
],
}),
deps = [
":config",
":snappy-stubs-internal",
Expand Down Expand Up @@ -114,7 +115,7 @@ cc_test(
deps = [
":snappy",
":snappy-test",
"//third_party/benchmark:benchmark_main",
"@com_google_benchmark//:benchmark_main",
],
)

Expand All @@ -127,7 +128,7 @@ cc_test(
deps = [
":snappy",
":snappy-test",
"//third_party/googletest:gtest_main",
"@com_google_googletest//:gtest_main",
],
)

Expand Down
23 changes: 23 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module(
name = "snappy",
version = "1.2.0",
compatibility_level = 1,
)

bazel_dep(
name = "googletest",
version = "1.14.0.bcr.1",
dev_dependency = True,
repo_name = "com_google_googletest",
)
bazel_dep(
name = "google_benchmark",
version = "1.8.3",
dev_dependency = True,
repo_name = "com_google_benchmark",
)

bazel_dep(
name = "platforms",
version = "0.0.9",
)
Empty file added WORKSPACE.bzlmod
Empty file.

0 comments on commit b49982c

Please sign in to comment.