Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add module dependencies on rules_cc and rules_license.
Use cc_library from rules_cc instead of native.
Add license annotations.
Test with Bazel 8.x and rolling (in addition to 7.x) and ubuntu2404.
  • Loading branch information
jwnimmer-tri authored Dec 17, 2024
1 parent f4c527f commit 4a94675
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 1 deletion.
10 changes: 10 additions & 0 deletions modules/fmt/11.0.2.bcr.1/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module(
name = "fmt",
version = "11.0.2.bcr.1",
bazel_compatibility = [">=7.2.1"],
compatibility_level = 10,
)

bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.0.17")
bazel_dep(name = "rules_license", version = "1.0.0")
35 changes: 35 additions & 0 deletions modules/fmt/11.0.2.bcr.1/overlay/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_license//rules:license.bzl", "license")

package(
default_applicable_licenses = [":license"],
)

exports_files([
"LICENSE",
])

license(
name = "license",
license_kinds = ["@rules_license//licenses/spdx:MIT"],
license_text = "LICENSE",
)

cc_library(
name = "fmt",
srcs = [
#"src/fmt.cc", # No C++ module support, yet in Bazel (https://github.com/bazelbuild/bazel/pull/19940)
"src/format.cc",
"src/os.cc",
],
hdrs = glob([
"include/fmt/*.h",
]),
copts = select({
"@platforms//os:windows": ["-utf-8"],
"//conditions:default": [],
}),
includes = ["include"],
strip_include_prefix = "include", # workaround: only needed on some macOS systems (see https://github.com/bazelbuild/bazel-central-registry/issues/1537)
visibility = ["//visibility:public"],
)
1 change: 1 addition & 0 deletions modules/fmt/11.0.2.bcr.1/overlay/MODULE.bazel
27 changes: 27 additions & 0 deletions modules/fmt/11.0.2.bcr.1/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
matrix:
unix_platform:
- debian10
- debian11
- macos
- macos_arm64
- ubuntu2004
- ubuntu2204
- ubuntu2404
windows_test:
- windows
bazel: [7.x, 8.x, rolling]
tasks:
unix_test:
name: Verify build targets
platform: ${{ unix_platform }}
bazel: ${{ bazel }}
build_targets:
- '@fmt//:fmt'
windows_test:
name: Verify build targets
platform: ${{ windows_test }}
bazel: ${{ bazel }}
build_flags:
- --cxxopt=/utf-8
build_targets:
- '@fmt//:fmt'
10 changes: 10 additions & 0 deletions modules/fmt/11.0.2.bcr.1/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"url": "https://github.com/fmtlib/fmt/releases/download/11.0.2/fmt-11.0.2.zip",
"integrity": "sha256-QPxYvrzzjHWeEae9j9wWNQfSQj71BYu6fyYoDFucVGU=",
"strip_prefix": "fmt-11.0.2",
"patch_strip": 0,
"overlay": {
"BUILD.bazel": "sha256-K/CEiPIuDAmNhCxiE3QrPS4OnPaOUkwpmkZweImxjU8=",
"MODULE.bazel": "sha256-YfGS0PRKK+il8CVmH3vytdt3xuWN36JqAsN0/uePmtM="
}
}
3 changes: 2 additions & 1 deletion modules/fmt/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"10.2.1.bcr.1",
"11.0.0",
"11.0.1",
"11.0.2"
"11.0.2",
"11.0.2.bcr.1"
],
"yanked_versions": {}
}

0 comments on commit 4a94675

Please sign in to comment.