xmake.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package("srtp")
  2. set_homepage("https://github.com/cisco/libsrtp")
  3. set_description("Library for SRTP (Secure Realtime Transport Protocol)")
  4. add_urls("https://github.com/cisco/libsrtp/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/cisco/libsrtp.git")
  6. add_versions("v2.6", "f1886f72eff1d8aa82ada40b2fc3d342a3ecaf0f8988cb63d4af234fccf2253d")
  7. add_versions("v2.5.0", "8a43ef8e9ae2b665292591af62aa1a4ae41e468b6d98d8258f91478735da4e09")
  8. add_configs("openssl", {description = "Enable OpenSSL crypto engine", default = false, type = "boolean"})
  9. add_configs("mbedtls", {description = "Enable MbedTLS crypto engine", default = false, type = "boolean"})
  10. add_configs("nss", {description = "Enable NSS crypto engine", default = false, type = "boolean"})
  11. add_deps("cmake")
  12. add_deps("openssl")
  13. on_install("windows", "linux", "macosx", "android@linux,macosx", "cross", "bsd", "mingw", function (package)
  14. local configs =
  15. {
  16. "-DLIBSRTP_TEST_APPS=OFF",
  17. "-DTEST_APPS=OFF",
  18. "-DBUILD_WITH_WARNINGS=OFF",
  19. "-DENABLE_WARNINGS=OFF",
  20. "-DENABLE_WARNINGS_AS_ERRORS=OFF",
  21. }
  22. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  23. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  24. for name, enabled in pairs(package:configs()) do
  25. if not package:extraconf("configs", name, "builtin") then
  26. table.insert(configs, "-DENABLE_" .. name:upper() .. "=" .. (enabled and "ON" or "OFF"))
  27. end
  28. end
  29. import("package.tools.cmake").install(package, configs)
  30. end)
  31. on_test(function (package)
  32. assert(package:has_cfuncs("srtp_init", {includes = "srtp2/srtp.h"}))
  33. end)