xmake.lua 844 B

123456789101112131415161718192021
  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.0", "1d1d9e482fb95fcd7cab0953a4bd35e00b86578f11cb6939a067811a055a563b")
  8. on_install("windows", "linux", "macosx", "iphoneos", "android", "bsd", function (package)
  9. os.cp("include", package:installdir())
  10. end)
  11. on_test(function (package)
  12. assert(package:check_cxxsnippets({test = [[
  13. void test() {
  14. half_float::half a{ 3.1415926f };
  15. float b{ a };
  16. }
  17. ]]}, {configs = {languages = "c++11"}, includes = "half.hpp"}))
  18. end)