added support for custom build message in vs201x generator

This commit is contained in:
dcourtois 2013-09-03 13:16:08 +02:00
parent bb18026fcc
commit 4c867e2f1d
2 changed files with 27 additions and 0 deletions

View File

@ -494,6 +494,10 @@
local outputs = project.getrelative(prj, filecfg.buildoutputs)
vc2010.element(3, "Outputs", condition, '%s', table.concat(outputs, " "))
if filecfg.buildmessage then
_p(3,'<Message %s>%s</Message>', condition, premake.esc(filecfg.buildmessage))
end
end
end

View File

@ -88,6 +88,29 @@
end
function suite.customBuild_onBuildRuleWithMessage()
files { "hello.cg" }
configuration "**.cg"
buildmessage "Compiling shader $(InputFile)"
buildcommands { "cgc $(InputFile)" }
buildoutputs { "$(InputName).obj" }
prepare()
test.capture [[
<ItemGroup>
<CustomBuild Include="hello.cg">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">cgc $(InputFile)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(InputName).obj</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compiling shader $(InputFile)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">cgc $(InputFile)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(InputName).obj</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compiling shader $(InputFile)</Message>
</CustomBuild>
</ItemGroup>
]]
end
--
-- If a PCH source is specified, ensure it is included in the file configuration.
--