xmake.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package("guetzli")
  2. set_homepage("https://github.com/google/guetzli")
  3. set_description("Perceptual JPEG encoder")
  4. add_urls("https://github.com/google/guetzli/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/google/guetzli.git")
  6. add_versions("v1.0.1", "e52eb417a5c0fb5a3b08a858c8d10fa797627ada5373e203c196162d6a313697")
  7. add_deps("libpng")
  8. on_install(function (package)
  9. io.writefile("xmake.lua", [[
  10. add_rules("mode.debug", "mode.release")
  11. add_requires("libpng")
  12. target("guetzli_lib")
  13. set_kind("$(kind)")
  14. add_files("guetzli/*.cc|guetzli")
  15. add_files("third_party/butteraugli/butteraugli/butteraugli.cc")
  16. add_packages("libpng")
  17. add_headerfiles("(guetzli/*.h)")
  18. add_headerfiles("third_party/butteraugli/(butteraugli/*.h)")
  19. add_includedirs("third_party/butteraugli", ".")
  20. set_languages("c99", "c++17")
  21. if is_plat("windows") and is_kind("shared") then
  22. add_rules("utils.symbols.export_all", {export_classes = true})
  23. end
  24. ]])
  25. import("package.tools.xmake").install(package, {buildir = "xmake_build"})
  26. end)
  27. on_test(function (package)
  28. assert(package:check_cxxsnippets({test = [[
  29. void test() {
  30. using namespace guetzli;
  31. std::string output;
  32. Params param;
  33. Process(param, nullptr, "", &output);
  34. }
  35. ]]}, {configs = {languages = "c++17"}, includes = "guetzli/processor.h"}))
  36. end)