parent
5f0b122ed4
commit
c529e83b93
2 changed files with 64 additions and 0 deletions
@ -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…
Reference in new issue