Merge pull request #969 from Blizzard/fix-buildoutput-pathvars

Fix buildoutput pathvars
This commit is contained in:
Tom van Dijck 2017-12-07 08:16:08 -08:00 committed by GitHub
commit 056e539f4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 8 deletions

View File

@ -42,7 +42,7 @@
<CustomBuild Include="..\hello.cg">
<FileType>Document</FileType>
<Command>cgc %(Identity)</Command>
<Outputs>../%(Filename).a;../%(Filename).b</Outputs>
<Outputs>../hello.a;../hello.b</Outputs>
</CustomBuild>
</ItemGroup>
]]
@ -61,7 +61,7 @@
<CustomBuild Include="..\hello.cg">
<FileType>Document</FileType>
<Command>cgc %(Identity)</Command>
<Outputs>../%(Filename).obj</Outputs>
<Outputs>../hello.obj</Outputs>
<Message>Compiling shader %(Identity)</Message>
</CustomBuild>
</ItemGroup>
@ -81,7 +81,7 @@
<CustomBuild Include="..\hello.cg">
<FileType>Document</FileType>
<Command>cgc %(Identity)</Command>
<Outputs>../%(Filename).obj</Outputs>
<Outputs>../hello.obj</Outputs>
<AdditionalInputs>../common.cg.inc;../common.cg.inc2</AdditionalInputs>
</CustomBuild>
</ItemGroup>

View File

@ -60,7 +60,7 @@
function m.computedProperties(r)
-- create shadow context.
local pathVars = p.rule.createPathVars(r, "%%(%s)")
local ctx = p.context.extent(r, { pathVars = pathVars })
local ctx = p.context.extent(r, { pathVars = pathVars, overridePathVars = true })
-- now use the shadow context to detoken.
local buildoutputs = ctx.buildoutputs
@ -302,7 +302,7 @@
function m.linkLib(r)
-- create shadow context.
local pathVars = p.rule.createPathVars(r, "%%(%s)")
local ctx = p.context.extent(r, { pathVars = pathVars })
local ctx = p.context.extent(r, { pathVars = pathVars, overridePathVars=true })
-- now use the shadow context to detoken.
local buildoutputs = ctx.buildoutputs

View File

@ -122,7 +122,7 @@
scope = { "config", "rule" },
kind = "list:path",
tokens = true,
pathVars = true,
pathVars = false,
}
api.register {
@ -130,7 +130,7 @@
scope = "config",
kind = "list:path",
tokens = true,
pathVars = true,
pathVars = false,
}
api.register {

View File

@ -34,12 +34,13 @@
function expandtoken(token, e, f)
-- fetch the path variable from the action, if needed
local varMap = {}
if f.pathVars then
if f.pathVars or e.overridePathVars then
local action = p.action.current()
if action then
varMap = action.pathVars or {}
end
end
-- fetch the pathVars from the enviroment.
local envMap = e.pathVars or {}