Skip to content

Commit 120a8ca

Browse files
author
Marcus Holland-Moritz
committed
cpptrace 1.0.4 (new formula)
1 parent 09da271 commit 120a8ca

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

Formula/c/cpptrace.rb

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
class Cpptrace < Formula
2+
desc "Simple, portable, and self-contained stacktrace library for C++11 and newer"
3+
homepage "https://github.com/jeremy-rifkin/cpptrace"
4+
url "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v1.0.4.tar.gz"
5+
sha256 "5c9f5b301e903714a4d01f1057b9543fa540f7bfcc5e3f8bd1748e652e24f9ea"
6+
license "MIT"
7+
8+
depends_on "cmake" => :build
9+
depends_on "pkgconf" => :build
10+
depends_on "dwarfutils"
11+
depends_on "zstd"
12+
13+
def install
14+
args = %W[
15+
-DBUILD_SHARED_LIBS=ON
16+
-DCMAKE_INSTALL_RPATH=#{rpath}
17+
-DCPPTRACE_DEMANGLE_WITH_CXXABI=ON
18+
-DCPPTRACE_FIND_LIBDWARF_WITH_PKGCONFIG=ON
19+
-DCPPTRACE_GET_SYMBOLS_WITH_LIBDWARF=ON
20+
-DCPPTRACE_UNWIND_WITH_EXECINFO=ON
21+
-DCPPTRACE_USE_EXTERNAL_GTEST=ON
22+
-DCPPTRACE_USE_EXTERNAL_LIBDWARF=ON
23+
-DCPPTRACE_USE_EXTERNAL_ZSTD=ON
24+
]
25+
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
26+
system "cmake", "--build", "build"
27+
system "cmake", "--install", "build"
28+
end
29+
30+
test do
31+
(testpath/"test.cpp").write <<~CPP
32+
#include <cpptrace/cpptrace.hpp>
33+
34+
int main() {
35+
cpptrace::generate_trace().print();
36+
return 0;
37+
}
38+
CPP
39+
system ENV.cxx, "test.cpp", "-std=c++11", "-I#{include}", "-L#{lib}", "-o", "test", "-lcpptrace"
40+
system "./test"
41+
end
42+
end

0 commit comments

Comments
 (0)