Skip to content

Commit 220b3bc

Browse files
authored
Update version number to 1.0.3, change how stb is integrated to be compatible with BCR (#74)
In preparation for a BCR release of this project, change stb so it doesn't require new_local_repository. Update the version number to 1.0.3 as well.
1 parent 4440d10 commit 220b3bc

File tree

5 files changed

+19
-26
lines changed

5 files changed

+19
-26
lines changed

BUILD.bazel

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
load("@rules_cc//cc:defs.bzl", "cc_library")
22

3+
alias(
4+
name = "pixelmatch",
5+
actual = ":pixelmatch-cpp17",
6+
visibility = ["//visibility:public"],
7+
)
8+
39
cc_library(
410
name = "pixelmatch-cpp17",
511
srcs = [
@@ -25,7 +31,7 @@ cc_library(
2531
visibility = ["//visibility:public"],
2632
deps = [
2733
"//:pixelmatch-cpp17",
28-
"@stb//:image",
29-
"@stb//:image_write",
34+
"//third_party/stb:image",
35+
"//third_party/stb:image_write",
3036
],
3137
)

MODULE.bazel

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@ A C++17 port of the JavaScript pixelmatch library, providing a small pixel-level
33
44
To use, add the following to your MODULE.bazel file:
55
```
6-
bazel_dep(name = "pixelmatch-cpp17", version = "1.0.0")
7-
git_override(
8-
module_name = "pixelmatch-cpp17",
9-
remote = "https://github.com/jwmcglynn/pixematch-cpp17",
10-
)
6+
bazel_dep(name = "pixelmatch-cpp17", version = "1.0.3")
117
```
128
"""
139

14-
module(name = "pixelmatch-cpp17", repo_name = "pixelmatch-cpp17", version = "1.0.1")
15-
16-
new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")
10+
module(
11+
name = "pixelmatch-cpp17",
12+
version = "1.0.3",
13+
compatibility_level = 0,
14+
)
1715

1816
#
1917
# Build dependencies
@@ -23,13 +21,7 @@ bazel_dep(name = "rules_cc", version = "0.1.1")
2321
#
2422
# Test dependencies
2523
#
26-
bazel_dep(name = "googletest", repo_name = "com_google_gtest", version = "1.17.0", dev_dependency = True)
27-
28-
new_local_repository(
29-
name = "stb",
30-
build_file = "//third_party:BUILD.stb",
31-
path = "third_party/stb",
32-
)
24+
bazel_dep(name = "googletest", version = "1.16.0.bcr.1", dev_dependency = True)
3325

3426
#
3527
# Fuzzing dependencies

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,7 @@ Compares two images, writes the output diff and returns the number of mismatched
6565
Add the following to your `MODULE.bazel` file:
6666
6767
```py
68-
bazel_dep(name = "pixelmatch-cpp17", version = "0.0.0")
69-
git_override(
70-
module_name = "pixelmatch-cpp17",
71-
remote = "https://github.com/jwmcglynn/pixelmatch-cpp17",
72-
commit = "<latest commit hash>", # Ex: 2ab1b929916b97668698523a91e752413d01939c
73-
)
68+
bazel_dep(name = "pixelmatch-cpp17", version = "1.0.3")
7469
```
7570

7671
### CMake

tests/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cc_library(
55
name = "test_base",
66
linkopts = ["-lm"],
77
deps = [
8-
"@com_google_gtest//:gtest_main",
8+
"@googletest//:gtest_main",
99
],
1010
)
1111

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@pixelmatch-cpp17//third_party:stb.bzl", "stb_library")
1+
load("//third_party:stb.bzl", "stb_library")
22

33
STB_COPTS = [
44
"-Wno-unused-function",
@@ -157,5 +157,5 @@ cc_library(
157157
name = "vorbis",
158158
defines = ["STB_VORBIS_HEADER_ONLY"],
159159
visibility = ["//visibility:public"],
160-
deps = ["//:vorbis-private"],
160+
deps = [":vorbis-private"],
161161
)

0 commit comments

Comments
 (0)