summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-03-10 00:25:53 +0800
committerruki <[email protected]>2022-03-10 00:25:53 +0800
commit64db618a134e8a474f4d785ee47cf04723f782ef (patch)
treeb2ca78856005ebe9d72c2e9567469e187ac14ffc
parent5b342ad6dc7dc51d354bdf59e60605fb411986de (diff)
support template package
-rw-r--r--CHANGELOG.md8
-rw-r--r--xmake/core/package/package.lua5
-rw-r--r--xmake/modules/private/action/require/impl/package.lua2
3 files changed, 14 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 108d1da5c..9bcfddfb8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
## master (unreleased)
+### New features
+
+* [#2138](https://github.com/xmake-io/xmake/issues/2138): Support template package
+
### Changes
* [#2137](https://github.com/xmake-io/xmake/pull/2137): Improve path module
@@ -1226,6 +1230,10 @@
## master (开发中)
+### 新特性
+
+* [#2138](https://github.com/xmake-io/xmake/issues/2138): 支持模板包
+
### 改进
* [#2137](https://github.com/xmake-io/xmake/pull/2137): 改进 path 模块
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 24fe66ea2..b77b24aeb 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -421,6 +421,11 @@ function _instance:is_library()
return self:kind() == nil or self:kind() == "library"
end
+-- is template package?
+function _instance:is_template()
+ return self:kind() == "template"
+end
+
-- is header only?
function _instance:is_headeronly()
return self:is_library() and self:extraconf("kind", "library", "headeronly")
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua
index 89db47e36..b0fe3399c 100644
--- a/xmake/modules/private/action/require/impl/package.lua
+++ b/xmake/modules/private/action/require/impl/package.lua
@@ -932,7 +932,7 @@ end
-- this package should be install?
function should_install(package)
- if package:exists() then
+ if package:is_template() or package:exists() then
return false
end
-- we need not install it if this package need only be fetched