Bug fixes and modernizing of VC 2010 exporter

This commit is contained in:
Jason Perkins 2014-06-12 18:39:39 -04:00
parent 07a4ad897d
commit bd49556345
4 changed files with 260 additions and 260 deletions

View File

@ -65,7 +65,7 @@
defaultTargets = string.format(' DefaultTargets="%s"', target)
end
_p('<Project%s ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">', defaultTargets)
p.push('<Project%s ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">', defaultTargets)
end
@ -237,14 +237,14 @@
function m.itemDefinitionGroup(cfg)
if not vstudio.isMakefile(cfg) then
_p(1,'<ItemDefinitionGroup %s>', m.condition(cfg))
p.push('<ItemDefinitionGroup %s>', m.condition(cfg))
p.callArray(m.elements.itemDefinitionGroup, cfg)
_p(1,'</ItemDefinitionGroup>')
p.pop('</ItemDefinitionGroup>')
else
if cfg == project.getfirstconfig(cfg.project) then
_p(1,'<ItemDefinitionGroup>')
_p(1,'</ItemDefinitionGroup>')
p.w('<ItemDefinitionGroup>')
p.w('</ItemDefinitionGroup>')
end
end
end
@ -294,9 +294,9 @@
end
function m.clCompile(cfg)
_p(2,'<ClCompile>')
p.push('<ClCompile>')
p.callArray(m.elements.clCompile, cfg)
_p(2,'</ClCompile>')
p.pop('</ClCompile>')
end
@ -528,7 +528,7 @@
if #contents > 0 then
p.push('<ClCompile Include=\"%s\">', path.translate(file.relpath))
p.out(contents)
p.outln(contents)
p.pop('</ClCompile>')
else
p.x('<ClCompile Include=\"%s\" />', path.translate(file.relpath))
@ -622,7 +622,7 @@
if #contents > 0 then
p.push('<%s Include=\"%s\">', rule, path.translate(file.relpath))
p.out(contents)
p.outln(contents)
p.pop('</%s>', rule)
else
p.x('<%s Include=\"%s\" />', rule, path.translate(file.relpath))
@ -666,7 +666,7 @@
if #contents > 0 then
p.push('<ResourceCompile Include=\"%s\">', path.translate(file.relpath))
p.out(contents)
p.outln(contents)
p.pop('</ResourceCompile>')
else
p.x('<ResourceCompile Include=\"%s\" />', path.translate(file.relpath))
@ -799,7 +799,7 @@
if #cfg.usingdirs > 0 then
local dirs = project.getrelative(cfg.project, cfg.usingdirs)
dirs = path.translate(table.concat(dirs, ";"))
_x(3,'<AdditionalUsingDirectories>%s;%%(AdditionalUsingDirectories)</AdditionalUsingDirectories>', dirs)
p.x('<AdditionalUsingDirectories>%s;%%(AdditionalUsingDirectories)</AdditionalUsingDirectories>', dirs)
end
end
@ -822,7 +822,7 @@
function m.basicRuntimeChecks(cfg)
if cfg.flags.NoRuntimeChecks then
_p(3,'<BasicRuntimeChecks>Default</BasicRuntimeChecks>')
p.w('<BasicRuntimeChecks>Default</BasicRuntimeChecks>')
end
end
@ -905,7 +905,7 @@
end
end
if value then
_p(3,'<DebugInformationFormat>%s</DebugInformationFormat>', value)
p.w('<DebugInformationFormat>%s</DebugInformationFormat>', value)
end
end
@ -952,23 +952,23 @@
function m.exceptionHandling(cfg)
if cfg.flags.NoExceptions then
_p(3,'<ExceptionHandling>false</ExceptionHandling>')
p.w('<ExceptionHandling>false</ExceptionHandling>')
elseif cfg.flags.SEH then
_p(3,'<ExceptionHandling>Async</ExceptionHandling>')
p.w('<ExceptionHandling>Async</ExceptionHandling>')
end
end
function m.excludedFromBuild(cfg, filecfg)
if not filecfg or filecfg.flags.ExcludeFromBuild then
p.w('<ExcludedFromBuild %s>true</ExcludedFromBuild>', m.condition(cfg))
m.element("ExcludedFromBuild", m.condition(cfg), "true")
end
end
function m.floatingPointModel(cfg)
if cfg.floatingpoint then
_p(3,'<FloatingPointModel>%s</FloatingPointModel>', cfg.floatingpoint)
p.w('<FloatingPointModel>%s</FloatingPointModel>', cfg.floatingpoint)
end
end
@ -980,14 +980,14 @@
end
if #cfg.forceusings > 0 then
local usings = path.translate(project.getrelative(cfg.project, cfg.forceusings))
_x(3,'<ForcedUsingFiles>%s</ForcedUsingFiles>', table.concat(usings, ';'))
m.element("ForcedUsingFiles", condition, table.concat(usings, ';'))
end
end
function m.functionLevelLinking(cfg)
if config.isOptimizedBuild(cfg) then
_p(3,'<FunctionLevelLinking>true</FunctionLevelLinking>')
p.w('<FunctionLevelLinking>true</FunctionLevelLinking>')
end
end
@ -1079,7 +1079,7 @@
function m.intrinsicFunctions(cfg)
if config.isOptimizedBuild(cfg) then
_p(3,'<IntrinsicFunctions>true</IntrinsicFunctions>')
p.w('<IntrinsicFunctions>true</IntrinsicFunctions>')
end
end
@ -1142,7 +1142,7 @@
cfg.flags.MultiProcessorCompile or
cfg.debugformat == premake.C7
then
_p(3,'<MinimalRebuild>false</MinimalRebuild>')
p.w('<MinimalRebuild>false</MinimalRebuild>')
end
end
@ -1157,7 +1157,7 @@
function m.multiProcessorCompilation(cfg)
if cfg.flags.MultiProcessorCompile then
_p(3,'<MultiProcessorCompilation>true</MultiProcessorCompilation>')
p.w('<MultiProcessorCompilation>true</MultiProcessorCompilation>')
end
end
@ -1193,7 +1193,7 @@
function m.omitDefaultLib(cfg)
if cfg.flags.OmitDefaultLibrary then
_p(3,'<OmitDefaultLibName>true</OmitDefaultLibName>')
p.w('<OmitDefaultLibName>true</OmitDefaultLibName>')
end
end
@ -1201,7 +1201,7 @@
function m.omitFramePointers(cfg)
if cfg.flags.NoFramePointer then
_p(3,'<OmitFramePointers>true</OmitFramePointers>')
p.w('<OmitFramePointers>true</OmitFramePointers>')
end
end
@ -1245,10 +1245,10 @@
end
else
if not cfg.flags.NoPCH and cfg.pchheader then
_p(3,'<PrecompiledHeader>Use</PrecompiledHeader>')
_x(3,'<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>', cfg.pchheader)
p.w('<PrecompiledHeader>Use</PrecompiledHeader>')
p.x('<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>', cfg.pchheader)
else
_p(3,'<PrecompiledHeader>NotUsing</PrecompiledHeader>')
p.w('<PrecompiledHeader>NotUsing</PrecompiledHeader>')
end
end
end
@ -1269,7 +1269,7 @@
function m.programDataBaseFileName(cfg)
if cfg.flags.Symbols and cfg.debugformat ~= "c7" then
local filename = cfg.buildtarget.basename
_p(3,'<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>', filename)
p.w('<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>', filename)
end
end
@ -1334,7 +1334,7 @@
}
local runtime = runtimes[config.getruntime(cfg)]
if runtime then
_p(3,'<RuntimeLibrary>%s</RuntimeLibrary>', runtime)
p.w('<RuntimeLibrary>%s</RuntimeLibrary>', runtime)
end
end
@ -1348,13 +1348,13 @@
function m.bufferSecurityCheck(cfg)
if cfg.flags.NoBufferSecurityCheck then
_p(3,'<BufferSecurityCheck>false</BufferSecurityCheck>')
p.w('<BufferSecurityCheck>false</BufferSecurityCheck>')
end
end
function m.stringPooling(cfg)
if config.isOptimizedBuild(cfg) then
_p(3,'<StringPooling>true</StringPooling>')
p.w('<StringPooling>true</StringPooling>')
end
end
@ -1395,14 +1395,14 @@
local map = { On = "true", Off = "false" }
local value = map[cfg.nativewchar]
if value then
_p(3,'<TreatWChar_tAsBuiltInType>%s</TreatWChar_tAsBuiltInType>', value)
p.w('<TreatWChar_tAsBuiltInType>%s</TreatWChar_tAsBuiltInType>', value)
end
end
function m.treatWarningAsError(cfg)
if cfg.flags.FatalLinkWarnings and cfg.warnings ~= "Off" then
_p(3,'<TreatWarningAsError>true</TreatWarningAsError>')
p.w('<TreatWarningAsError>true</TreatWarningAsError>')
end
end

