summaryrefslogtreecommitdiff
path: root/xmake/core/package/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-02-10 23:48:02 +0800
committerruki <[email protected]>2026-02-10 23:48:02 +0800
commit83f17e9557c971690a276ff93a5b65d66eba709d (patch)
tree2fd238f7864ea17b733749564aae46cd078c1888 /xmake/core/package/package.lua
parentee98b61be7054e1b8b8e2668b67c662ba12e264b (diff)
keep package source
Diffstat (limited to 'xmake/core/package/package.lua')
-rw-r--r--xmake/core/package/package.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 692be9ae8..4ca402cdf 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -662,6 +662,24 @@ function _instance:is_debug()
return self:config("debug") or self:config("asan")
end
+-- should keep package source code after installing?
+function _instance:has_source()
+ if self:is_debug() then
+ return true
+ end
+ if self:is_source_embed() then
+ return true
+ end
+ local project = package._project()
+ if project and project.policy("package.keep_source") then
+ return true
+ end
+ if self:policy("package.keep_source") then
+ return true
+ end
+ return false
+end
+
-- is the supported package?
function _instance:is_supported()
-- attempt to get the install script with the current plat/arch