diff options
Diffstat (limited to 'xmake/core/package/package.lua')
| -rw-r--r-- | xmake/core/package/package.lua | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 6f0a6e4d0..1940780f9 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -228,8 +228,23 @@ function _instance:prefixfile() return path.join(self:prefixdir(".info"), self:name() .. "-" .. (self:version_str() or "") .. ".txt") end +-- get variables +function _instance:get(name) + return self:prefixinfo()[name] +end + +-- set variables +function _instance:set(name, ...) + self:prefixinfo()[name] = {...} +end + +-- add variables +function _instance:add(name, ...) + self:prefixinfo()[name] = table.join(self:prefixinfo()[name] or {}, ...) +end + -- get environment variables -function _instance:getenv(name, ...) +function _instance:getenv(name) return self:prefixinfo().envars and self:prefixinfo().envars[name] or nil end |
