added support for buildinputs in vs200x generators

This commit is contained in:
Damien Courtois 2014-09-25 11:00:17 +02:00
parent 4e7dc976ba
commit 39725134b7
2 changed files with 34 additions and 0 deletions

View File

@ -1034,6 +1034,11 @@
local outputs = project.getrelative(filecfg.project, filecfg.buildoutputs)
p.x('Outputs="%s"', table.concat(outputs, ' '))
if filecfg.buildinputs and #filecfg.buildinputs > 0 then
local inputs = project.getrelative(filecfg.project, filecfg.buildinputs)
p.x('AdditionalDependencies="%s"', table.concat(inputs, ';'))
end
end
end

View File

@ -375,6 +375,35 @@
]]
end
function suite.customBuildTool_onBuildRuleWithAdditionalInputs()
files { "hello.x" }
filter "files:**.x"
buildmessage "Compiling $(InputFile)"
buildcommands {
'cxc -c "$(InputFile)" -o "$(IntDir)/$(InputName).xo"',
'c2o -c "$(IntDir)/$(InputName).xo" -o "$(IntDir)/$(InputName).obj"'
}
buildoutputs { "$(IntDir)/$(InputName).obj" }
buildinputs { "common.x.inc" }
prepare()
test.capture [[
<Files>
<File
RelativePath="hello.x"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="cxc -c &quot;$(InputFile)&quot; -o &quot;$(IntDir)/$(InputName).xo&quot;&#x0D;&#x0A;c2o -c &quot;$(IntDir)/$(InputName).xo&quot; -o &quot;$(IntDir)/$(InputName).obj&quot;"
Outputs="$(IntDir)/$(InputName).obj"
AdditionalDependencies="common.x.inc"
/>
</FileConfiguration>
]]
end
--
-- If two files at different folder levels have the same name, a different