Skip to content

Commit

Permalink
build: drop foreign_rules dependency (PROOF-899) (#170)
Browse files Browse the repository at this point in the history
* refactor spdlog build

* drop foreign rules

* clean up workspace

* link statically
  • Loading branch information
rnburn authored Aug 26, 2024
1 parent 6ddaadd commit 46f40a3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 44 deletions.
46 changes: 2 additions & 44 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
workspace(name = "dev_spaceandtime_blitzar")

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "bazel_skylib",
sha256 = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
],
)

# rules_foreign_cc
git_repository(
name = "rules_foreign_cc",
commit = "a87e754",
remote = "https://github.com/bazelbuild/rules_foreign_cc",
)

load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")

rules_foreign_cc_dependencies()

# libbacktrace
git_repository(
Expand All @@ -34,29 +13,8 @@ git_repository(
# spdlog
git_repository(
name = "com_github_gabime_spdlog",
build_file_content = """
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
package(default_visibility = ["//visibility:public"])
filegroup(
name = "all_srcs",
srcs = glob(
include = ["**"],
exclude = ["*.bazel"],
),
)
cmake(
name = "libspdlog",
cache_entries = {
"SPDLOG_BUILD_EXAMPLE": "OFF",
"CMAKE_CXX_FLAGS": "-stdlib=libc++",
},
lib_source = ":all_srcs",
)
""",
commit = "7c02e20",
build_file = "//bazel:spdlog.BUILD",
commit = "5ebfc92",
remote = "https://github.com/gabime/spdlog",
)

Expand Down
11 changes: 11 additions & 0 deletions bazel/spdlog.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
licenses(["notice"]) # Apache 2

cc_library(
name = "libspdlog",
hdrs = glob([
"include/**/*.h",
]),
includes = ["include"],
linkstatic = 1,
visibility = ["//visibility:public"],
)

0 comments on commit 46f40a3

Please sign in to comment.