xmake.lua 905 B

1234567891011121314151617181920212223
  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("2023.10.29", "e8531ed21b44f5a723c1dd700701b2a58ce3ea01")
  6. add_deps("cmake")
  7. on_install("windows", "mingw", function (package)
  8. if package:is_plat("windows") and package:config("shared") then
  9. package:add("defines", "WINGETOPT_SHARED_LIB")
  10. end
  11. local configs = {}
  12. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  13. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  14. import("package.tools.cmake").install(package, configs)
  15. end)
  16. on_test(function (package)
  17. assert(package:has_cfuncs("getopt", {includes = "getopt.h"}))
  18. end)