Add newline to empty <TargetExt> elements in VC 2010 C++ projects

This commit is contained in:
Jason Perkins 2013-05-22 09:06:33 -04:00
parent b42abdb37c
commit d1cb894b73
2 changed files with 27 additions and 1 deletions

View File

@ -1048,7 +1048,13 @@
function vc2010.targetExt(cfg)
_x(2,'<TargetExt>%s</TargetExt>', cfg.buildtarget.extension)
local ext = cfg.buildtarget.extension
if ext ~= "" then
_x(2,'<TargetExt>%s</TargetExt>', ext)
else
_p(2,'<TargetExt>')
_p(2,'</TargetExt>')
end
end

View File

@ -193,3 +193,23 @@
<GenerateManifest>false</GenerateManifest>
]]
end
---
-- The <TargetExt> should be split if there is no extension.
---
function suite.splitTargetExt_onNoTargetExtension()
targetextension ""
prepare()
test.capture [[
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>.\</OutDir>
<IntDir>obj\Debug\</IntDir>
<TargetName>MyProject</TargetName>
<TargetExt>
</TargetExt>
</PropertyGroup>
]]
end