xmake.lua 1.1 KB

12345678910111213141516171819202122232425
  1. package("fast_double_parser")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/lemire/fast_double_parser")
  4. set_description("Fast function to parse strings containing decimal numbers into double-precision (binary64) floating-point values.")
  5. set_license("Apache-2.0")
  6. add_urls("https://github.com/lemire/fast_double_parser/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/lemire/fast_double_parser.git")
  8. add_versions("v0.5.0", "afbd2d42facd037bf3859856a8fe4112e4d7ded942255f6c0e6c17689d41f645")
  9. add_versions("v0.7.0", "eb80a1d9c406bbe8cb22fffd3c007651f716abd03225009302d8aba8e9c4df77")
  10. on_install("windows|x64", "macosx", "linux", "mingw", "android", function (package)
  11. os.cp("include", package:installdir())
  12. end)
  13. on_test(function (package)
  14. assert(package:check_cxxsnippets({test = [[
  15. void test() {
  16. double x;
  17. char str[] = "0.11";
  18. const char *endptr = fast_double_parser::parse_number(str, &x);
  19. }
  20. ]]}, {configs = {languages = "c++11"}, includes = "fast_double_parser.h"}))
  21. end)