xmake.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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", "5701ef31518a7927e61b26cd6cc1d699cb43393bf1ffc77fa61e73e64d2dd28e")
  8. add_versions("v0.10.7", "aa9806983f32174597549db4a129e2ee8a3d1f005923fcbb924906bc70c0e123")
  9. add_deps("openssl")
  10. if is_plat("linux") then
  11. add_syslinks("pthread", "dl")
  12. end
  13. on_install("linux", "macosx", "android", function (package)
  14. local configs = {}
  15. if package:config("shared") then
  16. configs.kind = "shared"
  17. end
  18. import("package.tools.xmake").install(package, configs)
  19. end)
  20. on_test(function (package)
  21. assert(package:check_cxxsnippets({test = [[
  22. #include <stdio.h>
  23. #include "workflow/WFHttpServer.h"
  24. void test() {
  25. WFHttpServer server([](WFHttpTask *task) {
  26. task->get_resp()->append_output_body("<html>Hello World!</html>");
  27. });
  28. if (server.start(8888) == 0) { // start server on port 8888
  29. server.stop();
  30. }
  31. }
  32. ]]}, {configs = {languages = "c++11"}}))
  33. end)