View File

@ -73,7 +73,7 @@
if #contents > 0 then
p.push('<ItemGroup>')
p.out(contents)
p.outln(contents)
p.pop('</ItemGroup>')
end
end

View File

@ -32,11 +32,11 @@
function suite.defaultSettings()
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
</ClCompile>
</ClCompile>
]]
end
@ -53,7 +53,7 @@
pchheader "include/afxwin.h"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>include/afxwin.h</PrecompiledHeaderFile>
]]
@ -69,7 +69,7 @@
flags "NoPCH"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
]]
end
@ -83,7 +83,7 @@
warnings "Extra"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
]]
@ -97,7 +97,7 @@
warnings "Off"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
]]
@ -113,7 +113,7 @@
warnings "Off"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
]]
@ -127,7 +127,7 @@
optimize "On"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Full</Optimization>
@ -142,7 +142,7 @@
optimize "Size"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MinSpace</Optimization>
@ -157,7 +157,7 @@
optimize "Speed"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
@ -172,7 +172,7 @@
optimize "Full"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Full</Optimization>
@ -187,11 +187,11 @@
optimize "Off"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
</ClCompile>
</ClCompile>
]]
end
@ -199,11 +199,11 @@
optimize "Debug"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
</ClCompile>
</ClCompile>
]]
end
@ -211,7 +211,7 @@
flags "NoFramePointer"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -228,7 +228,7 @@
defines { "DEBUG", "_DEBUG" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>DEBUG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -244,7 +244,7 @@
buildoptions { "/xyz", "/abc" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -261,7 +261,7 @@
includedirs { "include/lua", "include/zlib" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>include\lua;include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -277,7 +277,7 @@
usingdirs { "include/lua", "include/zlib" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<AdditionalUsingDirectories>include\lua;include\zlib;%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@ -292,7 +292,7 @@
flags "NoMinimalRebuild"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -308,7 +308,7 @@
debugformat "C7"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -325,7 +325,7 @@
flags { "StaticRuntime" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -337,7 +337,7 @@
flags { "StaticRuntime", "Symbols" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
@ -356,7 +356,7 @@
flags { "FatalWarnings" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
@ -372,13 +372,13 @@
flags "Symbols"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<ProgramDataBaseFileName>$(OutDir)MyProject.pdb</ProgramDataBaseFileName>
<Optimization>Disabled</Optimization>
</ClCompile>
</ClCompile>
]]
end
@ -392,7 +392,7 @@
debugformat "c7"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
@ -409,7 +409,7 @@
vectorextensions "SSE"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -421,7 +421,7 @@
vectorextensions "SSE2"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -433,7 +433,7 @@
flags "FloatFast"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -445,7 +445,7 @@
flags "FloatStrict"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -462,7 +462,7 @@
flags "NativeWChar"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -474,7 +474,7 @@
flags "NoNativeWChar"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -491,7 +491,7 @@
flags "NoExceptions"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -503,7 +503,7 @@
flags "SEH"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -515,7 +515,7 @@
flags "NoRTTI"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -527,7 +527,7 @@
flags "NoBufferSecurityCheck"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -545,7 +545,7 @@
architecture "x32"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
@ -562,7 +562,7 @@
architecture "x64"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -578,7 +578,7 @@
flags { "Symbols", "NoEditAndContinue" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -595,7 +595,7 @@
optimize "On"
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -611,7 +611,7 @@
flags { "Symbols", "Managed" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -627,7 +627,7 @@
forceincludes { "stdafx.h", "include/sys.h" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<ForcedIncludeFiles>stdafx.h;include\sys.h</ForcedIncludeFiles>
@ -638,7 +638,7 @@
forceusings { "stdafx.h", "include/sys.h" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<ForcedUsingFiles>stdafx.h;include\sys.h</ForcedUsingFiles>
@ -654,7 +654,7 @@
flags { "NoRuntimeChecks" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
@ -670,7 +670,7 @@
flags { "MultiProcessorCompile" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
@ -690,7 +690,7 @@
flags { "Symbols", "ReleaseRuntime", "StaticRuntime" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
@ -709,7 +709,7 @@
flags { "OmitDefaultLibrary" }
prepare()
test.capture [[
<ClCompile>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>

View File

@ -32,7 +32,7 @@
function suite.structureIsCorrect_onDefaultValues()
prepare()
test.capture [[
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
]]
end
@ -45,8 +45,8 @@
kind "Makefile"
prepare()
test.capture [[
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
]]
end
@ -54,8 +54,8 @@
kind "Makefile"
prepare()
test.capture [[
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
]]
end