xmake.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. package("reproc")
  2. set_description("a cross-platform C/C++ library that simplifies starting, stopping and communicating with external programs.")
  3. set_homepage("https://github.com/DaanDeMeyer/reproc")
  4. set_license("MIT")
  5. add_urls("https://github.com/DaanDeMeyer/reproc/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/DaanDeMeyer/reproc.git")
  7. add_versions("v14.2.4", "55c780f7faa5c8cabd83ebbb84b68e5e0e09732de70a129f6b3c801e905415dd")
  8. add_deps("cmake")
  9. if is_plat("linux") or is_plat("mingw") then
  10. add_syslinks("pthread")
  11. end
  12. if is_plat("windows") or is_plat("mingw") then
  13. add_syslinks("ws2_32")
  14. end
  15. add_configs("c++", { description = "Build reproc C++ library.", default = true, type = "boolean" })
  16. on_install(function(package)
  17. local configs = {}
  18. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "RelWithDebInfo"))
  19. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  20. table.insert(configs, "-DREPROC++=" .. (package:config("c++") and "ON" or "OFF"))
  21. import("package.tools.cmake").install(package, configs, { buildir = "build" })
  22. end)
  23. on_test(function(package)
  24. assert(package:has_cfuncs("reproc_run", { includes = "reproc/run.h" }))
  25. end)