xmake.lua 1.0 KB

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