xmake.lua 984 B

12345678910111213141516171819202122232425
  1. package("wingetopt")
  2. set_homepage("https://github.com/alex85k/wingetopt")
  3. set_description("getopt library for Windows compilers")
  4. add_urls("https://github.com/alex85k/wingetopt.git")
  5. add_versions("2025.12.01", "98ea94f3d77890678da28230aa156b225cc14974")
  6. add_versions("2023.10.29", "e8531ed21b44f5a723c1dd700701b2a58ce3ea01")
  7. add_deps("cmake")
  8. on_install("windows", "mingw", function (package)
  9. if package:is_plat("windows") and package:config("shared") then
  10. package:add("defines", "WINGETOPT_SHARED_LIB")
  11. end
  12. local configs = {}
  13. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  14. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  15. import("package.tools.cmake").install(package, configs)
  16. end)
  17. on_test(function (package)
  18. assert(package:has_cfuncs("getopt", {includes = "getopt.h"}))
  19. end)