Kaynağa Gözat

Add Qt webview (#2232)

* Add Qt webview

* WebKit

* Delete xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

According to https://doc.qt.io/qt-5/qtwebview.html the right include is QtWebView

* Update xmake.lua

* Create qt5webview

* Delete xmake.lua

* Update xmake.lua

* Update xmake.lua

* Delete qt5webview

* Create xmake.lua

* qt5webview: disable MinGW

---------

Co-authored-by: Jérôme Leclercq <[email protected]>
Maxime 2 yıl önce
ebeveyn
işleme
bf1b6d5684

+ 1 - 1
packages/q/qt5base/xmake.lua

@@ -43,7 +43,7 @@ package("qt5base")
         return qt
     end)
 
-    on_install("windows", "linux", "macosx", "mingw", "android", "iphoneos", function (package)
+    on_install("windows|x86", "windows|x64", "linux", "macosx", "mingw", "android", "iphoneos", function (package)
         import("core.base.semver")
         import("core.project.config")
         import("core.tool.toolchain")

+ 1 - 1
packages/q/qt5lib/xmake.lua

@@ -73,7 +73,7 @@ package("qt5lib")
         }
     end)
 
-    on_install("windows", "linux", "macosx", "mingw", "android", "iphoneos", function (package)
+    on_install("windows|x86", "windows|x64", "linux", "macosx", "mingw", "android", "iphoneos", function (package)
         local qt = package:dep("qt5base"):data("qt")
         assert(qt, "qt5base is required")
     end)

+ 29 - 0
packages/q/qt5webview/xmake.lua

@@ -0,0 +1,29 @@
+package("qt5webview")
+    set_base("qt5lib")
+    set_kind("library")
+
+    on_load(function (package)
+        package:add("deps", "qt5core", "qt5gui", {debug = package:is_debug(), version = package:version_str()})
+        package:data_set("libname", "WebView")
+
+        package:base():script("load")(package)
+        package:set("kind", "library")
+    end)
+
+    on_install("windows|x86", "windows|x64", "linux", "macosx", "android", "iphoneos", function (package)
+        package:base():script("install")(package)
+    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) {
+                QtWebView::initialize();
+                QGuiApplication  app (argc, argv);
+                return app.exec();
+            }
+        ]]}, {configs = {languages = "c++14", cxflags = cxflags}, includes = {"QGuiApplication", "QtWebView"}}))
+    end)