Add qt5network (#1057)
* Add qt5network * Update xmake.lua * Update xmake.lua * Update xmake.lua * Update xmake.lua * Try to fix qt5network * Update xmake.lua * Update xmake.lua * Update xmake.lua Co-authored-by: ruki <waruqi@gmail.com>pull/1064/head
parent
acc4aedb80
commit
a373319a2c
2 changed files with 42 additions and 1 deletions
@ -0,0 +1,41 @@ |
||||
package("qt5network") |
||||
set_base("qt5lib") |
||||
set_kind("library") |
||||
|
||||
on_load(function (package) |
||||
package:add("deps", "qt5core", {debug = package:is_debug(), version = package:version_str()}) |
||||
package:data_set("libname", "Network") |
||||
|
||||
if package:is_plat("linux") then |
||||
-- we need system openssl with evp-kdf |
||||
-- @see https://github.com/xmake-io/xmake-repo/pull/1057#issuecomment-1069006866 |
||||
if linuxos.name() == "fedora" then |
||||
package:add("deps", "openssl", {system = true}) |
||||
else |
||||
package:add("deps", "openssl") |
||||
end |
||||
elseif package:is_plat("iphoneos") then |
||||
package:data_set("frameworks", {"GSS", "IOKit", "Security", "SystemConfiguration"}) |
||||
end |
||||
|
||||
package:base():script("load")(package) |
||||
package:set("kind", "library") |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
local cxflags |
||||
if not package:is_plat("windows") then |
||||
cxflags = "-fPIC" |
||||
end |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
int test(int argc, char** argv) { |
||||
QCoreApplication app(argc, argv); |
||||
|
||||
QByteArray datagram = "Hello from xmake!"; |
||||
QUdpSocket udpSocket; |
||||
udpSocket.writeDatagram(datagram, QHostAddress::Broadcast, 45454); |
||||
|
||||
return app.exec(); |
||||
} |
||||
]]}, {configs = {languages = "c++14", cxflags = cxflags}, includes = {"QCoreApplication", "QByteArray", "QUdpSocket"}})) |
||||
end) |
Loading…
Reference in new issue