in some contexts we need pathVars regardless of whether the property allows it or not.

This commit is contained in:
Tom van Dijck 2017-12-04 12:05:16 -08:00
parent e7ace9249c
commit 0a79816d28
3 changed files with 7 additions and 6 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

@ -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 {}