deplinenoise/tundra — Issue #103: New node gen layer and dependencies across passes build unnecessarily
Author: leidegre
Created: 2012-01-05 09:29:38+00:00
State: open

I have two passes configured in my build as well as a Program that has a dependency on a StaticLibrary which have been assigned a future second pass.

The target Program doesn't have a pass assigned to it, so it's assigned the last, `Default` pass.

Now, what's happening in my situation is that even though I'm not really building the target Program in question, this StaticLibrary is being built even though it doesn't have any use anywhere else.

I don't think I had this problem before. I've been able to reproduce in a simple form (see below).

Also, strange to me, is that if StaticLibrary is assigned pass `A` it's not built by default, but if I give it pass `B` it's built by default (just building `c`).

In my mental model, the StaticLibrary `a` should only be built if target `b` is built, because that's the only target that depends on `a`. Now, if I wanted to build `a` regardless, I would add a `Always "c"` declaration somewhere.

I'm I understanding this right?

Build {
Passes = {
A = { Name="A", BuildOrder = 1 },
B = { Name="B", BuildOrder = 2 },
},
Configs = {
Config {
Name = "generic-gcc",
DefaultOnHost = "linux",
Tools = { "gcc" },
},
Config {
Name = "macosx-gcc",
DefaultOnHost = "macosx",
Tools = { "gcc-osx" },
},
Config {
Name = "win64-msvc",
DefaultOnHost = "windows",
Tools = { "msvc-vs2008"; TargetPlatform = "x64" },
},
},
Units = function()

StaticLibrary {
Name = "a",
Pass = "B",
Sources = { "lib.c" },
}

Program {
Name = "b",
Depends = { "a" },
Sources = { "main.c" },
}

Program {
Name = "c",
Sources = { "main.c" },
}

Default "c"

end,
}