瀏覽代碼

add qt.quickapp rule docs

ruki 5 年之前
父節點
當前提交
e2a338abe7
共有 2 個文件被更改,包括 92 次插入36 次删除
  1. 48 21
      manual/custom_rule.md
  2. 44 15
      zh-cn/manual/custom_rule.md

+ 48 - 21
manual/custom_rule.md

@@ -91,7 +91,10 @@ sinceAfter the 2.2.1 release, xmake provides some built-in rules to simplify the
 | [qt.static](#qt-static)                         | Qt Static Library Compilation Rule                       | >= 2.2.1 |
 | [qt.shared](#qt-shared)                         | Qt Dynamic Library Compilation Rule                      | >= 2.2.1 |
 | [qt.console](#qt-console)                       | Qt Console Compilation Rule                              | >= 2.2.1 |
-| [qt.application](#qt-application)               | Qt Application Compilation Rule                          | >= 2.2.1 |
+| [qt.quickapp](#qt-quickapp)                     | Qt QuickApp Compilation Rule                             | >= 2.2.3 |
+| [qt.quickapp_static](#qt-quickapp_static)       | Qt QuickApp Compilation Rule (static link)               | >= 2.2.3 |
+| [qt.widgetapp](#qt-widgetapp)                   | Qt WidgetApp Compilation Rule                            | >= 2.2.3 |
+| [qt.widgetapp_static](#qt-widgetapp_static)     | Qt WidgetApp Compilation Rule(static link)             | >= 2.2.3 |
 | [wdk.umdf.driver](#wdk-umdf-driver)             | WDK Environment umdf Driver Compilation Rule             | >= 2.2.1 |
 | [wdk.umdf.binary](#wdk-umdf-binary)             | WDK Environment umdf Driver Application Compilation Rule | >= 2.2.1 |
 | [wdk.kmdf.driver](#wdk-kmdf-driver)             | WDK Environment kmdf Driver Compilation Rule             | >= 2.2.1 |
@@ -299,7 +302,7 @@ We can switch to this compilation mode by: `xmake f -m ubsan`.
 A static library program used to compile and generate Qt environments:
 
 ```lua
-target("qt_static_library")
+target("test")
     add_rules("qt.static")
     add_files("src/*.cpp")
     add_frameworks("QtNetwork", "QtGui")
@@ -310,7 +313,7 @@ target("qt_static_library")
 Dynamic library program for compiling and generating Qt environment:
 
 ```lua
-target("qt_shared_library")
+target("test")
     add_rules("qt.shared")
     add_files("src/*.cpp")
     add_frameworks("QtNetwork", "QtGui")
@@ -321,40 +324,64 @@ target("qt_shared_library")
 A console program for compiling and generating a Qt environment:
 
 ```lua
-target("qt_console")
+target("test")
     add_rules("qt.console")
     add_files("src/*.cpp")
 ```
 
-#### qt.application
+#### qt.quickapp
 
-Used to compile ui applications that generate Qt environments.
+Quick(qml) ui application for compiling and generating Qt environment.
 
-Quick(qml) application:
 
 ```lua
-target("qt_quickapp")
-    add_rules("qt.application")
-    add_files("src/*.cpp")
-    add_files("src/qml.qrc")
-    add_frameworks("QtQuick")
+target("test")
+    add_rules("qt.quickapp")
+    add_files("src/*.cpp")
+    add_files("src/qml.qrc")
 ```
 
-Qt Widgets (ui/moc) application:
+#### qt.quickapp_static
+
+Quick(qml) ui application (statically linked version) for compiling and generating Qt environment.
+
+!> Need to switch to static library version Qt SDK
+
 
 ```lua
--- add target
-target("qt_widgetapp")
-    add_rules("qt.application")
-    add_files("src/*.cpp")
-    add_files("src/mainwindow.ui")
-    add_files("src/mainwindow.h") -- Add a meta header file with Q_OBJECT
-    add_frameworks("QtWidgets")
+target("test")
+    add_rules("qt.quickapp_static")
+    add_files("src/*.cpp")
+    add_files("src/qml.qrc")
 ```
 
-For more descriptions of Qt, see: [#160](https://github.com/xmake-io/xmake/issues/160)
+#### qt.widgetapp
 
+Used to compile Qt Widgets (ui/moc) applications
 
+```lua
+target("test")
+    add_rules("qt.widgetapp")
+    add_files("src/*.cpp")
+    add_files("src/mainwindow.ui")
+    add_files("src/mainwindow.h") -- add meta header files with Q_OBJECT
+```
+
+#### qt.widgetapp_static
+
+Used to compile Qt Widgets (ui/moc) applications (static library version)
+
+!> Need to switch to static library version Qt SDK
+
+```lua
+target("test")
+    add_rules("qt.widgetapp_static")
+    add_files("src/*.cpp")
+    add_files("src/mainwindow.ui")
+    add_files("src/mainwindow.h") -- add meta header files with Q_OBJECT
+```
+
+For more descriptions of Qt, see: [#160](https://github.com/xmake-io/xmake/issues/160)
 
 #### wdk.env.kmdf
 

+ 44 - 15
zh-cn/manual/custom_rule.md

@@ -91,7 +91,10 @@ target("test")
 | [qt.static](#qt-static)                         | Qt静态库编译规则                             | >= 2.2.1 |
 | [qt.shared](#qt-shared)                         | Qt动态库编译规则                             | >= 2.2.1 |
 | [qt.console](#qt-console)                       | Qt控制台编译规则                             | >= 2.2.1 |
-| [qt.application](#qt-application)               | Qt应用程序编译规则                           | >= 2.2.1 |
+| [qt.quickapp](#qt-quickapp)                     | Qt QuickApp应用程序编译规则                  | >= 2.2.3 |
+| [qt.quickapp_static](#qt-quickapp_static)       | Qt QuickApp应用程序编译规则(静态链接)      | >= 2.2.3 |
+| [qt.widgetapp](#qt-widgetapp)                   | Qt WidgetApp应用程序编译规则                 | >= 2.2.3 |
+| [qt.widgetapp_static](#qt-widgetapp_static)     | Qt WidgetApp应用程序编译规则(静态链接)     | >= 2.2.3 |
 | [wdk.umdf.driver](#wdk-umdf-driver)             | WDK环境umdf驱动编译规则                      | >= 2.2.1 |
 | [wdk.umdf.binary](#wdk-umdf-binary)             | WDK环境umdf驱动应用编译规则                  | >= 2.2.1 |
 | [wdk.kmdf.driver](#wdk-kmdf-driver)             | WDK环境kmdf驱动编译规则                      | >= 2.2.1 |
@@ -301,7 +304,7 @@ add_rules("mode.ubsan")
 用于编译生成Qt环境的静态库程序:
 
 ```lua
-target("qt_static_library")
+target("test")
     add_rules("qt.static")
     add_files("src/*.cpp")
     add_frameworks("QtNetwork", "QtGui")
@@ -312,7 +315,7 @@ target("qt_static_library")
 用于编译生成Qt环境的动态库程序:
 
 ```lua
-target("qt_shared_library")
+target("test")
     add_rules("qt.shared")
     add_files("src/*.cpp")
     add_frameworks("QtNetwork", "QtGui")
@@ -323,35 +326,61 @@ target("qt_shared_library")
 用于编译生成Qt环境的控制台程序:
 
 ```lua
-target("qt_console")
+target("test")
     add_rules("qt.console")
     add_files("src/*.cpp")
 ```
 
-#### qt.application
+#### qt.quickapp
 
-用于编译生成Qt环境的ui应用程序。
+用于编译生成Qt环境的Quick(qml) ui应用程序。
 
-Quick(qml)应用程序:
 
 ```lua
-target("qt_quickapp")
-    add_rules("qt.application")
+target("test")
+    add_rules("qt.quickapp")
     add_files("src/*.cpp") 
     add_files("src/qml.qrc")
-    add_frameworks("QtQuick")
 ```
 
-Qt Widgets(ui/moc)应用程序:
+#### qt.quickapp_static
+
+用于编译生成Qt环境的Quick(qml) ui应用程序(静态链接版本)。
+
+!> 需要切换到静态库版本Qt SDK
+
 
 ```lua
--- add target
-target("qt_widgetapp")
-    add_rules("qt.application")
+target("test")
+    add_rules("qt.quickapp_static")
+    add_files("src/*.cpp") 
+    add_files("src/qml.qrc")
+```
+
+#### qt.widgetapp 
+
+用于编译Qt Widgets(ui/moc)应用程序
+
+```lua
+target("test")
+    add_rules("qt.widgetapp")
+    add_files("src/*.cpp") 
+    add_files("src/mainwindow.ui")
+    add_files("src/mainwindow.h")  -- 添加带有 Q_OBJECT 的meta头文件
+```
+
+#### qt.widgetapp_static 
+
+用于编译Qt Widgets(ui/moc)应用程序(静态库版本)
+
+!> 需要切换到静态库版本Qt SDK
+
+```lua
+target("test")
+    add_rules("qt.widgetapp_static")
     add_files("src/*.cpp") 
     add_files("src/mainwindow.ui")
     add_files("src/mainwindow.h")  -- 添加带有 Q_OBJECT 的meta头文件
-    add_frameworks("QtWidgets")
 ```
 
 更多Qt相关描述见:[#160](https://github.com/xmake-io/xmake/issues/160)