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

Allow custom intermediate directory layout in dependir/objectir/targetdir #5278

Closed
xq114 opened this issue Jun 30, 2024 · 2 comments
Closed

Comments

@xq114
Copy link
Contributor

xq114 commented Jun 30, 2024

你在什么场景下需要该功能?

目前xmake生成的中间目录结构统一为plat/arch/mode形式,例如.deps//windows/x64/release/...。目录结构的用途是区分config不让不同config的文件混在一起,然而实际上固定的目录结构并不能达成这一目标(很多时候plat/arch/mode都是定死的,产生区别的是其他config),需要灵活指定中间目录结构。

描述可能的解决方案

增加一个api设置中间目录结构;最好可以在on_config脚本域指定,这样可以实现一些复杂一点的操作,例如根据所有config计算一个hash作为中间目录

描述你认为的候选方案

No response

其他信息

No response

@Issues-translate-bot
Copy link

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


In what scenario do you need this feature?

Currently, the intermediate directory structure generated by xmake is unified in the form of plat/arch/mode, such as .deps//windows/x64/release/.... The purpose of the directory structure is to distinguish configs and prevent files from different configs from mixing together. However, in fact, a fixed directory structure cannot achieve this goal (many times plat/arch/mode are fixed, and the difference is other configs) , need to flexibly specify the intermediate directory structure.

Describe possible solutions

Add an API to set the intermediate directory structure; it is best to specify it in the on_config script field, which can achieve some more complex operations, such as calculating a hash as an intermediate directory based on all configs

Describe your alternatives

No response

other information

No response

@waruqi
Copy link
Member

waruqi commented Jul 1, 2024

加了个 build.intermediate_directory policy,可以禁用生成中间目录。set_policy("build.intermediate_directory", false)

#5283

然后,你直接 set_targetdir/set_objectdir/set_dependir 设置就行了。。但只能在 on_load 里面改,on_config 不行,太滞后

@waruqi waruqi added this to the v2.9.4 milestone Jul 1, 2024
waruqi added a commit that referenced this issue Jul 2, 2024
add build.intermediate_directory policy #5278
@waruqi waruqi closed this as completed Jul 2, 2024
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

3 participants