summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2026-02-10 23:51:32 +0800
committerruki <[email protected]>2026-02-10 23:51:32 +0800
commitf59677a14435189b9bd9f11bd8e88147efc2439d (patch)
tree76d9372e10747bdd511474ee417dab990683ad1b
parent83f17e9557c971690a276ff93a5b65d66eba709d (diff)
improve has_source
-rw-r--r--xmake/core/package/package.lua17
1 files changed, 4 insertions, 13 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 4ca402cdf..1b55257a8 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -664,20 +664,11 @@ 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
+ return self:is_debug() or
+ self:is_source_embed() or
+ (project and project.policy("package.keep_source")) or
+ self:policy("package.keep_source")
end
-- is the supported package?