xmake.lua 938 B

12345678910111213141516171819202122
  1. package("half")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://half.sourceforge.net")
  4. set_description("C++ library for half precision floating point arithmetics")
  5. set_license("MIT")
  6. add_urls("https://downloads.sourceforge.net/project/half/half/$(version)/half-$(version).zip")
  7. add_versions("2.2.1", "76ddbf406e9d9b772ec73af2bf925b38b290b4390cc4064720a08d4b4bca0aa9")
  8. add_versions("2.2.0", "1d1d9e482fb95fcd7cab0953a4bd35e00b86578f11cb6939a067811a055a563b")
  9. on_install("windows", "linux", "macosx", "iphoneos", "android", "bsd", 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. half_float::half a{ 3.1415926f };
  16. float b{ a };
  17. }
  18. ]]}, {configs = {languages = "c++11"}, includes = "half.hpp"}))
  19. end)