ninja-build/ninja

Make `target^` a first-class citizen

开放

#2,382 创建于 2024年2月11日

 (0 条评论) (1 个反应) (0 位负责人)C++ (1,544 个派生)batch import
help wanted

仓库指标

星标
 (10,194 个星标)
PR 合并指标
 (平均合并 39天 3小时) (30 天内合并 10 个 PR)

描述

From the manual:

There is also a special syntax target^ for specifying a target as the first output of some rule containing the source you put in the command line, if one exists. For example, if you specify target as foo.c^ then foo.o will get built (assuming you have those targets in your build files).

Can you please make these special foo.c^ targets behave as regular targets in all ninja commands by simply "dereferencing" them first? For example, while building foo.c^ works, this breaks:

$ ninja -t clean foo.c^
Cleaning...
ninja: error: unknown target 'foo.c^'
0 files.

贡献者指南