xmake.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package("avisynthplus")
  2. set_homepage("http://avs-plus.net")
  3. set_description("AviSynth with improvements")
  4. set_license("GPL-2.0")
  5. add_urls("https://github.com/AviSynth/AviSynthPlus.git", {submodules = false})
  6. add_versions("2026.01.01", "f2f4e318a5ba161d4945185f11c6a27e7aafa92b")
  7. if is_plat("windows", "mingw") then
  8. add_syslinks("user32", "gdi32", "advapi32", "ole32", "vfw32", "winmm", "msacm32", "imagehlp")
  9. end
  10. add_deps("cmake")
  11. add_deps("ghc_filesystem")
  12. if on_check then
  13. on_check("mingw", function (package)
  14. assert(package:check_sizeof("void*") == "8", "package(avisynthplus) MinGW requires to be 64-bit, 32-bit is not supported.")
  15. end)
  16. end
  17. on_load("windows", "mingw", function (package)
  18. if not package:config("shared") then
  19. package:add("defines", "AVS_STATIC_LIB")
  20. end
  21. end)
  22. on_install("!wasm and !android and !cross", function (package)
  23. io.replace("avs_core/CMakeLists.txt", "if (MINGW)", "if (0)", {plain = true})
  24. local configs = {
  25. "-DENABLE_PLUGINS=OFF"
  26. }
  27. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  28. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  29. import("package.tools.cmake").install(package, configs)
  30. end)
  31. on_test(function (package)
  32. assert(package:check_cxxsnippets({test = [[
  33. void test() {
  34. AvisynthError("test");
  35. }
  36. ]]}, {configs = {languages = "c++17"}, includes = "avisynth/avisynth.h"}))
  37. end)