Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install options to discard some files #3460

Open
maximegmd opened this issue Mar 5, 2023 · 10 comments
Open

Install options to discard some files #3460

maximegmd opened this issue Mar 5, 2023 · 10 comments

Comments

@maximegmd
Copy link

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

I have a pretty large project, and everytime I run xmake install it takes a very long time because it copies all the include files (60k files) that are not needed.

Describe the solution you'd like

Options for xmake install to discard includes/libs/bins.

Describe alternatives you've considered

No response

Additional context

No response

@waruqi
Copy link
Member

waruqi commented Mar 6, 2023

add_headerfiles("include/**.h|exclude/*.h")

use ...|exclude pattern to set exclude pattern. and add_installfiles support it too.

or

remove_headerfiles

@SirLynix
Copy link
Member

SirLynix commented Mar 6, 2023

sometimes you just want to install (or just update) binaries, for example with android development headers are installed (even though I just want the binaries).

Also headerfiles are used for project generations

@waruqi
Copy link
Member

waruqi commented Mar 6, 2023

sometimes you just want to install (or just update) binaries, for example with android development headers are installed (even though I just want the binaries).

Also headerfiles are used for project generations

add_headerfiles("", {install = false})

@SirLynix
Copy link
Member

SirLynix commented Mar 6, 2023

yes the point is sometimes you want to have headers, sometimes you don't, and it does not depends on the project configuration (xmake.lua) but on what you want to do.

For example, I sometimes install my project in a folder in order to have the binaries and their dependencies so I can ship them. but sometimes I want to install it system-wide, the very same project.

So I agree here it would be nice to have a way to install only binaries at least

@waruqi
Copy link
Member

waruqi commented Mar 6, 2023

sometimes you just want to install (or just update) binaries, for example with android development headers are installed (even though I just want the binaries).
Also headerfiles are used for project generations

add_headerfiles("", {install = false})

sometimes you just want to install (or just update) binaries, for example with android development headers are installed (even though I just want the binaries).

Also headerfiles are used for project generations

option("xxx")
add_headerfiles("", {install = get_config("xxx")})
xmake f --xxx=y
xmake install

@SirLynix
Copy link
Member

SirLynix commented Mar 6, 2023

I already pointed out the main issue with xmake config (xmake f), it's that you have to set all of your configurations because xmake doesn't support incremental config.

so you'd have to remember to do xmake f --tests=y --usepch=y --assimp=y --ffmpeg=y --embed_plugins=y --install_headers=n, not very practical.

Also, xmake install also copies lib files (such as .lib and more), you can't disable these.

A simple xmake install --bin to only copy the bin folder on Windows or .so/.dynlib on others would be a nice addition imo.

@waruqi
Copy link
Member

waruqi commented Mar 6, 2023

I already pointed out the main issue with xmake config (xmake f), it's that you have to set all of your configurations because xmake doesn't support incremental config.

so you'd have to remember to do , not very practical.xmake f --tests=y --usepch=y --assimp=y --ffmpeg=y --embed_plugins=y --install_headers=n

Also, xmake install also copies lib files (such as .lib and more), you can't disable these.

A simple to only copy the bin folder on Windows or .so/.dynlib on others would be a nice addition imo.xmake install --bin

you can add on_install to do it.

@SirLynix
Copy link
Member

SirLynix commented Mar 6, 2023

I'm not talking about just copying the final binary produced by a target but also all of its dependencies, something xmake install already does and is not easy to reimplement.

@Wzshun
Copy link

Wzshun commented Sep 3, 2023

我也同样希望有一个选项,可以仅安装二进制文件,而不是部署库模式。
虽然可以通过每个库去设置add_headerfiles("", {install = false}),去移除不必要的头文件,但在大工程里,每个库都要去这样设置显然是有点多余。此外lib文件夹的部署,似乎没有选项去控制。

所以还是希望形如xmake install --bin,这样的入参,仅部署可执行文件和其依赖的库。

此外,还希望xmake能够支持增量式拷贝。如windows的robocopylinux的rsync,在部分工程可能需要拷贝多个大资源时,部署需要花费不少时间。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


I would also like to have an option to just install the binaries instead of deploying the library mode.
Although you can set add_headerfiles("", {install = false}) through each library to remove unnecessary header files, but in a large project, it is obviously redundant to set this way for each library. In addition, there seems to be no option to control the deployment of the lib folder.

Therefore, it is still hoped that the input parameters such as xmake install --bin will only deploy the executable file and the libraries it depends on.

In addition, it is also hoped that xmake can support incremental copying. Such as windows' robocopy and linux's rsync, when some projects may need to copy multiple large resources, the deployment will take a lot of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants