From b099c3cb052586bf8201ac509cdba4d02ee6b3eb Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 18 Oct 2022 17:44:35 +0800 Subject: [PATCH] add websocketpp (#1550) * add websocketpp * Update xmake.lua --- packages/w/websocketpp/xmake.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 packages/w/websocketpp/xmake.lua diff --git a/packages/w/websocketpp/xmake.lua b/packages/w/websocketpp/xmake.lua new file mode 100644 index 000000000..315564a42 --- /dev/null +++ b/packages/w/websocketpp/xmake.lua @@ -0,0 +1,29 @@ +package("websocketpp") + set_kind("library", {headeronly = true}) + set_homepage("http://www.zaphoyd.com/websocketpp") + set_description("C++ websocket client/server library") + + add_urls("https://github.com/zaphoyd/websocketpp/archive/refs/tags/$(version).tar.gz", + "https://github.com/zaphoyd/websocketpp.git") + add_versions("0.8.2", "6ce889d85ecdc2d8fa07408d6787e7352510750daa66b5ad44aacb47bea76755") + + add_deps("cmake") + add_deps("boost") + + on_install("linux", "macosx", "windows", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + typedef websocketpp::server server; + void test() { + server echo_server; + } + ]]}, {configs = {languages = "c++17"}})) + end)