xmake.lua 1.2 KB

123456789101112131415161718192021222324252627282930
  1. package("libyuv")
  2. set_homepage("https://chromium.googlesource.com/libyuv/libyuv/")
  3. set_description("libyuv is an open source project that includes YUV scaling and conversion functionality.")
  4. set_license("BSD-3-Clause")
  5. set_urls("https://chromium.googlesource.com/libyuv/libyuv.git")
  6. add_versions("2023.10.27", "31e1d6f896615342d5d5b6bde8f7b50b3fd698dc")
  7. add_deps("cmake")
  8. on_install("windows", "linux", "macosx", "android", "cross", "bsd", "mingw", function (package)
  9. local configs = {"-DTEST=OFF"}
  10. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  11. io.replace("CMakeLists.txt", "INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin )", "", {plain = true})
  12. import("package.tools.cmake").install(package, configs)
  13. if package:is_plat("macosx", "linux", "android") then
  14. if package:config("shared") then
  15. os.tryrm(package:installdir("lib", "*.a"))
  16. else
  17. os.tryrm(package:installdir("lib", "*.so"))
  18. end
  19. end
  20. end)
  21. on_test(function (package)
  22. assert(package:has_cfuncs("I420Rotate", {includes = "libyuv/rotate.h"}))
  23. end)