summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-06-30 23:54:25 +0800
committerruki <[email protected]>2021-06-30 23:54:25 +0800
commit97472156ae23c3c2c29d251e966b6f3f6077332a (patch)
tree321e58d70de5a08ba3064c035dcbb6c2ca4cc34d
parentb2388d3d3b1476a9a76bb7f9b76d1a7016005883 (diff)
improve optional package
-rw-r--r--xmake/modules/private/action/require/impl/package.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua
index 490c357c2..eb94c8c18 100644
--- a/xmake/modules/private/action/require/impl/package.lua
+++ b/xmake/modules/private/action/require/impl/package.lua
@@ -783,7 +783,12 @@ function should_install(package)
--
-- @see https://github.com/xmake-io/xmake/issues/1460
--
- if parent:exists() and _must_depend_on(parent, package) then
+ if parent:exists() and not option.get("force") and _must_depend_on(parent, package) then
+ -- mark this package as non-optional because parent package need it
+ local requireinfo = package:requireinfo()
+ if requireinfo.optional then
+ requireinfo.optional = nil
+ end
return true
end
end