xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
9.87k stars 776 forks source link

Improve the default installation policy #5325

Closed waruqi closed 2 months ago

waruqi commented 2 months ago

Is your feature request related to a problem? Please describe.

The current logic for installing a target and its dependencies is confusing and inflexible.

We need to add an installation policy that gives users the flexibility to configure the installation themselves.

set_policy("install.targetdeps", true)
set_policy("install.targetdeps.runonly", true) -- default
set_policy("install.targetdeps.all", true)

For example:

app (binary) -> foo (shared) -> bar (static)
xmake install app

Only install the current target without deps

set_policy("install.targetdeps", false)

Only install runonly target files (default)

set_policy("install.targetdeps.runonly", true) -- default

We just install the binary that can be run, and all the dynamic libraries needed to ensure that the binary can be run.

Install target and it's all dep files

set_policy("install.targetdeps.all", true)

Enable or disable to install package files

set_policy("install.targetpkgs", true) -- default
set_policy("install.targetpkgs", false)

It is also equivalent to xmake install --nopkgs app

https://github.com/xmake-io/xmake/issues/5308