Add binonly option for target install#6669
Add binonly option for target install#6669star-hengxing wants to merge 2 commits intoxmake-io:devfrom
Conversation
|
这个有啥用 |
What's the use of this |
|
I have a game compiled with xmake that I want to distribute, as it's a game I only need to install its binaries. |
Why do not remove add_headerfiles for this target? |
Because they're useful for vs/vsxmake project generation. Also my game has libraries (it has multiple executables) and I don't need them to be installed. Project for reference: https://github.com/DigitalPulseSoftware/ThisSpaceOfMine |
|
|
We should use policy instead of adding new
|
|
A policy requires a full reconfiguration of the project where the xmake install command can just skip folders, I'm not sure it's more interesting. Also because in some cases you may be interested in the binaries and in other you may want the headers/libs as well for the same project, for example if python/curl/openssl/etc. were to use xmake it could be interesting to be able to only get the binaries in some cases and the binaries/include/libs in other. |
|
We need to consider more extensibility, otherwise there will be --libonly, --headeronly in the future. |
|
what about |
you should use
Just for personal preference, I don't like using too many Currently, install already has a It would be much better if a single option could be used to handle them, like |
This is not a solution, as it wouldn't prevent libraries generation (that would still be installed) and is mostly a hack, some rules (even user-defined) may differentiate headers and extra files. It also doesn't fix the issue of libraries with standalone binaries where you may want only binaries in some cases and headers in other.
--without-headers and --without-libs options allows for composition which is more flexible than --only-bins or equivalent, it's also possible to make an --install=bins,libs,includes filter like option. I don't think we should use policies for this kind of problem as it's independent of project configuration, you may want to install only binaries or everything for the same project, changing policies isn't straighforward in commandline (it's not easy to enable as you have to list every other policy as well) and requires a full config step. |
I don't like the or we can use if we want to only install binaries, you can pass xmake install --headers=nxmake install --headers=[y/n] --binaries=[y/n] --libraries=[y/n] |
|
try this patch. #6688 |
#6650