evmar / n2

n2 ("into"), a ninja compatible build system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build all targets by default

kvark opened this issue · comments

Running n2 on a project that currently uses ninja, I get:

n2: error: no path specified and no default

I think ninja just builds all targets if it doesn't see a default?

You are correct about ninja's behavior here. This is easy enough to change in the code, but it also was kinda intentional in that I think ninja's behavior is possibly not a good default.

If you wanted to change this yourself, it's around here:

n2/src/run.rs

Lines 67 to 71 in 6b4fb1a

for target in state.default {
work.want_fileid(target)?;
}
} else {
anyhow::bail!("no path specified and no default");

you'd need to want_fileid for all fileids in the graph.

I was under impression that n2 tries to be compatible with ninja, at least under a mode. Is this not a goal?

Compatible in the sense of being able to load the files, but the UI and behavior isn't otherwise necessarily the same.