Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

alias(
name = "pixelmatch",
actual = ":pixelmatch-cpp17",
visibility = ["//visibility:public"],
)

cc_library(
name = "pixelmatch-cpp17",
srcs = [
Expand All @@ -25,7 +31,7 @@ cc_library(
visibility = ["//visibility:public"],
deps = [
"//:pixelmatch-cpp17",
"@stb//:image",
"@stb//:image_write",
"//third_party/stb:image",
"//third_party/stb:image_write",
],
)
22 changes: 7 additions & 15 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ A C++17 port of the JavaScript pixelmatch library, providing a small pixel-level

To use, add the following to your MODULE.bazel file:
```
bazel_dep(name = "pixelmatch-cpp17", version = "1.0.0")
git_override(
module_name = "pixelmatch-cpp17",
remote = "https://github.com/jwmcglynn/pixematch-cpp17",
)
bazel_dep(name = "pixelmatch-cpp17", version = "1.0.3")
```
"""

module(name = "pixelmatch-cpp17", repo_name = "pixelmatch-cpp17", version = "1.0.1")

new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")
module(
name = "pixelmatch-cpp17",
version = "1.0.3",
compatibility_level = 0,
)

#
# Build dependencies
Expand All @@ -23,13 +21,7 @@ bazel_dep(name = "rules_cc", version = "0.1.1")
#
# Test dependencies
#
bazel_dep(name = "googletest", repo_name = "com_google_gtest", version = "1.17.0", dev_dependency = True)

new_local_repository(
name = "stb",
build_file = "//third_party:BUILD.stb",
path = "third_party/stb",
)
bazel_dep(name = "googletest", version = "1.16.0.bcr.1", dev_dependency = True)

#
# Fuzzing dependencies
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ Compares two images, writes the output diff and returns the number of mismatched
Add the following to your `MODULE.bazel` file:
```py
bazel_dep(name = "pixelmatch-cpp17", version = "0.0.0")
git_override(
module_name = "pixelmatch-cpp17",
remote = "https://github.com/jwmcglynn/pixelmatch-cpp17",
commit = "<latest commit hash>", # Ex: 2ab1b929916b97668698523a91e752413d01939c
)
bazel_dep(name = "pixelmatch-cpp17", version = "1.0.3")
```

### CMake
Expand Down
2 changes: 1 addition & 1 deletion tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cc_library(
name = "test_base",
linkopts = ["-lm"],
deps = [
"@com_google_gtest//:gtest_main",
"@googletest//:gtest_main",
],
)

Expand Down
4 changes: 2 additions & 2 deletions third_party/BUILD.stb → third_party/stb/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@pixelmatch-cpp17//third_party:stb.bzl", "stb_library")
load("//third_party:stb.bzl", "stb_library")

STB_COPTS = [
"-Wno-unused-function",
Expand Down Expand Up @@ -157,5 +157,5 @@ cc_library(
name = "vorbis",
defines = ["STB_VORBIS_HEADER_ONLY"],
visibility = ["//visibility:public"],
deps = ["//:vorbis-private"],
deps = [":vorbis-private"],
)