xmake.lua 1.0 KB

123456789101112131415161718192021222324
  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. on_install("windows|x64", "macosx", "linux", "mingw", "android", function (package)
  10. os.cp("include", package:installdir())
  11. end)
  12. on_test(function (package)
  13. assert(package:check_cxxsnippets({test = [[
  14. void test() {
  15. double x;
  16. char str[] = "0.11";
  17. const char *endptr = fast_double_parser::parse_number(str, &x);
  18. }
  19. ]]}, {configs = {languages = "c++11"}, includes = "fast_double_parser.h"}))
  20. end)