summaryrefslogtreecommitdiff
path: root/xmake
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 /xmake
parent5b342ad6dc7dc51d354bdf59e60605fb411986de (diff)
support template package
Diffstat (limited to 'xmake')
-rw-r--r--xmake/core/package/package.lua5
-rw-r--r--xmake/modules/private/action/require/impl/package.lua2
2 files changed, 6 insertions, 1 deletions
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