summaryrefslogtreecommitdiff
path: root/xmake/core/package/package.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/package/package.lua')
-rw-r--r--xmake/core/package/package.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 51cc9da91..0ca4dc676 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -110,8 +110,8 @@ end
-- set the value to the package info
function _instance:set(name, ...)
if self._SOURCE_INITED then
- if self:_sourceset():has(name) then
- os.raise("package:set(\"%s\", ...) can only be called in on_source().", name)
+ if self:_sourceset():has(name) and self:get(name) == nil then
+ os.raise("'%s' can only be initied in on_source() or description scope.", name)
end
end
self._INFO:apival_set(name, ...)
@@ -120,8 +120,8 @@ end
-- add the value to the package info
function _instance:add(name, ...)
if self._SOURCE_INITED then
- if self:_sourceset():has(name) then
- os.raise("package:add(\"%s\", ...) can only be called in on_source().", name)
+ if self:_sourceset():has(name) and self:get(name) == nil then
+ os.raise("'%s' can only be initied in on_source() or description scope.", name)
end
end
self._INFO:apival_add(name, ...)