xmake.lua 1.2 KB

12345678910111213141516171819202122232425262728293031
  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.08", "7002cede527d661bc599a59dcd492ec6a0943f695603f581bf9f0569dcd9c866")
  8. add_versions("2.07", "c7f8e279cd5138a66a9a417caf1012ed7b15ba2652aec96ef8dd5e6e3e07d7a0")
  9. add_versions("2.06", "2f5d9b53260322b422a1834bbbe4947109039ee518353a8cc8dd57bbd1999b57")
  10. on_install(function (package)
  11. os.cp("include", package:installdir())
  12. end)
  13. on_test(function (package)
  14. assert(package:check_cxxsnippets({test = [[
  15. #include <vector>
  16. #include <cstdlib>
  17. #include "picobench/picobench.hpp"
  18. static void rand_vector(picobench::state& s)
  19. {
  20. std::vector<int> v;
  21. for (auto _ : s)
  22. {
  23. v.push_back(rand());
  24. }
  25. }
  26. PICOBENCH(rand_vector); // Register the above function with picobench
  27. ]]}))
  28. end)