xmake.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package("innoextract")
  2. set_kind("binary")
  3. set_homepage("https://constexpr.org/innoextract/")
  4. set_description("A tool to unpack installers created by Inno Setup")
  5. add_urls("https://github.com/dscharrer/innoextract.git")
  6. add_versions("2025.02.07", "6e9e34ed0876014fdb46e684103ef8c3605e382e")
  7. add_deps("cmake")
  8. add_deps("xz")
  9. add_deps("boost", {configs = {
  10. iostreams = true,
  11. zlib = true,
  12. bzip2 = true,
  13. filesystem = true,
  14. date_time = true,
  15. system = true,
  16. program_options = true,
  17. }})
  18. on_install(function (package)
  19. local configs = {"-DUSE_STATIC_LIBS=OFF"}
  20. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  21. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  22. table.insert(configs, "-DUSE_LTO=" .. (package:config("lto") and "ON" or "OFF"))
  23. table.insert(configs, "-DLZMA_USE_STATIC_LIBS=" .. (package:dep("xz"):config("shared") and "OFF" or "ON"))
  24. table.insert(configs, "-DZLIB_USE_STATIC_LIBS=" .. (package:dep("boost"):config("shared") and "OFF" or "ON"))
  25. table.insert(configs, "-DBZip2_USE_STATIC_LIBS=" .. (package:dep("bzip2"):config("shared") and "OFF" or "ON"))
  26. table.insert(configs, "-DBoost_USE_STATIC_LIBS=" .. (package:dep("zlib"):config("shared") and "OFF" or "ON"))
  27. import("package.tools.cmake").install(package, configs)
  28. end)
  29. on_test(function (package)
  30. os.vrun("innoextract --help")
  31. end)