xmake.lua 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package("workflow")
  2. set_homepage("https://github.com/sogou/workflow")
  3. set_description("C++ Parallel Computing and Asynchronous Networking Framework")
  4. set_license("Apache-2.0")
  5. if is_plat("windows") then
  6. add_urls("https://github.com/sogou/workflow/archive/refs/tags/$(version)-win.zip",
  7. "https://github.com/sogou/workflow.git")
  8. add_versions("v0.10.10", "6758b1d46c4beadfccc88d3e9492bb99cfad26e643c141749aec790907092417")
  9. else
  10. add_urls("https://github.com/sogou/workflow/archive/refs/tags/$(version).tar.gz",
  11. "https://github.com/sogou/workflow.git")
  12. add_versions("v0.10.6", "5701ef31518a7927e61b26cd6cc1d699cb43393bf1ffc77fa61e73e64d2dd28e")
  13. add_versions("v0.10.7", "aa9806983f32174597549db4a129e2ee8a3d1f005923fcbb924906bc70c0e123")
  14. add_versions("v0.10.8", "bb5654e8011822d4251a7a433cbe4c5ecfd2c65c8f997a8196685742d24bcaf0")
  15. add_versions("v0.10.9", "10f695aeb5da87ae138e3bcd2fa10c18aac782b0da20f11b2fd0b7b091d06767")
  16. add_versions("v0.11.1", "06968ed4e43f6676811b620d09eb5c32ac57252305e7e28def6efde8ef1ceb19")
  17. add_versions("v0.11.2", "cc2d18ab2b292e2f0163ef67ef6976912e2a21c271396da0e2151ca8cd22abd3")
  18. add_versions("v0.11.3", "af7adcdd8151f8e72247599a43c28aa849d61ed39e58058cfa80649d011575bc")
  19. add_versions("v0.11.4", "844fd03db120141fa61600b26a4ef35716dc0e75d1e8c8018078eb385cf746a4")
  20. end
  21. add_deps("openssl")
  22. if is_plat("windows") then
  23. add_deps("cmake")
  24. add_syslinks("Mswsock")
  25. end
  26. if is_plat("linux") then
  27. add_syslinks("pthread", "dl")
  28. end
  29. on_install("linux", "macosx", "android", function (package)
  30. local configs = {}
  31. if package:config("shared") then
  32. configs.kind = "shared"
  33. end
  34. import("package.tools.xmake").install(package, configs)
  35. end)
  36. on_install("windows", function (package)
  37. local configs = {}
  38. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  39. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  40. import("package.tools.cmake").install(package, configs)
  41. end)
  42. on_test(function (package)
  43. assert(package:check_cxxsnippets({test = [[
  44. #include <stdio.h>
  45. #include "workflow/WFHttpServer.h"
  46. void test() {
  47. WFHttpServer server([](WFHttpTask *task) {
  48. task->get_resp()->append_output_body("<html>Hello World!</html>");
  49. });
  50. if (server.start(8888) == 0) { // start server on port 8888
  51. server.stop();
  52. }
  53. }
  54. ]]}, {configs = {languages = "c++11"}}))
  55. end)