-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dub + Ninja: Phony targets don't work properly #128
Comments
After quite a bit of wrangling, I got it to do what I wanted: import reggae;
alias buildTarget = dubDefaultTarget!(); // dub build
alias testTarget = dubTestTarget!(); // dub test (=> ut[.exe])
Target aliasTarget(string aliasName, alias target)()
{
import std.algorithm: map;
// Using leaf targets `$builddir/<raw output>` as dependencies
// yields the expected relative target names for Ninja/make.
return Target.phony(aliasName, "", Target(target.rawOutputs.map!(o => "$builddir/" ~ o), ""));
}
// Add a `default` convenience alias for the `dub build` target.
// Especially useful for Ninja (`ninja default ut` to build default & test targets in parallel).
alias defaultTarget = aliasTarget!("default", buildTarget);
version (Windows) {
// Windows: extra `ut` convenience alias for `ut.exe`
alias utTarget = aliasTarget!("ut", testTarget);
mixin build!(buildTarget, optional!testTarget, optional!defaultTarget, optional!utTarget);
} else {
mixin build!(buildTarget, optional!testTarget, optional!defaultTarget);
} =>
I think this is more or less how the default |
I dunno - the fact that Windows has an extra |
I'm thinking about automation, where such platform differences are always a PITA. To be precise, I was wondering how we build the Symmetry SIL stuff, noted the explicit If you agree, I'll open a PR to make this the default. |
Ugh, Windows. You're right, of course. |
For some little dub test project, the following
reggaefile.d
:yields the following (fine)
build.ninja
:With a more advanced
reggaefile.d
:I was expecting the following additions/changes on Windows:
But alas, this is what's generated:
The text was updated successfully, but these errors were encountered: