add packages: qt6qml and qt6quick (#2758)

* qt6quick & qt6qml

* fix qt6quick test
pull/2759/head
Altyrost 1 year ago committed by GitHub
parent 5f0b122ed4
commit c529e83b93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 35
      packages/q/qt6qml/xmake.lua
  2. 29
      packages/q/qt6quick/xmake.lua

@ -0,0 +1,35 @@
package("qt6qml")
set_base("qt6lib")
set_kind("library")
on_load(function (package)
package:add("deps", "qt6core", "qt6gui", {debug = package:is_debug(), version = package:version_str()})
package:data_set("libname", "Qml")
package:base():script("load")(package)
end)
on_test(function (package)
local cxflags
if package:is_plat("windows") then
cxflags = {"/Zc:__cplusplus", "/permissive-"}
else
cxflags = "-fPIC"
end
assert(package:check_cxxsnippets({test = [[
int test(int argc, char** argv) {
#if QT_VERSION >= 0x50601
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}
]]}, {configs = {languages = "c++17", cxflags = cxflags}, includes = {"QGuiApplication", "QQmlApplicationEngine"}}))
end)

@ -0,0 +1,29 @@
package("qt6quick")
set_base("qt6lib")
set_kind("library")
on_load(function (package)
package:add("deps", "qt6core", "qt6gui", "qt6qml", {debug = package:is_debug(), version = package:version_str()})
package:data_set("libname", "Quick")
package:base():script("load")(package)
end)
on_test(function (package)
local cxflags
if package:is_plat("windows") then
cxflags = {"/Zc:__cplusplus", "/permissive-"}
else
cxflags = "-fPIC"
end
assert(package:check_cxxsnippets({test = [[
int test(int argc, char** argv)
{
QGuiApplication app(argc, argv);
QQuickView view;
view.setSource(QUrl::fromLocalFile("MyItem.qml"));
view.show();
return app.exec();
}
]]}, {configs = {languages = "c++17", cxflags = cxflags}, includes = {"QGuiApplication", "QQuickView"}}))
end)
Loading…
Cancel
Save