summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-10-13 22:38:13 +0800
committerruki <[email protected]>2023-10-13 22:38:13 +0800
commit736522b097bc41506b6b3694c0f1ff095362bfea (patch)
tree401f5708da13048868c2e0028d794d5d94d0ee76
parent4e84c69824df8815b6120c74c165326c224301eb (diff)
add builtin/qt includes
-rw-r--r--tests/projects/qt/quickapp_static/xmake.lua2
-rw-r--r--tests/projects/qt/widgetapp_static/xmake.lua2
-rw-r--r--xmake/core/base/interpreter.lua7
-rw-r--r--xmake/includes/qt/qt_add_static_plugins.lua (renamed from xmake/includes/qt_add_static_plugins.lua)0
-rw-r--r--xmake/includes/qt/xmake.lua21
-rw-r--r--xmake/templates/c++/qt.quickapp_static/project/xmake.lua2
-rw-r--r--xmake/templates/c++/qt.widgetapp_static/project/xmake.lua2
7 files changed, 32 insertions, 4 deletions
diff --git a/tests/projects/qt/quickapp_static/xmake.lua b/tests/projects/qt/quickapp_static/xmake.lua
index 196749658..b6bc9a8cb 100644
--- a/tests/projects/qt/quickapp_static/xmake.lua
+++ b/tests/projects/qt/quickapp_static/xmake.lua
@@ -1,6 +1,6 @@
add_rules("mode.debug", "mode.release")
-includes("qt_add_static_plugins.lua")
+includes("@builtin/qt")
target("demo")
add_rules("qt.quickapp_static")
diff --git a/tests/projects/qt/widgetapp_static/xmake.lua b/tests/projects/qt/widgetapp_static/xmake.lua
index 8ae0094bf..5ca10c888 100644
--- a/tests/projects/qt/widgetapp_static/xmake.lua
+++ b/tests/projects/qt/widgetapp_static/xmake.lua
@@ -1,6 +1,6 @@
add_rules("mode.debug", "mode.release")
-includes("qt_add_static_plugins.lua")
+includes("@builtin/qt")
target("demo")
add_rules("qt.widgetapp_static")
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua
index 8be5a8e4f..7ba677a8f 100644
--- a/xmake/core/base/interpreter.lua
+++ b/xmake/core/base/interpreter.lua
@@ -1720,6 +1720,13 @@ function interpreter:api_builtin_includes(...)
found = true
utils.warning("deprecated: please use includes(\"@builtin/check\") instead of includes(\"%s\")", subpath)
end
+ elseif subpath:startswith("qt_") then
+ local files = os.files(path.join(os.programdir(), "includes", "qt", subpath))
+ if files and #files > 0 then
+ table.join2(subpaths_matched, files)
+ found = true
+ utils.warning("deprecated: please use includes(\"@builtin/qt\") instead of includes(\"%s\")", subpath)
+ end
end
end
if not found then
diff --git a/xmake/includes/qt_add_static_plugins.lua b/xmake/includes/qt/qt_add_static_plugins.lua
index e65965972..e65965972 100644
--- a/xmake/includes/qt_add_static_plugins.lua
+++ b/xmake/includes/qt/qt_add_static_plugins.lua
diff --git a/xmake/includes/qt/xmake.lua b/xmake/includes/qt/xmake.lua
new file mode 100644
index 000000000..c08485bf6
--- /dev/null
+++ b/xmake/includes/qt/xmake.lua
@@ -0,0 +1,21 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-present, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file xmake.lua
+--
+
+includes("@builtin/qt/qt_add_static_plugins.lua")
diff --git a/xmake/templates/c++/qt.quickapp_static/project/xmake.lua b/xmake/templates/c++/qt.quickapp_static/project/xmake.lua
index 860dc513c..0d752b270 100644
--- a/xmake/templates/c++/qt.quickapp_static/project/xmake.lua
+++ b/xmake/templates/c++/qt.quickapp_static/project/xmake.lua
@@ -1,6 +1,6 @@
add_rules("mode.debug", "mode.release")
-includes("qt_add_static_plugins.lua")
+includes("@builtin/qt")
target("${TARGETNAME}")
add_rules("qt.quickapp_static")
diff --git a/xmake/templates/c++/qt.widgetapp_static/project/xmake.lua b/xmake/templates/c++/qt.widgetapp_static/project/xmake.lua
index ac08f5c2e..b2cc1ac86 100644
--- a/xmake/templates/c++/qt.widgetapp_static/project/xmake.lua
+++ b/xmake/templates/c++/qt.widgetapp_static/project/xmake.lua
@@ -1,6 +1,6 @@
add_rules("mode.debug", "mode.release")
-includes("qt_add_static_plugins.lua")
+includes("@builtin/qt")
target("${TARGETNAME}")
add_rules("qt.widgetapp_static")