Skip to content

Commit

Permalink
add cpptrace
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Jul 28, 2023
1 parent ab1a256 commit dc4ca56
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/c/cpptrace/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package("cpptrace")
set_homepage("https://github.com/jeremy-rifkin/cpptrace")
set_description("Lightweight, zero-configuration-required, and cross-platform stacktrace library for C++")
set_license("MIT")

add_urls("https://github.com/jeremy-rifkin/cpptrace/-/archive/$(version).tar.gz",
"https://github.com/jeremy-rifkin/cpptrace.git")

add_versions("v0.1", "411bf19e079b550c50e6d39c82e3cb8d4a7dd2e9a8107a8f1843929c4b4e63de")

add_deps("cmake")

on_install(function (package)
local configs = {}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
void test() {
cpptrace::print_trace();
}
]]}, {configs = {languages = "c++11"}, includes = {"cpptrace/cpptrace.hpp"}}))
end)

0 comments on commit dc4ca56

Please sign in to comment.