ninja-build/ninja

Make `target^` a first-class citizen

Open

#2.382 geöffnet am 11. Feb. 2024

Auf GitHub ansehen
 (0 Kommentare) (1 Reaktion) (0 zugewiesene Personen)C++ (1.544 Forks)batch import
featurehelp wanted

Repository-Metriken

Stars
 (10.194 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 39T 3h) (10 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide