ninja-build/ninja

Make `target^` a first-class citizen

Open

#2382 aperta il 11 feb 2024

Vedi su GitHub
 (0 commenti) (1 reazione) (0 assegnatari)C++ (1544 fork)batch import
featurehelp wanted

Metriche repository

Star
 (10.194 star)
Metriche merge PR
 (Merge medio 39g 3h) (10 PR mergiate in 30 g)

Descrizione

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.

Guida contributor