xmake.lua 1.7 KB

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