diff options
| author | ruki <[email protected]> | 2018-09-15 22:47:04 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-09-15 22:47:04 +0800 |
| commit | bd1725e5ca685df706f96ad82ae1b26615be726a (patch) | |
| tree | d08f7f5d3f88bb621e95816b0e2873421d56e797 /xmake/core/package/package.lua | |
| parent | f767439ed8d9509e98cb0b7f0c6b75d62729e153 (diff) | |
improve to build package with xmake
Diffstat (limited to 'xmake/core/package/package.lua')
| -rw-r--r-- | xmake/core/package/package.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 8ee1c807b..b96671fe8 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -273,6 +273,24 @@ end -- set the require info function _instance:requireinfo_set(requireinfo) self._REQUIREINFO = requireinfo + -- switch to local package if exists package configuration + if requireinfo and requireinfo.config then + self._FROMKIND = "local" + end +end + +-- get the all configuration values of package +function _instance:configs() + local requireinfo = self:requireinfo() + if requireinfo then + return requireinfo.config + end +end + +-- get the given configuration value of package +function _instance:config(name) + local configs = self:configs() + return configs and configs[name] or nil end -- is optional package? |
