Skip to content
Open
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repro*/
__pycache__/
scratch
tmp/
bazel-*/
/bazel-*
cmake-build-*/

test/jank/data
10 changes: 6 additions & 4 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "cpptrace",
srcs = glob([
Expand All @@ -7,19 +9,19 @@ cc_library(
local_defines = [
"CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF",
"CPPTRACE_DEMANGLE_WITH_CXXABI",
"CPPTRACE_UNWIND_WITH_LIBUNWIND"
"CPPTRACE_UNWIND_WITH_LIBUNWIND",
],
hdrs = glob([
"include/cpptrace/*.hpp",
"include/ctrace/*.h",
]),
includes = [
"include",
"src"
"src",
],
deps = [
"@libdwarf//:libdwarf",
"@libunwind//:libunwind"
"@libunwind//:libunwind",
],
copts = [
"-Wall",
Expand All @@ -28,7 +30,7 @@ cc_library(
"-Wundef",
"-Wuninitialized",
"-fPIC",
"-std=c++11"
"-std=c++11",
],
visibility = ["//visibility:public"],
)
78 changes: 3 additions & 75 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ module(
name = "cpptrace",
)

bazel_dep(name = "rules_cc", version = "0.2.8")
bazel_dep(name = "googletest", version = "1.14.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_foreign_cc", version = "0.11.1")
bazel_dep(name = "zstd", version = "1.5.6")
bazel_dep(name = "zlib", version = "1.3.1")
bazel_dep(name = "xz", version = "5.4.5.bcr.2")
bazel_dep(name = "libdwarf", version = "2.2.0.bcr.1")
bazel_dep(name = "libunwind", version = "1.8.3")
bazel_dep(name = "toolchains_llvm", version = "1.1.2")

# Configure and register the toolchain.
Expand All @@ -31,74 +30,3 @@ llvm.toolchain(
use_repo(llvm, "llvm_toolchain")

register_toolchains("@llvm_toolchain//:all", dev_dependency = True)

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "libdwarf",
build_file_content =
"""
package(default_visibility = ["//visibility:public"])
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")

filegroup(
name = "sources",
srcs = glob(["**/*"]),
)
cmake(
name = "libdwarf",
build_args = ["-j12"],
lib_source = ":sources",
out_static_libs = ["libdwarf.a"],
copts = ["-Wall", "-Werror"],
deps = [
"@zstd",
"@zlib"
]
)
""",
sha256 = "4ab8ae7b4b7aa42453725054b348f4fdb2460d5ba644199a1305311c718ff416",
strip_prefix = "libdwarf-code-0.10.1",
url = "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.10.1.tar.gz",
)



http_archive(
name = "libunwind",
build_file_content =
"""
package(default_visibility = ["//visibility:public"])
load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make")

filegroup(
name = "sources",
srcs = glob(["**/*"]),
)
configure_make(
name = "libunwind",
args = ["-j12"],
autoreconf = True,
configure_in_place = True,
autoreconf_options = [
"-i",
],
lib_source = ":sources",
out_static_libs = [
"libunwind.a",
"libunwind-coredump.a",
"libunwind-ptrace.a",
"libunwind-x86_64.a",
"libunwind-generic.a",
"libunwind-setjmp.a"
],
deps = [
"@xz//:lzma"
]
)
""",
sha256 = "38833b7b1582db7d76485a62a213706c9252b3dab7380069fea5824e823d8e41",
strip_prefix = "libunwind-1.8.1",
url = "https://github.com/libunwind/libunwind/archive/refs/tags/v1.8.1.tar.gz",
)

Loading
Loading