xmake.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. package("bento4")
  2. set_homepage("http://www.bento4.com")
  3. set_description("Full-featured MP4 format, MPEG DASH, HLS, CMAF SDK and tools")
  4. add_urls("https://github.com/axiomatic-systems/Bento4.git")
  5. add_versions("2023.08.08", "2e2dc016274764b8eb511a3503aa37e7334be6bf")
  6. add_deps("cmake")
  7. on_install(function (package)
  8. if package:is_plat("android") then
  9. import("core.tool.toolchain")
  10. local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()})
  11. local ndk_sdkver = ndk:config("ndk_sdkver")
  12. assert(ndk_sdkver and tonumber(ndk_sdkver) > 21, "package(bento4): need ndk api level >= 21 for android")
  13. end
  14. local configs = {"-DBUILD_APPS=OFF"}
  15. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  16. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  17. import("package.tools.cmake").install(package, configs)
  18. end)
  19. on_test(function (package)
  20. assert(package:check_cxxsnippets({test = [[
  21. #include <bento4/Ap4.h>
  22. void test() {
  23. AP4_Result x = AP4::Initialize();
  24. }
  25. ]]}))
  26. end)