|
|
|
@ -25,7 +25,7 @@ package("ixwebsocket") |
|
|
|
|
|
|
|
|
|
add_deps("zlib") |
|
|
|
|
if is_plat("windows") then |
|
|
|
|
add_syslinks("ws2_32") |
|
|
|
|
add_syslinks("ws2_32", "crypt32") |
|
|
|
|
elseif is_plat("macosx") then |
|
|
|
|
add_frameworks("Foundation", "Security") |
|
|
|
|
elseif is_plat("linux", "bsd") then |
|
|
|
@ -39,6 +39,15 @@ package("ixwebsocket") |
|
|
|
|
elseif package:config("ssl") == "mbedtls" then |
|
|
|
|
package:add("deps", "mbedtls") |
|
|
|
|
end |
|
|
|
|
if package:config("use_tls") then |
|
|
|
|
if is_plat("windows") then |
|
|
|
|
if not package:dep("openssl") then |
|
|
|
|
package:add("deps", "mbedtls") |
|
|
|
|
end |
|
|
|
|
elseif not package:dep("mbedtls") then |
|
|
|
|
package:add("deps", "openssl") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
on_install(function (package) |
|
|
|
@ -46,6 +55,11 @@ package("ixwebsocket") |
|
|
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) |
|
|
|
|
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
|
|
|
|
table.insert(configs, "-DUSE_TLS=" .. (package:config("use_tls") and "ON" or "OFF")) |
|
|
|
|
if package:dep("openssl") then |
|
|
|
|
table.insert(configs, "-DUSE_OPEN_SSL=1") |
|
|
|
|
elseif package:dep("mbedtls") then |
|
|
|
|
table.insert(configs, "-DUSE_MBED_TLS=1") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
local zlib = package:dep("zlib") |
|
|
|
|
if zlib and not zlib:is_system() then |
|
|
|
@ -66,6 +80,8 @@ package("ixwebsocket") |
|
|
|
|
io.replace("ixwebsocket/IXUserAgent.cpp", [[ss << " " << PLATFORM_NAME]], [[ss << " " << "unknown platform"]], {plain = true}) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
io.replace("ixwebsocket/IXSocketMbedTLS.cpp", [[/* errorMsg */]], [[errorMsg]], {plain = true}) |
|
|
|
|
|
|
|
|
|
import("package.tools.cmake").install(package, configs) |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
@ -73,7 +89,7 @@ package("ixwebsocket") |
|
|
|
|
assert(package:check_cxxsnippets({test = [[ |
|
|
|
|
#include <ixwebsocket/IXNetSystem.h> |
|
|
|
|
#include <ixwebsocket/IXWebSocket.h> |
|
|
|
|
void test () { |
|
|
|
|
void test() { |
|
|
|
|
ix::initNetSystem(); |
|
|
|
|
ix::WebSocket webSocket; |
|
|
|
|
std::string url("wss://echo.websocket.org"); |
|
|
|
|