diff options
| author | ruki <[email protected]> | 2018-09-12 22:50:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-09-12 11:03:55 +0800 |
| commit | 0a8a275f8cb9a51446746f796031882dfc8381ae (patch) | |
| tree | 4aa0f38d8fcf31804f16e313a144ba430e88e302 /xmake/core/package/package.lua | |
| parent | 6638fb5f62e95b465305914953e38233d49a8856 (diff) | |
check unsupported packages
Diffstat (limited to 'xmake/core/package/package.lua')
| -rw-r--r-- | xmake/core/package/package.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 8c54c941b..5888bff80 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -246,6 +246,18 @@ function _instance:requireinfo_set(requireinfo) self._REQUIREINFO = requireinfo end +-- is optional package? +function _instance:optional() + local requireinfo = self:requireinfo() + return requireinfo and requireinfo.optional or false +end + +-- is supported package? +function _instance:supported() + -- attempt to get the build script with the current plat/arch + return self:script("build") ~= nil +end + -- get xxx_script function _instance:script(name, generic) |
