xmake.lua 1.1 KB

123456789101112131415161718192021222324
  1. package("effolkronium-random")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/effolkronium/random")
  4. set_description("Random for modern C++ with convenient API")
  5. set_license("MIT")
  6. add_urls("https://github.com/effolkronium/random/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/effolkronium/random.git")
  8. add_versions("v1.5.0", "c05a042f8daf54913e3a836e10a213bbbeaf09a89630649bd0011fe65eff50d9")
  9. add_versions("v1.4.1", "ec6beb67496ad2ce722d311d3fa5efb7e847dac5fd1c16b8920b51562fe20f53")
  10. on_install(function (package)
  11. os.cp("include/effolkronium", package:installdir("include"))
  12. end)
  13. on_test(function (package)
  14. assert(package:check_cxxsnippets({test = [[
  15. void test(int argc, char** argv) {
  16. auto num = effolkronium::random_static::get(-1, 1);
  17. bool overflow = (num < -1) || (num > 1);
  18. assert(!overflow);
  19. }
  20. ]]}, {configs = {languages = "c++17"}, includes = {"effolkronium/random.hpp", "assert.h"}}))
  21. end)