xmake.lua 1.2 KB

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