xmake.lua 1.1 KB

123456789101112131415161718192021222324252627282930
  1. package("picobench")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/iboB/picobench")
  4. set_description("A micro microbenchmarking library for C++11 in a single header file")
  5. set_license("MIT")
  6. add_urls("https://github.com/iboB/picobench/archive/refs/tags/v$(version).tar.gz")
  7. add_versions("2.07", "c7f8e279cd5138a66a9a417caf1012ed7b15ba2652aec96ef8dd5e6e3e07d7a0")
  8. add_versions("2.06", "2f5d9b53260322b422a1834bbbe4947109039ee518353a8cc8dd57bbd1999b57")
  9. on_install(function (package)
  10. os.cp("include", package:installdir())
  11. end)
  12. on_test(function (package)
  13. assert(package:check_cxxsnippets({test = [[
  14. #include <vector>
  15. #include <cstdlib>
  16. #include "picobench/picobench.hpp"
  17. static void rand_vector(picobench::state& s)
  18. {
  19. std::vector<int> v;
  20. for (auto _ : s)
  21. {
  22. v.push_back(rand());
  23. }
  24. }
  25. PICOBENCH(rand_vector); // Register the above function with picobench
  26. ]]}))
  27. end)