ctrack: add package (#4907)

* ctrack: add package

* fix parallel config
pull/4911/head
star9029 3 months ago committed by GitHub
parent 5c5c44648a
commit 2cbdfd47db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 36
      packages/c/ctrack/xmake.lua

@ -0,0 +1,36 @@
package("ctrack")
set_kind("library", {headeronly = true})
set_homepage("https://github.com/Compaile/ctrack")
set_description("A lightweight, high-performance C++ benchmarking and tracking library for effortless function profiling in both development and production environments.")
set_license("MIT")
add_urls("https://github.com/Compaile/ctrack/archive/refs/tags/$(version).tar.gz",
"https://github.com/Compaile/ctrack.git")
add_versions("v1.0.2", "cbe19d0a852e43da4fe675abc751464cd871b5a50af2ef7f315c0d0d68690092")
add_configs("parallel", {description = "Enable parallel processing", default = false, type = "boolean"})
add_deps("cmake")
on_load(function (package)
if package:config("parallel") then
package:add("deps", "tbb")
else
package:add("defines", "CTRACK_DISABLE_EXECUTION_POLICY")
end
end)
on_install(function (package)
local configs = {"-DDISABLE_EXAMPLES=ON"}
table.insert(configs, "-DDISABLE_PAR=" .. (package:config("parallel") and "OFF" or "ON"))
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
void test() {
CTRACK;
}
]]}, {configs = {languages = "c++17"}, includes = "ctrack.hpp"}))
end)
Loading…
Cancel
Save