diff options
| author | ruki <[email protected]> | 2023-11-09 23:53:28 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-11-09 23:53:28 +0800 |
| commit | 6fa2d1e158c2d97d9f3f5349874150f06f914cbb (patch) | |
| tree | 5c4dd6d2ca01fae0b1094b8bbee306afd1878f83 /xmake/plugins/pack/xpack.lua | |
| parent | 9e3d1aa3e1445b3d2d63f27b488221461e873b3b (diff) | |
filter formats for xpack
Diffstat (limited to 'xmake/plugins/pack/xpack.lua')
| -rw-r--r-- | xmake/plugins/pack/xpack.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/plugins/pack/xpack.lua b/xmake/plugins/pack/xpack.lua index e74335d82..b22d07a2f 100644 --- a/xmake/plugins/pack/xpack.lua +++ b/xmake/plugins/pack/xpack.lua @@ -194,6 +194,10 @@ function packages() if packages_need then packages_need = hashset.from(packages_need) end + local formats_need = option.get("formats") + if formats_need then + formats_need = formats_need:split(",") + end local xpack_scope = project.scope("xpack") for name, scope in pairs(xpack_scope) do local need = false @@ -206,7 +210,9 @@ function packages() end if need then local instance = _new(name, scope) - packages[name] = instance + if not formats_need or instance:has_format(table.unpack(formats_need)) then + packages[name] = instance + end end end _g.packages = packages |
