2
0

xmake.lua 1.4 KB

12345678910111213141516171819202122232425262728
  1. package("tiny-process-library")
  2. set_homepage("https://gitlab.com/eidheim/tiny-process-library")
  3. set_description("A small platform independent library making it simple to create and stop new processes in C++, as well as writing to stdin and reading from stdout and stderr of a new process")
  4. set_license("MIT")
  5. add_urls("https://gitlab.com/eidheim/tiny-process-library/-/archive/$(version)/tiny-process-library-$(version).tar.gz",
  6. "https://gitlab.com/eidheim/tiny-process-library.git")
  7. add_versions("v2.0.4", "b99dcb51461323b8284a7762ad105c159b88cdcce0c2cc183e4f474f80ef1f1a")
  8. add_deps("cmake")
  9. on_install(function (package)
  10. local configs = {"-DBUILD_TESTING=OFF"}
  11. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  12. if package:config("shared") then
  13. table.insert(configs, "-DBUILD_SHARED_LIBS=ON")
  14. if package:is_plat("windows", "mingw") then
  15. table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON")
  16. end
  17. else
  18. table.insert(configs, "-DBUILD_SHARED_LIBS=OFF")
  19. end
  20. import("package.tools.cmake").install(package, configs)
  21. end)
  22. on_test(function (package)
  23. assert(package:has_cxxtypes("TinyProcessLib::Process", {configs = {languages = "c++11"}, includes = "process.hpp"}))
  24. end)