xmake icon indicating copy to clipboard operation
xmake copied to clipboard

add_requires 顺序导致 package 无法引入

Open TOMO-CAT opened this issue 1 year ago • 3 comments

Xmake 版本

2.8.5+20231124

操作系统版本和架构

Ubuntu 20.04.5 LTS

描述问题

如果我调转 add_requires() 的顺序,target:add_packages 就会找不到依赖。 1875504d82a6ded43cec3c72d2e551d7 7e7eddc39d7e21c961c61637d006bd68

因为 zgpu 本身依赖了 zproto,我怀疑是我的依赖(zgpu)已经引用了(zproto),所以当前项目就没必要再引用间接依赖了,能强制设置成直接依赖吗,因为我需要它的 proto 文件编译代码

期待的结果

因为我依赖成品库的一些 conf 和 proto 文件,所以必须要拿到 target:pkg("zproto") 的属性。

工程配置

附加信息和错误日志

src-zproto: image src-zgpu: image

TOMO-CAT avatar Feb 07 '24 07:02 TOMO-CAT

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


Title: add_requires order causes package to fail to be introduced

Xmake version

2.8.5+20231124

Operating system version and architecture

Ubuntu 20.04.5 LTS

Describe the problem

If I reverse the order of add_requires(), target:add_packages won't find the dependency. 1875504d82a6ded43cec3c72d2e551d7 7e7eddc39d7e21c961c61637d006bd68

Because zgpu itself depends on zproto, I suspect that my dependency (zgpu) has already referenced (zproto), so there is no need for the current project to reference indirect dependencies. Can it be forced to be a direct dependency, because I need its proto file Compile code

Expected results

Because I rely on some conf and proto files of the finished library, I must get the attributes of target:pkg("zproto").

Project configuration

none

Additional information and error logs

src-zproto: image src-zgpu: image

Issues-translate-bot avatar Feb 07 '24 07:02 Issues-translate-bot

给个完整可复现的 example

waruqi avatar Feb 07 '24 07:02 waruqi

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


Give a complete and reproducible example

Issues-translate-bot avatar Feb 07 '24 07:02 Issues-translate-bot