xmake.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package("workflow")
  2. set_homepage("https://github.com/sogou/workflow")
  3. set_description("C++ Parallel Computing and Asynchronous Networking Engine")
  4. set_license("Apache-2.0")
  5. add_urls("https://github.com/sogou/workflow/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/sogou/workflow.git")
  7. add_versions("v0.10.6", "3d32cb4240c7ec6835c5c0f0bbe8fe0cee38a53351b200facd436d5ff3e31bd1")
  8. add_deps("openssl")
  9. if is_plat("linux") then
  10. add_syslinks("pthread", "dl")
  11. end
  12. on_install("linux", "macosx", "android", function (package)
  13. local configs = {}
  14. if package:config("shared") then
  15. configs.kind = "shared"
  16. end
  17. import("package.tools.xmake").install(package, configs)
  18. end)
  19. on_test(function (package)
  20. assert(package:check_cxxsnippets({test = [[
  21. #include <stdio.h>
  22. #include "workflow/WFHttpServer.h"
  23. void test() {
  24. WFHttpServer server([](WFHttpTask *task) {
  25. task->get_resp()->append_output_body("<html>Hello World!</html>");
  26. });
  27. if (server.start(8888) == 0) { // start server on port 8888
  28. server.stop();
  29. }
  30. }
  31. ]]}, {configs = {languages = "c++11"}}))
  32. end)