double-conversion: support some platform (#4832)

pull/4835/head
star9029 8 months ago committed by GitHub
parent 631631a841
commit b758151d07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 13
      packages/d/double-conversion/xmake.lua

@ -1,22 +1,27 @@
package("double-conversion")
set_homepage("https://github.com/google/double-conversion")
set_description("Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles.")
set_license("BSD-3-Clause")
add_urls("https://github.com/google/double-conversion/archive/refs/tags/$(version).tar.gz",
"https://github.com/google/double-conversion.git")
add_versions("v3.3.0", "04ec44461850abbf33824da84978043b22554896b552c5fd11a9c5ae4b4d296e")
add_versions("v3.1.5", "a63ecb93182134ba4293fd5f22d6e08ca417caafa244afaa751cbfddf6415b13")
add_deps("cmake")
on_install("windows", "linux", "macosx", function (package)
on_install(function (package)
local configs = {"-DBUILD_TESTING=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:has_cxxtypes("double_conversion::Double", {includes = "double-conversion/ieee.h"}))
assert(package:check_cxxsnippets({test = [[
void test() {
double_conversion::Double x;
}
]]}, {configs = {languages = "c++11"}, includes = "double-conversion/ieee.h"}))
end)

Loading…
Cancel
Save