xmake.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package("aom")
  2. set_homepage("https://aomedia.googlesource.com/aom")
  3. set_description("AV1 Codec Library")
  4. set_license("BSD-2-Clause")
  5. add_urls("https://storage.googleapis.com/aom-releases/libaom-$(version).tar.gz",
  6. "https://aomedia.googlesource.com/aom.git")
  7. add_versions("3.9.1", "dba99fc1c28aaade28dda59821166b2fa91c06162d1bc99fde0ddaad7cecc50e")
  8. add_configs("tools", {description = "Build tools", default = false, type = "boolean"})
  9. if is_plat("linux", "bsd") then
  10. add_syslinks("pthread", "m")
  11. end
  12. add_deps("cmake", "nasm")
  13. if is_plat("windows") or (is_plat("mingw") and is_host("windows")) then
  14. add_deps("strawberry-perl")
  15. end
  16. on_install("!wasm and (!windows or windows|!arm64)", function (package)
  17. local configs = {
  18. "-DENABLE_EXAMPLES=OFF",
  19. "-DENABLE_TESTS=OFF",
  20. "-DENABLE_DOCS=OFF",
  21. "-DCONFIG_LIBYUV=0",
  22. "-DCONFIG_WEBM_IO=0",
  23. }
  24. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  25. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  26. if package:is_plat("windows") and package:is_arch("arm.*") then
  27. table.insert(configs, "-DCMAKE_SYSTEM_NAME=Windows")
  28. table.insert(configs, "-DCMAKE_SYSTEM_PROCESSOR=" .. package:arch())
  29. end
  30. table.insert(configs, "-DENABLE_TOOLS=" .. (package:config("tools") and "ON" or "OFF"))
  31. import("package.tools.cmake").install(package, configs)
  32. end)
  33. on_test(function (package)
  34. assert(package:has_cfuncs("aom_codec_version_str", {includes = "aom/aom_codec.h"}))
  35. end)