xmake.lua 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. package("openh264")
  2. set_homepage("http://www.openh264.org/")
  3. set_description("OpenH264 is a codec library which supports H.264 encoding and decoding.")
  4. set_license("BSD-2-Clause")
  5. add_urls("https://github.com/cisco/openh264/archive/refs/tags/$(version).tar.gz")
  6. add_versions("v2.1.1", "af173e90fce65f80722fa894e1af0d6b07572292e76de7b65273df4c0a8be678")
  7. add_deps("meson", "ninja", "nasm")
  8. if is_plat("linux") then
  9. add_syslinks("pthread", "rt")
  10. end
  11. on_install("windows", "linux", function (package)
  12. import("package.tools.meson").build(package, {"-Dtests=disabled"}, {buildir = "out"})
  13. import("package.tools.ninja").install(package, {}, {buildir = "out"})
  14. if package:config("shared") then
  15. os.tryrm(path.join(package:installdir("lib"), "libopenh264.a"))
  16. else
  17. os.tryrm(path.join(package:installdir("lib"), "libopenh264.so*"))
  18. os.tryrm(path.join(package:installdir("lib"), "openh264.lib"))
  19. os.tryrm(path.join(package:installdir("bin"), "openh264-*.dll"))
  20. end
  21. if package:is_plat("windows") then
  22. os.trymv(path.join(package:installdir("lib"), "libopenh264.a"), path.join(package:installdir("lib"), "openh264.lib"))
  23. end
  24. end)
  25. on_test(function (package)
  26. assert(package:has_cxxfuncs("WelsGetCodecVersion", {includes = "wels/codec_api.h"}))
  27. end)