xmake.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package("icbc")
  2. set_homepage("https://github.com/castano/icbc")
  3. set_description("A High Quality SIMD BC1 Encoder")
  4. add_urls("https://github.com/castano/icbc/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/castano/icbc.git")
  6. add_versions("1.05", "51eba57870c018c8ccd673aab3c58fd5576fadb1c149c22c3fdacf42be197bfd")
  7. add_patches("1.05", path.join(os.scriptdir(), "patches", "1.05", "cleanup.patch"), "4704acc207940ec43c1b3bd7031ee05109fae61c0e044b0a71c899ed4612861d")
  8. on_install("windows", "macosx", "linux", function (package)
  9. io.writefile("icbc.cpp", [[
  10. #define ICBC_IMPLEMENTATION
  11. #include "icbc.h"
  12. #define IC_PFOR_IMPLEMENTATION
  13. #include "ic_pfor.h"
  14. ]])
  15. io.writefile("xmake.lua", [[
  16. add_rules("mode.debug", "mode.release")
  17. target("icbc")
  18. set_kind("static")
  19. set_languages("cxx11")
  20. add_files("icbc.cpp")
  21. add_headerfiles("icbc.h", "ic_pfor.h")
  22. if is_plat("windows") then
  23. add_cxxflags("/arch:AVX512")
  24. else
  25. add_cxxflags("-march=native")
  26. end
  27. ]])
  28. import("package.tools.xmake").install(package)
  29. end)
  30. on_test(function (package)
  31. assert(package:has_cxxtypes("icbc::Quality", {configs = {languages = "c++11"}, includes = "icbc.h"}))
  32. end)