diff options
author | Oliver Schneider <oliver@assarbad.net> | 2017-04-11 23:05:29 +0300 |
---|---|---|
committer | Oliver Schneider <oliver@assarbad.net> | 2017-04-11 23:05:29 +0300 |
commit | 199dfb07ada3f9ff3b99d768c62eb11e70fed78a (patch) | |
tree | dfa43111e784b5fc59d808c5df1ed5fd15c272a7 | |
parent | 1f182f0e5d98809aec9146af76838db91b539bc4 (diff) |
This should fix an issue where VS2008 and earlier got the proper CompileAs property
on individual files, but VS2010 and newer did not. This introduces the two new
overridable functions
1. premake.vstudio.vc2010.individualSourceFile
2. premake.vstudio.vc200x.individualSourceFile
These can also be used as sentinel for this particular patch to decide if you
need to patch via your premake4.lua or not.
The patch to premake4.lua shows how older premake4 versions can be taught to
behave like this patched version without having the patched version ... just by
modifying the premake4.lua. Beautiful demo of the power of Lua inside Premake4.
--HG--
branch : WDS-build
-rw-r--r-- | premake4.lua | 161 | ||||
-rw-r--r-- | src/actions/vstudio/vs200x_vcproj.lua | 86 | ||||
-rw-r--r-- | src/actions/vstudio/vs2010_vcxproj.lua | 25 | ||||
-rw-r--r-- | src/host/scripts.c | 59 |
4 files changed, 245 insertions, 86 deletions
diff --git a/premake4.lua b/premake4.lua index 836ac1e..62c9a3d 100644 --- a/premake4.lua +++ b/premake4.lua @@ -1,19 +1,19 @@ --[[ - This premake4.lua _requires_ windirstat/premake-stable to work properly. - If you don't want to use the code-signed build that can be found in the - download section of that project, you can build from the WDS-branch at: + This premake4.lua _requires_ windirstat/premake-stable to work properly. + If you don't want to use the code-signed build that can be found in the + download section of that project, you can build from the WDS-branch at: - https://bitbucket.org/windirstat/premake-stable + https://bitbucket.org/windirstat/premake-stable --]] local action = _ACTION or "" if _OPTIONS["publish"] then - print "INFO: Creating 'Publish' build solution." - publish = true + print "INFO: Creating 'Publish' build solution." + publish = true end do -- This is mainly to support older premake4 builds if not premake.project.getbasename then - print "Magic happens ..." + print "Magic happens for old premake4 versions without premake.project.getbasename() ..." -- override the function to establish the behavior we'd get after patching Premake to have premake.project.getbasename premake.project.getbasename = function(prjname, pattern) return pattern:gsub("%%%%", prjname) @@ -38,6 +38,127 @@ do return path.getrelative(os.getcwd(), fname) end end + -- This is mainly to support older premake4 in which CompileAs did not work + -- for VS2010 and newer + if not premake.vstudio.vc2010.individualSourceFile or not premake.vstudio.vc200x.individualSourceFile then + local vc2010 = premake.vstudio.vc2010 + local vc200x = premake.vstudio.vc200x + local tree = premake.tree + print "Magic happens for old premake4 versions faulty CompileAs handling for VS2010 and newer ..." + -- A boilerplate implementation + vc200x.individualSourceFile = function(prj, depth, fname) + -- handle file configuration stuff. This needs to be cleaned up and simplified. + -- configurations are cached, so this isn't as bad as it looks + for _, cfginfo in ipairs(prj.solution.vstudio_configs) do + if cfginfo.isreal then + local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) + + local usePCH = (not prj.flags.NoPCH and prj.pchsource == node.cfg.name) + local isSourceCode = path.iscppfile(fname) + local needsCompileAs = (path.iscfile(fname) ~= premake.project.iscproject(prj)) + + if usePCH or (isSourceCode and needsCompileAs) then + _p(depth, '<FileConfiguration') + _p(depth, '\tName="%s"', cfginfo.name) + _p(depth, '\t>') + _p(depth, '\t<Tool') + _p(depth, '\t\tName="%s"', iif(cfg.system == "Xbox360", + "VCCLX360CompilerTool", + "VCCLCompilerTool")) + if needsCompileAs then + _p(depth, '\t\tCompileAs="%s"', iif(path.iscfile(fname), 1, 2)) + end + + if usePCH then + if cfg.system == "PS3" then + local options = table.join(premake.snc.getcflags(cfg), + premake.snc.getcxxflags(cfg), + cfg.buildoptions) + options = table.concat(options, " "); + options = options .. ' --create_pch="$(IntDir)/$(TargetName).pch"' + _p(depth, '\t\tAdditionalOptions="%s"', premake.esc(options)) + else + _p(depth, '\t\tUsePrecompiledHeader="1"') + end + end + + _p(depth, '\t/>') + _p(depth, '</FileConfiguration>') + end + + end + end + end + vc200x.Files = function(prj) + local tr = premake.project.buildsourcetree(prj) + + tree.traverse(tr, { + -- folders are handled at the internal nodes + onbranchenter = function(node, depth) + _p(depth, '<Filter') + _p(depth, '\tName="%s"', node.name) + _p(depth, '\tFilter=""') + _p(depth, '\t>') + end, + + onbranchexit = function(node, depth) + _p(depth, '</Filter>') + end, + + -- source files are handled at the leaves + onleaf = function(node, depth) + local fname = node.cfg.name + + _p(depth, '<File') + _p(depth, '\tRelativePath="%s"', path.translate(fname, "\\")) + _p(depth, '\t>') + depth = depth + 1 + + vc200x.individualSourceFile(prj, depth, fname) + + depth = depth - 1 + _p(depth, '</File>') + end, + }, false, 2) + + end + -- A boilerplate implementation + vc2010.individualSourceFile = function(prj, config_mappings, file) + local configs = prj.solution.vstudio_configs + local translatedpath = path.translate(file.name, "\\") + _p(2,'<ClCompile Include=\"%s\">', translatedpath) + for _, cfginfo in ipairs(configs) do + if config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then + _p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>', premake.esc(cfginfo.name)) + config_mappings[cfginfo] = nil --only one source file per pch + end + end + if path.iscfile(file.name) ~= premake.project.iscproject(prj) then + _p(3,'<CompileAs>%s</CompileAs>', iif(path.iscfile(file.name), 'CompileAsC', 'CompileAsCpp')) + end + _p(2,'</ClCompile>') + end + -- Overriding the function which calls the above + vc2010.compilerfilesgroup = function(prj) + local configs = prj.solution.vstudio_configs + local files = vc2010.getfilegroup(prj, "ClCompile") + if #files > 0 then + local config_mappings = {} + for _, cfginfo in ipairs(configs) do + local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) + if cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then + config_mappings[cfginfo] = path.translate(cfg.pchsource, "\\") + end + end + + _p(1,'<ItemGroup>') + for _, file in ipairs(files) do + vc2010.individualSourceFile(prj, config_mappings, file) + end + _p(1,'</ItemGroup>') + end + end + end -- Name the project files after their VS version local orig_getbasename = premake.project.getbasename premake.project.getbasename = function(prjname, pattern) @@ -52,6 +173,32 @@ do end return orig_getbasename(prjname, pattern) end + -- Older versions of Premake4 fail to set the proper entry point, although they could simply let it out entirely ... + local orig_vc2010_link = premake.vstudio.vc2010.link + premake.vstudio.vc2010.link = function(cfg) + if cfg.flags and cfg.flags.Unicode then + io.capture() + orig_vc2010_link(cfg) + local captured = io.endcapture() + captured = captured:gsub("(<EntryPointSymbol>)(mainCRTStartup)", "%1w%2") + io.write(captured) + else + orig_vc2010_link(cfg) + end + end + local orig_vc200x_VCLinkerTool = premake.vstudio.vc200x.VCLinkerTool + premake.vstudio.vc200x.VCLinkerTool = function(cfg) + if cfg.flags and cfg.flags.Unicode then + io.capture() + orig_vc200x_VCLinkerTool(cfg) + local captured = io.endcapture() + captured = captured:gsub('(EntryPointSymbol=")(mainCRTStartup)', "%1w%2") + io.write(captured) + else + orig_vc200x_VCLinkerTool(cfg) + end + end + premake.vstudio.vc200x.toolmap.VCLinkerTool = premake.vstudio.vc200x.VCLinkerTool -- Override the object directory paths ... don't make them "unique" inside premake4 local orig_gettarget = premake.gettarget premake.gettarget = function(cfg, direction, pathstyle, namestyle, system) diff --git a/src/actions/vstudio/vs200x_vcproj.lua b/src/actions/vstudio/vs200x_vcproj.lua index 91e4cb1..fbef6a6 100644 --- a/src/actions/vstudio/vs200x_vcproj.lua +++ b/src/actions/vstudio/vs200x_vcproj.lua @@ -103,6 +103,50 @@ end + function vc200x.individualSourceFile(prj, depth, fname) + -- handle file configuration stuff. This needs to be cleaned up and simplified. + -- configurations are cached, so this isn't as bad as it looks + for _, cfginfo in ipairs(prj.solution.vstudio_configs) do + if cfginfo.isreal then + local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) + + local usePCH = (not prj.flags.NoPCH and prj.pchsource == node.cfg.name) + local isSourceCode = path.iscppfile(fname) + local needsCompileAs = (path.iscfile(fname) ~= premake.project.iscproject(prj)) + + if usePCH or (isSourceCode and needsCompileAs) then + _p(depth, '<FileConfiguration') + _p(depth, '\tName="%s"', cfginfo.name) + _p(depth, '\t>') + _p(depth, '\t<Tool') + _p(depth, '\t\tName="%s"', iif(cfg.system == "Xbox360", + "VCCLX360CompilerTool", + "VCCLCompilerTool")) + if needsCompileAs then + _p(depth, '\t\tCompileAs="%s"', iif(path.iscfile(fname), 1, 2)) + end + + if usePCH then + if cfg.system == "PS3" then + local options = table.join(premake.snc.getcflags(cfg), + premake.snc.getcxxflags(cfg), + cfg.buildoptions) + options = table.concat(options, " "); + options = options .. ' --create_pch="$(IntDir)/$(TargetName).pch"' + _p(depth, '\t\tAdditionalOptions="%s"', premake.esc(options)) + else + _p(depth, '\t\tUsePrecompiledHeader="1"') + end + end + + _p(depth, '\t/>') + _p(depth, '</FileConfiguration>') + end + + end + end + end + -- -- Write out the <Files> element. -- @@ -132,47 +176,7 @@ _p(depth, '\t>') depth = depth + 1 - -- handle file configuration stuff. This needs to be cleaned up and simplified. - -- configurations are cached, so this isn't as bad as it looks - for _, cfginfo in ipairs(prj.solution.vstudio_configs) do - if cfginfo.isreal then - local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) - - local usePCH = (not prj.flags.NoPCH and prj.pchsource == node.cfg.name) - local isSourceCode = path.iscppfile(fname) - local needsCompileAs = (path.iscfile(fname) ~= premake.project.iscproject(prj)) - - if usePCH or (isSourceCode and needsCompileAs) then - _p(depth, '<FileConfiguration') - _p(depth, '\tName="%s"', cfginfo.name) - _p(depth, '\t>') - _p(depth, '\t<Tool') - _p(depth, '\t\tName="%s"', iif(cfg.system == "Xbox360", - "VCCLX360CompilerTool", - "VCCLCompilerTool")) - if needsCompileAs then - _p(depth, '\t\tCompileAs="%s"', iif(path.iscfile(fname), 1, 2)) - end - - if usePCH then - if cfg.system == "PS3" then - local options = table.join(premake.snc.getcflags(cfg), - premake.snc.getcxxflags(cfg), - cfg.buildoptions) - options = table.concat(options, " "); - options = options .. ' --create_pch="$(IntDir)/$(TargetName).pch"' - _p(depth, '\t\tAdditionalOptions="%s"', premake.esc(options)) - else - _p(depth, '\t\tUsePrecompiledHeader="1"') - end - end - - _p(depth, '\t/>') - _p(depth, '</FileConfiguration>') - end - - end - end + vc200x.individualSourceFile(prj, depth, fname) depth = depth - 1 _p(depth, '</File>') diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index d77ad21..5b9958c 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -526,6 +526,21 @@ end end + function vc2010.individualSourceFile(prj, config_mappings, file) + local configs = prj.solution.vstudio_configs + local translatedpath = path.translate(file.name, "\\") + _p(2,'<ClCompile Include=\"%s\">', translatedpath) + for _, cfginfo in ipairs(configs) do + if config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then + _p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>', premake.esc(cfginfo.name)) + config_mappings[cfginfo] = nil --only one source file per pch + end + end + if path.iscfile(file.name) ~= premake.project.iscproject(prj) then + _p(3,'<CompileAs>%s</CompileAs>', iif(path.iscfile(file.name), 'CompileAsC', 'CompileAsCpp')) + end + _p(2,'</ClCompile>') + end function vc2010.compilerfilesgroup(prj) local configs = prj.solution.vstudio_configs @@ -541,15 +556,7 @@ _p(1,'<ItemGroup>') for _, file in ipairs(files) do - local translatedpath = path.translate(file.name, "\\") - _p(2,'<ClCompile Include=\"%s\">', translatedpath) - for _, cfginfo in ipairs(configs) do - if config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then - _p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>', premake.esc(cfginfo.name)) - config_mappings[cfginfo] = nil --only one source file per pch - end - end - _p(2,'</ClCompile>') + vc2010.individualSourceFile(prj, config_mappings, file) end _p(1,'</ItemGroup>') end diff --git a/src/host/scripts.c b/src/host/scripts.c index 0822989..a54cf11 100644 --- a/src/host/scripts.c +++ b/src/host/scripts.c @@ -185,22 +185,22 @@ const char* builtin_scripts[] = { " \"0\"')_p(3,'ProjectView = \"ProjectFiles\"')_p(3,'ProjectTrust = \"0\"')_p(2,'/>')_p(1,'</CSHARP>')_p('</VisualStudioProject>')end", /* actions/vstudio/vs200x_vcproj.lua */ - "premake.vstudio.vc200x={}local o=premake.vstudio.vc200x\nlocal i=premake.tree\nlocal function n(e)if(_ACTION<\"vs2005\")then\nreturn iif(e,\"TRUE\",\"FALSE\")else\nreturn iif(e,\"true\",\"false\")end\nend\nfunction o.optimization(o)local e=0\nfor n,o in ipairs(o.flags)do\nif(o==\"Optimize\")then\ne=3\nelseif(o==\"OptimizeSize\")then\ne=1\nelseif(o==\"OptimizeSpeed\")then\ne=2\nend\nend\nreturn e\nend\nfunction o.header(e)io.eol=\"\\r\\n\"_p('<?xml version=\"1.0\" encoding=\"Windows-1252\"?>')_p('<%s',e)_p(1,'ProjectType=\"Visual C++\"')if _ACTION==\"vs2002\"then\n_p(1,'Version=\"7.00\"')elseif _ACTION==\"vs2003\"then\n_p(1,'Version=\"7.10\"')elseif _ACTION==\"vs2005\"then\n_p(1,'Version=\"8.00\"')elseif _ACTION==\"vs2008\"then\n_p(1,'Version=\"9.00\"')end\nend\nfunction o.Configuration(o,e)_p(2,'<Configuration')_p(3,'Name=\"%s\"',premake.esc(o))_p(3,'OutputDirectory=\"%s\"',premake.esc(e.buildtarget.directory))_p(3,'IntermediateDirectory=\"%s\"',premake.esc(e.objectsdir))local o\nif(e.kind==\"SharedLib\")then" - "\no=2\nelseif(e.kind==\"StaticLib\")then\no=4\nelse\no=1\nend\n_p(3,'ConfigurationType=\"%s\"',o)if(e.flags.MFC)then\n_p(3,'UseOfMFC=\"%d\"',iif(e.flags.StaticRuntime,1,2))end\nif(e.flags.ATL or e.flags.StaticATL)then\n_p(3,'UseOfATL=\"%d\"',iif(e.flags.StaticATL,1,2))end\n_p(3,'CharacterSet=\"%s\"',iif(e.flags.Unicode,1,2))if e.flags.Managed then\n_p(3,'ManagedExtensions=\"1\"')end\n_p(3,'>')end\nfunction o.Files(o)local e=premake.project.buildsourcetree(o)i.traverse(e,{onbranchenter=function(o,e)_p(e,'<Filter')_p(e,'\\tName=\"%s\"',o.name)_p(e,'\\tFilter=\"\"')_p(e,'\\t>')end,onbranchexit=function(o,e)_p(e,'</Filter>')end,onleaf=function(l,e)local t=l.cfg.name\n_p(e,'<File')_p(e,'\\tRelativePath=\"%s\"',path.translate(t,\"\\\\\"))_p(e,'\\t>')e=e+1\nfor n,i in ipairs(o.solution.vstudio_configs)do\nif i.isreal then\nlocal n=premake.getconfig(o,i.src_buildcfg,i.src_platform)local l=(not o.flags.NoPCH and o.pchsource==l.cfg.name)local a=path.iscppfile(t)local o=(path.iscfile(t)~=premake.project.iscproject(o))if " - "l or(a and o)then\n_p(e,'<FileConfiguration')_p(e,'\\tName=\"%s\"',i.name)_p(e,'\\t>')_p(e,'\\t<Tool')_p(e,'\\t\\tName=\"%s\"',iif(n.system==\"Xbox360\",\"VCCLX360CompilerTool\",\"VCCLCompilerTool\"))if o then\n_p(e,'\\t\\tCompileAs=\"%s\"',iif(path.iscfile(t),1,2))end\nif l then\nif n.system==\"PS3\"then\nlocal o=table.join(premake.snc.getcflags(n),premake.snc.getcxxflags(n),n.buildoptions)o=table.concat(o,\" \");o=o..' --create_pch=\"$(IntDir)/$(TargetName).pch\"'_p(e,'\\t\\tAdditionalOptions=\"%s\"',premake.esc(o))else\n_p(e,'\\t\\tUsePrecompiledHeader=\"1\"')end\nend\n_p(e,'\\t/>')_p(e,'</FileConfiguration>')end\nend\nend\ne=e-1\n_p(e,'</File>')end,},false,2)end\nfunction o.Platforms(e)local o={}_p(1,'<Platforms>')for n,e in ipairs(e.solution.vstudio_configs)do\nif e.isreal and not table.contains(o,e.platform)then\ntable.insert(o,e.platform)_p(2,'<Platform')_p(3,'Name=\"%s\"',e.platform)_p(2,'/>')end\nend\n_p(1,'</Platforms>')end\nfunction o.Symbols(e)if(not e.flags.Symbols)then\nreturn 0\nelse\nif e.flags" - ".NoEditAndContinue or\no.optimization(e)~=0 or\ne.flags.Managed or\ne.platform==\"x64\"then\nreturn 3\nelse\nreturn 4\nend\nend\nend\nfunction o.VCCLCompilerTool(e)_p(3,'<Tool')_p(4,'Name=\"%s\"',iif(e.platform~=\"Xbox360\",\"VCCLCompilerTool\",\"VCCLX360CompilerTool\"))if#e.buildoptions>0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.buildoptions),\" \"))end\n_p(4,'Optimization=\"%s\"',o.optimization(e))if e.flags.NoFramePointer then\n_p(4,'OmitFramePointers=\"%s\"',n(true))end\nif#e.includedirs>0 then\n_p(4,'AdditionalIncludeDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.includedirs,\";\"),'\\\\')))end\nif#e.defines>0 then\n_p(4,'PreprocessorDefinitions=\"%s\"',premake.esc(table.concat(e.defines,\";\")))end\nif premake.config.isdebugbuild(e)and not e.flags.NoMinimalRebuild and not e.flags.Managed then\n_p(4,'MinimalRebuild=\"%s\"',n(true))end\nif e.flags.NoExceptions then\n_p(4,'ExceptionHandling=\"%s\"',iif(_ACTION<\"vs2005\",\"FALSE\",0))elseif e.flags.SEH and _ACTION>\"vs" - "2003\"then\n_p(4,'ExceptionHandling=\"2\"')end\nif o.optimization(e)==0 and not e.flags.Managed then\n_p(4,'BasicRuntimeChecks=\"3\"')end\nif o.optimization(e)~=0 then\n_p(4,'StringPooling=\"%s\"',n(true))end\nlocal i\nif premake.config.isdebugbuild(e)then\ni=iif(e.flags.StaticRuntime,1,3)else\ni=iif(e.flags.StaticRuntime,0,2)end\n_p(4,'RuntimeLibrary=\"%s\"',i)_p(4,'EnableFunctionLevelLinking=\"%s\"',n(true))if _ACTION>\"vs2003\"and e.platform~=\"Xbox360\"and e.platform~=\"x64\"then\nif e.flags.EnableSSE then\n_p(4,'EnableEnhancedInstructionSet=\"1\"')elseif e.flags.EnableSSE2 then\n_p(4,'EnableEnhancedInstructionSet=\"2\"')end\nend\nif _ACTION<\"vs2005\"then\nif e.flags.FloatFast then\n_p(4,'ImproveFloatingPointConsistency=\"%s\"',n(false))elseif e.flags.FloatStrict then\n_p(4,'ImproveFloatingPointConsistency=\"%s\"',n(true))end\nelse\nif e.flags.FloatFast then\n_p(4,'FloatingPointModel=\"2\"')elseif e.flags.FloatStrict then\n_p(4,'FloatingPointModel=\"1\"')end\nend\nif _ACTION<\"vs2005\"and not e.flags.NoRT" - "TI then\n_p(4,'RuntimeTypeInfo=\"%s\"',n(true))elseif _ACTION>\"vs2003\"and e.flags.NoRTTI and not e.flags.Managed then\n_p(4,'RuntimeTypeInfo=\"%s\"',n(false))end\nif e.flags.NativeWChar then\n_p(4,'TreatWChar_tAsBuiltInType=\"%s\"',n(true))elseif e.flags.NoNativeWChar then\n_p(4,'TreatWChar_tAsBuiltInType=\"%s\"',n(false))end\nif not e.flags.NoPCH and e.pchheader then\n_p(4,'UsePrecompiledHeader=\"%s\"',iif(_ACTION<\"vs2005\",3,2))_p(4,'PrecompiledHeaderThrough=\"%s\"',e.pchheader)else\n_p(4,'UsePrecompiledHeader=\"%s\"',iif(_ACTION>\"vs2003\"or e.flags.NoPCH,0,2))end\n_p(4,'WarningLevel=\"%s\"',iif(e.flags.ExtraWarnings,4,3))if e.flags.FatalWarnings then\n_p(4,'WarnAsError=\"%s\"',n(true))end\nif _ACTION<\"vs2008\"and not e.flags.Managed then\n_p(4,'Detect64BitPortabilityProblems=\"%s\"',n(not e.flags.No64BitChecks))end\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"',path.getbasename(e.buildtarget.name))_p(4,'DebugInformationFormat=\"%s\"',o.Symbols(e))if e.language==\"C\"then\n_p(4,'CompileAs=\"1\"" - "')end\n_p(3,'/>')end\nfunction o.VCLinkerTool(e)_p(3,'<Tool')if e.kind~=\"StaticLib\"then\n_p(4,'Name=\"%s\"',iif(e.platform~=\"Xbox360\",\"VCLinkerTool\",\"VCX360LinkerTool\"))if e.flags.NoImportLib then\n_p(4,'IgnoreImportLibrary=\"%s\"',n(true))end\nif#e.linkoptions>0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.linkoptions),\" \"))end\nif#e.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(e,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',e.buildtarget.name)_p(4,'LinkIncremental=\"%s\"',iif(premake.config.isincrementallink(e),2,1))_p(4,'AdditionalLibraryDirectories=\"%s\"',table.concat(premake.esc(path.translate(e.libdirs,'\\\\')),\";\"))local i=premake.findfile(e,\".def\")if i then\n_p(4,'ModuleDefinitionFile=\"%s\"',i)end\nif e.flags.NoManifest then\n_p(4,'GenerateManifest=\"%s\"',n(false))end\n_p(4,'GenerateDebugInformation=\"%s\"',n(o.Symbols(e)~=0))if o.Symbols(e)~=0 then\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"'," - "path.getbasename(e.buildtarget.name))end\n_p(4,'SubSystem=\"%s\"',iif(e.kind==\"ConsoleApp\",1,2))if o.optimization(e)~=0 then\n_p(4,'OptimizeReferences=\"2\"')_p(4,'EnableCOMDATFolding=\"2\"')end\nif(e.kind==\"ConsoleApp\"or e.kind==\"WindowedApp\")and not e.flags.WinMain then\n_p(4,'EntryPointSymbol=\"%s\"',iif(e.flags.Unicode,\"wmainCRTStartup\",\"mainCRTStartup\"))end\nif e.kind==\"SharedLib\"then\nlocal o=e.linktarget.fullpath\n_p(4,'ImportLibrary=\"%s\"',iif(e.flags.NoImportLib,e.objectsdir..\"\\\\\"..path.getname(o),o))end\n_p(4,'TargetMachine=\"%d\"',iif(e.platform==\"x64\",17,1))else\n_p(4,'Name=\"VCLibrarianTool\"')if#e.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(e,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',e.buildtarget.name)if#e.libdirs>0 then\n_p(4,'AdditionalLibraryDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.libdirs,\";\"))))end\nlocal o={}if e.platform==\"x32\"then\ntable.insert(o,\"/MACHINE:X86\")elseif e.platfo" - "rm==\"x64\"then\ntable.insert(o,\"/MACHINE:X64\")end\no=table.join(o,e.linkoptions)if#o>0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(o),\" \"))end\nend\n_p(3,'/>')end\nfunction o.VCCLCompilerTool_PS3(e)_p(3,'<Tool')_p(4,'Name=\"VCCLCompilerTool\"')local o=table.join(premake.snc.getcflags(e),premake.snc.getcxxflags(e),e.buildoptions)if not e.flags.NoPCH and e.pchheader then\n_p(4,'UsePrecompiledHeader=\"%s\"',iif(_ACTION<\"vs2005\",3,2))_p(4,'PrecompiledHeaderThrough=\"%s\"',path.getname(e.pchheader))table.insert(o,'--use_pch=\"$(IntDir)/$(TargetName).pch\"')else\n_p(4,'UsePrecompiledHeader=\"%s\"',iif(_ACTION>\"vs2003\"or e.flags.NoPCH,0,2))end\n_p(4,'AdditionalOptions=\"%s\"',premake.esc(table.concat(o,\" \")))if#e.includedirs>0 then\n_p(4,'AdditionalIncludeDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.includedirs,\";\"),'\\\\')))end\nif#e.defines>0 then\n_p(4,'PreprocessorDefinitions=\"%s\"',table.concat(premake.esc(e.defines),\";\"))end\n_p(4,'ProgramDataBaseFileName=\"$(" - "OutDir)\\\\%s.pdb\"',path.getbasename(e.buildtarget.name))_p(4,'DebugInformationFormat=\"0\"')_p(4,'CompileAs=\"0\"')_p(3,'/>')end\nfunction o.VCLinkerTool_PS3(e)_p(3,'<Tool')if e.kind~=\"StaticLib\"then\n_p(4,'Name=\"VCLinkerTool\"')local o=table.join(premake.snc.getldflags(e),e.linkoptions)if#o>0 then\n_p(4,'AdditionalOptions=\"%s\"',premake.esc(table.concat(o,\" \")))end\nif#e.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(e,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',e.buildtarget.name)_p(4,'LinkIncremental=\"0\"')_p(4,'AdditionalLibraryDirectories=\"%s\"',table.concat(premake.esc(path.translate(e.libdirs,'\\\\')),\";\"))_p(4,'GenerateManifest=\"%s\"',n(false))_p(4,'ProgramDatabaseFile=\"\"')_p(4,'RandomizedBaseAddress=\"1\"')_p(4,'DataExecutionPrevention=\"0\"')else\n_p(4,'Name=\"VCLibrarianTool\"')local o=table.join(premake.snc.getldflags(e),e.linkoptions)if#o>0 then\n_p(4,'AdditionalOptions=\"%s\"',premake.esc(table.concat(o,\" \")))end\nif#e" - ".links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(e,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',e.buildtarget.name)if#e.libdirs>0 then\n_p(4,'AdditionalLibraryDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.libdirs,\";\"))))end\nend\n_p(3,'/>')end\nfunction o.VCResourceCompilerTool(e)_p(3,'<Tool')_p(4,'Name=\"VCResourceCompilerTool\"')if#e.resoptions>0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.resoptions),\" \"))end\nif#e.defines>0 or#e.resdefines>0 then\n_p(4,'PreprocessorDefinitions=\"%s\"',table.concat(premake.esc(table.join(e.defines,e.resdefines)),\";\"))end\nif#e.includedirs>0 or#e.resincludedirs>0 then\nlocal e=table.join(e.includedirs,e.resincludedirs)_p(4,'AdditionalIncludeDirectories=\"%s\"',premake.esc(path.translate(table.concat(e,\";\"),'\\\\')))end\n_p(3,'/>')end\nfunction o.VCManifestTool(o)local e={}for n,o in ipairs(o.files)do\nif path.getextension(o)==\".manifest\"then\ntable.insert(e,o)end\nend\n" - "_p(3,'<Tool')_p(4,'Name=\"VCManifestTool\"')if#e>0 then\n_p(4,'AdditionalManifestFiles=\"%s\"',premake.esc(table.concat(e,\";\")))end\n_p(3,'/>')end\nfunction o.VCMIDLTool(e)_p(3,'<Tool')_p(4,'Name=\"VCMIDLTool\"')if e.platform==\"x64\"then\n_p(4,'TargetEnvironment=\"3\"')end\n_p(3,'/>')end\nfunction o.buildstepsblock(n,e)_p(3,'<Tool')_p(4,'Name=\"%s\"',n)if#e>0 then\n_p(4,'CommandLine=\"%s\"',premake.esc(table.implode(e,\"\",\"\",\"\\r\\n\")))end\n_p(3,'/>')end\no.toolmap={VCCLCompilerTool=o.VCCLCompilerTool,VCCLCompilerTool_PS3=o.VCCLCompilerTool_PS3,VCLinkerTool=o.VCLinkerTool,VCLinkerTool_PS3=o.VCLinkerTool_PS3,VCManifestTool=o.VCManifestTool,VCMIDLTool=o.VCMIDLTool,VCResourceCompilerTool=o.VCResourceCompilerTool,VCPreBuildEventTool=function(e)o.buildstepsblock(\"VCPreBuildEventTool\",e.prebuildcommands)end,VCPreLinkEventTool=function(e)o.buildstepsblock(\"VCPreLinkEventTool\",e.prelinkcommands)end,VCPostBuildEventTool=function(e)o.buildstepsblock(\"VCPostBuildEventTool\",e.postbuildcommands)end,}local fun" - "ction i(o,e)if o==\"vs2002\"then\nreturn{\"VCCLCompilerTool\",\"VCCustomBuildTool\",\"VCLinkerTool\",\"VCMIDLTool\",\"VCPostBuildEventTool\",\"VCPreBuildEventTool\",\"VCPreLinkEventTool\",\"VCResourceCompilerTool\",\"VCWebServiceProxyGeneratorTool\",\"VCWebDeploymentTool\"}end\nif o==\"vs2003\"then\nreturn{\"VCCLCompilerTool\",\"VCCustomBuildTool\",\"VCLinkerTool\",\"VCMIDLTool\",\"VCPostBuildEventTool\",\"VCPreBuildEventTool\",\"VCPreLinkEventTool\",\"VCResourceCompilerTool\",\"VCWebServiceProxyGeneratorTool\",\"VCXMLDataGeneratorTool\",\"VCWebDeploymentTool\",\"VCManagedWrapperGeneratorTool\",\"VCAuxiliaryManagedWrapperGeneratorTool\"}end\nif e==\"Xbox360\"then\nreturn{\"VCPreBuildEventTool\",\"VCCustomBuildTool\",\"VCXMLDataGeneratorTool\",\"VCWebServiceProxyGeneratorTool\",\"VCMIDLTool\",\"VCCLCompilerTool\",\"VCManagedResourceCompilerTool\",\"VCResourceCompilerTool\",\"VCPreLinkEventTool\",\"VCLinkerTool\",\"VCALinkTool\",\"VCX360ImageTool\",\"VCBscMakeTool\",\"VCX360DeploymentTool\",\"VCPostBuildEventToo" - "l\",\"DebuggerTool\",}end\nif e==\"PS3\"then\nreturn{\"VCPreBuildEventTool\",\"VCCustomBuildTool\",\"VCXMLDataGeneratorTool\",\"VCWebServiceProxyGeneratorTool\",\"VCMIDLTool\",\"VCCLCompilerTool_PS3\",\"VCManagedResourceCompilerTool\",\"VCResourceCompilerTool\",\"VCPreLinkEventTool\",\"VCLinkerTool_PS3\",\"VCALinkTool\",\"VCManifestTool\",\"VCXDCMakeTool\",\"VCBscMakeTool\",\"VCFxCopTool\",\"VCAppVerifierTool\",\"VCWebDeploymentTool\",\"VCPostBuildEventTool\"}else\nreturn{\"VCPreBuildEventTool\",\"VCCustomBuildTool\",\"VCXMLDataGeneratorTool\",\"VCWebServiceProxyGeneratorTool\",\"VCMIDLTool\",\"VCCLCompilerTool\",\"VCManagedResourceCompilerTool\",\"VCResourceCompilerTool\",\"VCPreLinkEventTool\",\"VCLinkerTool\",\"VCALinkTool\",\"VCManifestTool\",\"VCXDCMakeTool\",\"VCBscMakeTool\",\"VCFxCopTool\",\"VCAppVerifierTool\",\"VCWebDeploymentTool\",\"VCPostBuildEventTool\"}end\nend\nfunction o.generate(e)o.header('VisualStudioProject')_p(1,'Name=\"%s\"',premake.esc(e.name))_p(1,'ProjectGUID=\"{%s}\"',e.uuid)if _ACTI" - "ON>\"vs2003\"then\n_p(1,'RootNamespace=\"%s\"',e.name)end\n_p(1,'Keyword=\"%s\"',iif(e.flags.Managed,\"ManagedCProj\",\"Win32Proj\"))_p(1,'>')o.Platforms(e)if _ACTION>\"vs2003\"then\n_p(1,'<ToolFiles>')_p(1,'</ToolFiles>')end\n_p(1,'<Configurations>')for t,n in ipairs(e.solution.vstudio_configs)do\nif n.isreal then\nlocal e=premake.getconfig(e,n.src_buildcfg,n.src_platform)o.Configuration(n.name,e)for i,n in ipairs(i(_ACTION,n.src_platform))do\nif o.toolmap[n]then\no.toolmap[n](e)elseif n==\"VCX360DeploymentTool\"then\n_p(3,'<Tool')_p(4,'Name=\"VCX360DeploymentTool\"')_p(4,'DeploymentType=\"0\"')if#e.deploymentoptions>0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.deploymentoptions),\" \"))end\n_p(3,'/>')elseif n==\"VCX360ImageTool\"then\n_p(3,'<Tool')_p(4,'Name=\"VCX360ImageTool\"')if#e.imageoptions>0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.imageoptions),\" \"))end\nif e.imagepath~=nil then\n_p(4,'OutputFileName=\"%s\"',premake.esc(path.translate(e.imagepath)))end" - "\n_p(3,'/>')elseif n==\"DebuggerTool\"then\n_p(3,'<DebuggerTool')_p(3,'/>')else\n_p(3,'<Tool')_p(4,'Name=\"%s\"',n)_p(3,'/>')end\nend\n_p(2,'</Configuration>')end\nend\n_p(1,'</Configurations>')_p(1,'<References>')_p(1,'</References>')_p(1,'<Files>')o.Files(e)_p(1,'</Files>')_p(1,'<Globals>')_p(1,'</Globals>')_p('</VisualStudioProject>')end", + "premake.vstudio.vc200x={}local o=premake.vstudio.vc200x\nlocal a=premake.tree\nlocal function n(e)if(_ACTION<\"vs2005\")then\nreturn iif(e,\"TRUE\",\"FALSE\")else\nreturn iif(e,\"true\",\"false\")end\nend\nfunction o.optimization(o)local e=0\nfor n,o in ipairs(o.flags)do\nif(o==\"Optimize\")then\ne=3\nelseif(o==\"OptimizeSize\")then\ne=1\nelseif(o==\"OptimizeSpeed\")then\ne=2\nend\nend\nreturn e\nend\nfunction o.header(e)io.eol=\"\\r\\n\"_p('<?xml version=\"1.0\" encoding=\"Windows-1252\"?>')_p('<%s',e)_p(1,'ProjectType=\"Visual C++\"')if _ACTION==\"vs2002\"then\n_p(1,'Version=\"7.00\"')elseif _ACTION==\"vs2003\"then\n_p(1,'Version=\"7.10\"')elseif _ACTION==\"vs2005\"then\n_p(1,'Version=\"8.00\"')elseif _ACTION==\"vs2008\"then\n_p(1,'Version=\"9.00\"')end\nend\nfunction o.Configuration(o,e)_p(2,'<Configuration')_p(3,'Name=\"%s\"',premake.esc(o))_p(3,'OutputDirectory=\"%s\"',premake.esc(e.buildtarget.directory))_p(3,'IntermediateDirectory=\"%s\"',premake.esc(e.objectsdir))local o\nif(e.kind==\"SharedLib\")then" + "\no=2\nelseif(e.kind==\"StaticLib\")then\no=4\nelse\no=1\nend\n_p(3,'ConfigurationType=\"%s\"',o)if(e.flags.MFC)then\n_p(3,'UseOfMFC=\"%d\"',iif(e.flags.StaticRuntime,1,2))end\nif(e.flags.ATL or e.flags.StaticATL)then\n_p(3,'UseOfATL=\"%d\"',iif(e.flags.StaticATL,1,2))end\n_p(3,'CharacterSet=\"%s\"',iif(e.flags.Unicode,1,2))if e.flags.Managed then\n_p(3,'ManagedExtensions=\"1\"')end\n_p(3,'>')end\nfunction o.individualSourceFile(n,e,t)for o,i in ipairs(n.solution.vstudio_configs)do\nif i.isreal then\nlocal o=premake.getconfig(n,i.src_buildcfg,i.src_platform)local l=(not n.flags.NoPCH and n.pchsource==node.cfg.name)local a=path.iscppfile(t)local n=(path.iscfile(t)~=premake.project.iscproject(n))if l or(a and n)then\n_p(e,'<FileConfiguration')_p(e,'\\tName=\"%s\"',i.name)_p(e,'\\t>')_p(e,'\\t<Tool')_p(e,'\\t\\tName=\"%s\"',iif(o.system==\"Xbox360\",\"VCCLX360CompilerTool\",\"VCCLCompilerTool\"))if n then\n_p(e,'\\t\\tCompileAs=\"%s\"',iif(path.iscfile(t),1,2))end\nif l then\nif o.system==\"PS3\"then\nlocal o=tab" + "le.join(premake.snc.getcflags(o),premake.snc.getcxxflags(o),o.buildoptions)o=table.concat(o,\" \");o=o..' --create_pch=\"$(IntDir)/$(TargetName).pch\"'_p(e,'\\t\\tAdditionalOptions=\"%s\"',premake.esc(o))else\n_p(e,'\\t\\tUsePrecompiledHeader=\"1\"')end\nend\n_p(e,'\\t/>')_p(e,'</FileConfiguration>')end\nend\nend\nend\nfunction o.Files(n)local e=premake.project.buildsourcetree(n)a.traverse(e,{onbranchenter=function(o,e)_p(e,'<Filter')_p(e,'\\tName=\"%s\"',o.name)_p(e,'\\tFilter=\"\"')_p(e,'\\t>')end,onbranchexit=function(o,e)_p(e,'</Filter>')end,onleaf=function(i,e)local i=i.cfg.name\n_p(e,'<File')_p(e,'\\tRelativePath=\"%s\"',path.translate(i,\"\\\\\"))_p(e,'\\t>')e=e+1\no.individualSourceFile(n,e,i)e=e-1\n_p(e,'</File>')end,},false,2)end\nfunction o.Platforms(e)local o={}_p(1,'<Platforms>')for n,e in ipairs(e.solution.vstudio_configs)do\nif e.isreal and not table.contains(o,e.platform)then\ntable.insert(o,e.platform)_p(2,'<Platform')_p(3,'Name=\"%s\"',e.platform)_p(2,'/>')end\nend\n_p(1,'</Platforms>')end\nf" + "unction o.Symbols(e)if(not e.flags.Symbols)then\nreturn 0\nelse\nif e.flags.NoEditAndContinue or\no.optimization(e)~=0 or\ne.flags.Managed or\ne.platform==\"x64\"then\nreturn 3\nelse\nreturn 4\nend\nend\nend\nfunction o.VCCLCompilerTool(e)_p(3,'<Tool')_p(4,'Name=\"%s\"',iif(e.platform~=\"Xbox360\",\"VCCLCompilerTool\",\"VCCLX360CompilerTool\"))if#e.buildoptions>0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.buildoptions),\" \"))end\n_p(4,'Optimization=\"%s\"',o.optimization(e))if e.flags.NoFramePointer then\n_p(4,'OmitFramePointers=\"%s\"',n(true))end\nif#e.includedirs>0 then\n_p(4,'AdditionalIncludeDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.includedirs,\";\"),'\\\\')))end\nif#e.defines>0 then\n_p(4,'PreprocessorDefinitions=\"%s\"',premake.esc(table.concat(e.defines,\";\")))end\nif premake.config.isdebugbuild(e)and not e.flags.NoMinimalRebuild and not e.flags.Managed then\n_p(4,'MinimalRebuild=\"%s\"',n(true))end\nif e.flags.NoExceptions then\n_p(4,'ExceptionHandling=\"%s" + "\"',iif(_ACTION<\"vs2005\",\"FALSE\",0))elseif e.flags.SEH and _ACTION>\"vs2003\"then\n_p(4,'ExceptionHandling=\"2\"')end\nif o.optimization(e)==0 and not e.flags.Managed then\n_p(4,'BasicRuntimeChecks=\"3\"')end\nif o.optimization(e)~=0 then\n_p(4,'StringPooling=\"%s\"',n(true))end\nlocal i\nif premake.config.isdebugbuild(e)then\ni=iif(e.flags.StaticRuntime,1,3)else\ni=iif(e.flags.StaticRuntime,0,2)end\n_p(4,'RuntimeLibrary=\"%s\"',i)_p(4,'EnableFunctionLevelLinking=\"%s\"',n(true))if _ACTION>\"vs2003\"and e.platform~=\"Xbox360\"and e.platform~=\"x64\"then\nif e.flags.EnableSSE then\n_p(4,'EnableEnhancedInstructionSet=\"1\"')elseif e.flags.EnableSSE2 then\n_p(4,'EnableEnhancedInstructionSet=\"2\"')end\nend\nif _ACTION<\"vs2005\"then\nif e.flags.FloatFast then\n_p(4,'ImproveFloatingPointConsistency=\"%s\"',n(false))elseif e.flags.FloatStrict then\n_p(4,'ImproveFloatingPointConsistency=\"%s\"',n(true))end\nelse\nif e.flags.FloatFast then\n_p(4,'FloatingPointModel=\"2\"')elseif e.flags.FloatStrict then\n_p(4,'Fl" + "oatingPointModel=\"1\"')end\nend\nif _ACTION<\"vs2005\"and not e.flags.NoRTTI then\n_p(4,'RuntimeTypeInfo=\"%s\"',n(true))elseif _ACTION>\"vs2003\"and e.flags.NoRTTI and not e.flags.Managed then\n_p(4,'RuntimeTypeInfo=\"%s\"',n(false))end\nif e.flags.NativeWChar then\n_p(4,'TreatWChar_tAsBuiltInType=\"%s\"',n(true))elseif e.flags.NoNativeWChar then\n_p(4,'TreatWChar_tAsBuiltInType=\"%s\"',n(false))end\nif not e.flags.NoPCH and e.pchheader then\n_p(4,'UsePrecompiledHeader=\"%s\"',iif(_ACTION<\"vs2005\",3,2))_p(4,'PrecompiledHeaderThrough=\"%s\"',e.pchheader)else\n_p(4,'UsePrecompiledHeader=\"%s\"',iif(_ACTION>\"vs2003\"or e.flags.NoPCH,0,2))end\n_p(4,'WarningLevel=\"%s\"',iif(e.flags.ExtraWarnings,4,3))if e.flags.FatalWarnings then\n_p(4,'WarnAsError=\"%s\"',n(true))end\nif _ACTION<\"vs2008\"and not e.flags.Managed then\n_p(4,'Detect64BitPortabilityProblems=\"%s\"',n(not e.flags.No64BitChecks))end\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"',path.getbasename(e.buildtarget.name))_p(4,'DebugInformation" + "Format=\"%s\"',o.Symbols(e))if e.language==\"C\"then\n_p(4,'CompileAs=\"1\"')end\n_p(3,'/>')end\nfunction o.VCLinkerTool(e)_p(3,'<Tool')if e.kind~=\"StaticLib\"then\n_p(4,'Name=\"%s\"',iif(e.platform~=\"Xbox360\",\"VCLinkerTool\",\"VCX360LinkerTool\"))if e.flags.NoImportLib then\n_p(4,'IgnoreImportLibrary=\"%s\"',n(true))end\nif#e.linkoptions>0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.linkoptions),\" \"))end\nif#e.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(e,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',e.buildtarget.name)_p(4,'LinkIncremental=\"%s\"',iif(premake.config.isincrementallink(e),2,1))_p(4,'AdditionalLibraryDirectories=\"%s\"',table.concat(premake.esc(path.translate(e.libdirs,'\\\\')),\";\"))local i=premake.findfile(e,\".def\")if i then\n_p(4,'ModuleDefinitionFile=\"%s\"',i)end\nif e.flags.NoManifest then\n_p(4,'GenerateManifest=\"%s\"',n(false))end\n_p(4,'GenerateDebugInformation=\"%s\"',n(o.Symbols(e)~=0))if o." + "Symbols(e)~=0 then\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"',path.getbasename(e.buildtarget.name))end\n_p(4,'SubSystem=\"%s\"',iif(e.kind==\"ConsoleApp\",1,2))if o.optimization(e)~=0 then\n_p(4,'OptimizeReferences=\"2\"')_p(4,'EnableCOMDATFolding=\"2\"')end\nif(e.kind==\"ConsoleApp\"or e.kind==\"WindowedApp\")and not e.flags.WinMain then\n_p(4,'EntryPointSymbol=\"%s\"',iif(e.flags.Unicode,\"wmainCRTStartup\",\"mainCRTStartup\"))end\nif e.kind==\"SharedLib\"then\nlocal o=e.linktarget.fullpath\n_p(4,'ImportLibrary=\"%s\"',iif(e.flags.NoImportLib,e.objectsdir..\"\\\\\"..path.getname(o),o))end\n_p(4,'TargetMachine=\"%d\"',iif(e.platform==\"x64\",17,1))else\n_p(4,'Name=\"VCLibrarianTool\"')if#e.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(e,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',e.buildtarget.name)if#e.libdirs>0 then\n_p(4,'AdditionalLibraryDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.libdirs,\";\"))))end\nlocal o={}" + "if e.platform==\"x32\"then\ntable.insert(o,\"/MACHINE:X86\")elseif e.platform==\"x64\"then\ntable.insert(o,\"/MACHINE:X64\")end\no=table.join(o,e.linkoptions)if#o>0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(o),\" \"))end\nend\n_p(3,'/>')end\nfunction o.VCCLCompilerTool_PS3(e)_p(3,'<Tool')_p(4,'Name=\"VCCLCompilerTool\"')local o=table.join(premake.snc.getcflags(e),premake.snc.getcxxflags(e),e.buildoptions)if not e.flags.NoPCH and e.pchheader then\n_p(4,'UsePrecompiledHeader=\"%s\"',iif(_ACTION<\"vs2005\",3,2))_p(4,'PrecompiledHeaderThrough=\"%s\"',path.getname(e.pchheader))table.insert(o,'--use_pch=\"$(IntDir)/$(TargetName).pch\"')else\n_p(4,'UsePrecompiledHeader=\"%s\"',iif(_ACTION>\"vs2003\"or e.flags.NoPCH,0,2))end\n_p(4,'AdditionalOptions=\"%s\"',premake.esc(table.concat(o,\" \")))if#e.includedirs>0 then\n_p(4,'AdditionalIncludeDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.includedirs,\";\"),'\\\\')))end\nif#e.defines>0 then\n_p(4,'PreprocessorDefinitions=\"%s\"',table.c" + "oncat(premake.esc(e.defines),\";\"))end\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"',path.getbasename(e.buildtarget.name))_p(4,'DebugInformationFormat=\"0\"')_p(4,'CompileAs=\"0\"')_p(3,'/>')end\nfunction o.VCLinkerTool_PS3(e)_p(3,'<Tool')if e.kind~=\"StaticLib\"then\n_p(4,'Name=\"VCLinkerTool\"')local o=table.join(premake.snc.getldflags(e),e.linkoptions)if#o>0 then\n_p(4,'AdditionalOptions=\"%s\"',premake.esc(table.concat(o,\" \")))end\nif#e.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(e,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',e.buildtarget.name)_p(4,'LinkIncremental=\"0\"')_p(4,'AdditionalLibraryDirectories=\"%s\"',table.concat(premake.esc(path.translate(e.libdirs,'\\\\')),\";\"))_p(4,'GenerateManifest=\"%s\"',n(false))_p(4,'ProgramDatabaseFile=\"\"')_p(4,'RandomizedBaseAddress=\"1\"')_p(4,'DataExecutionPrevention=\"0\"')else\n_p(4,'Name=\"VCLibrarianTool\"')local o=table.join(premake.snc.getldflags(e),e.linkoptions)if#o>0 then\n_" + "p(4,'AdditionalOptions=\"%s\"',premake.esc(table.concat(o,\" \")))end\nif#e.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(e,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',e.buildtarget.name)if#e.libdirs>0 then\n_p(4,'AdditionalLibraryDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.libdirs,\";\"))))end\nend\n_p(3,'/>')end\nfunction o.VCResourceCompilerTool(e)_p(3,'<Tool')_p(4,'Name=\"VCResourceCompilerTool\"')if#e.resoptions>0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.resoptions),\" \"))end\nif#e.defines>0 or#e.resdefines>0 then\n_p(4,'PreprocessorDefinitions=\"%s\"',table.concat(premake.esc(table.join(e.defines,e.resdefines)),\";\"))end\nif#e.includedirs>0 or#e.resincludedirs>0 then\nlocal e=table.join(e.includedirs,e.resincludedirs)_p(4,'AdditionalIncludeDirectories=\"%s\"',premake.esc(path.translate(table.concat(e,\";\"),'\\\\')))end\n_p(3,'/>')end\nfunction o.VCManifestTool(o)local e={}for n,o in ipairs(o.files)" + "do\nif path.getextension(o)==\".manifest\"then\ntable.insert(e,o)end\nend\n_p(3,'<Tool')_p(4,'Name=\"VCManifestTool\"')if#e>0 then\n_p(4,'AdditionalManifestFiles=\"%s\"',premake.esc(table.concat(e,\";\")))end\n_p(3,'/>')end\nfunction o.VCMIDLTool(e)_p(3,'<Tool')_p(4,'Name=\"VCMIDLTool\"')if e.platform==\"x64\"then\n_p(4,'TargetEnvironment=\"3\"')end\n_p(3,'/>')end\nfunction o.buildstepsblock(n,e)_p(3,'<Tool')_p(4,'Name=\"%s\"',n)if#e>0 then\n_p(4,'CommandLine=\"%s\"',premake.esc(table.implode(e,\"\",\"\",\"\\r\\n\")))end\n_p(3,'/>')end\no.toolmap={VCCLCompilerTool=o.VCCLCompilerTool,VCCLCompilerTool_PS3=o.VCCLCompilerTool_PS3,VCLinkerTool=o.VCLinkerTool,VCLinkerTool_PS3=o.VCLinkerTool_PS3,VCManifestTool=o.VCManifestTool,VCMIDLTool=o.VCMIDLTool,VCResourceCompilerTool=o.VCResourceCompilerTool,VCPreBuildEventTool=function(e)o.buildstepsblock(\"VCPreBuildEventTool\",e.prebuildcommands)end,VCPreLinkEventTool=function(e)o.buildstepsblock(\"VCPreLinkEventTool\",e.prelinkcommands)end,VCPostBuildEventTool=function(e)o." + "buildstepsblock(\"VCPostBuildEventTool\",e.postbuildcommands)end,}local function t(o,e)if o==\"vs2002\"then\nreturn{\"VCCLCompilerTool\",\"VCCustomBuildTool\",\"VCLinkerTool\",\"VCMIDLTool\",\"VCPostBuildEventTool\",\"VCPreBuildEventTool\",\"VCPreLinkEventTool\",\"VCResourceCompilerTool\",\"VCWebServiceProxyGeneratorTool\",\"VCWebDeploymentTool\"}end\nif o==\"vs2003\"then\nreturn{\"VCCLCompilerTool\",\"VCCustomBuildTool\",\"VCLinkerTool\",\"VCMIDLTool\",\"VCPostBuildEventTool\",\"VCPreBuildEventTool\",\"VCPreLinkEventTool\",\"VCResourceCompilerTool\",\"VCWebServiceProxyGeneratorTool\",\"VCXMLDataGeneratorTool\",\"VCWebDeploymentTool\",\"VCManagedWrapperGeneratorTool\",\"VCAuxiliaryManagedWrapperGeneratorTool\"}end\nif e==\"Xbox360\"then\nreturn{\"VCPreBuildEventTool\",\"VCCustomBuildTool\",\"VCXMLDataGeneratorTool\",\"VCWebServiceProxyGeneratorTool\",\"VCMIDLTool\",\"VCCLCompilerTool\",\"VCManagedResourceCompilerTool\",\"VCResourceCompilerTool\",\"VCPreLinkEventTool\",\"VCLinkerTool\",\"VCALinkTool\",\"VCX360I" + "mageTool\",\"VCBscMakeTool\",\"VCX360DeploymentTool\",\"VCPostBuildEventTool\",\"DebuggerTool\",}end\nif e==\"PS3\"then\nreturn{\"VCPreBuildEventTool\",\"VCCustomBuildTool\",\"VCXMLDataGeneratorTool\",\"VCWebServiceProxyGeneratorTool\",\"VCMIDLTool\",\"VCCLCompilerTool_PS3\",\"VCManagedResourceCompilerTool\",\"VCResourceCompilerTool\",\"VCPreLinkEventTool\",\"VCLinkerTool_PS3\",\"VCALinkTool\",\"VCManifestTool\",\"VCXDCMakeTool\",\"VCBscMakeTool\",\"VCFxCopTool\",\"VCAppVerifierTool\",\"VCWebDeploymentTool\",\"VCPostBuildEventTool\"}else\nreturn{\"VCPreBuildEventTool\",\"VCCustomBuildTool\",\"VCXMLDataGeneratorTool\",\"VCWebServiceProxyGeneratorTool\",\"VCMIDLTool\",\"VCCLCompilerTool\",\"VCManagedResourceCompilerTool\",\"VCResourceCompilerTool\",\"VCPreLinkEventTool\",\"VCLinkerTool\",\"VCALinkTool\",\"VCManifestTool\",\"VCXDCMakeTool\",\"VCBscMakeTool\",\"VCFxCopTool\",\"VCAppVerifierTool\",\"VCWebDeploymentTool\",\"VCPostBuildEventTool\"}end\nend\nfunction o.generate(n)o.header('VisualStudioProject')_p(1,'N" + "ame=\"%s\"',premake.esc(n.name))_p(1,'ProjectGUID=\"{%s}\"',n.uuid)if _ACTION>\"vs2003\"then\n_p(1,'RootNamespace=\"%s\"',n.name)end\n_p(1,'Keyword=\"%s\"',iif(n.flags.Managed,\"ManagedCProj\",\"Win32Proj\"))_p(1,'>')o.Platforms(n)if _ACTION>\"vs2003\"then\n_p(1,'<ToolFiles>')_p(1,'</ToolFiles>')end\n_p(1,'<Configurations>')for e,i in ipairs(n.solution.vstudio_configs)do\nif i.isreal then\nlocal e=premake.getconfig(n,i.src_buildcfg,i.src_platform)o.Configuration(i.name,e)for i,n in ipairs(t(_ACTION,i.src_platform))do\nif o.toolmap[n]then\no.toolmap[n](e)elseif n==\"VCX360DeploymentTool\"then\n_p(3,'<Tool')_p(4,'Name=\"VCX360DeploymentTool\"')_p(4,'DeploymentType=\"0\"')if#e.deploymentoptions>0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.deploymentoptions),\" \"))end\n_p(3,'/>')elseif n==\"VCX360ImageTool\"then\n_p(3,'<Tool')_p(4,'Name=\"VCX360ImageTool\"')if#e.imageoptions>0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.imageoptions),\" \"))end\nif e.imagepath~=nil then" + "\n_p(4,'OutputFileName=\"%s\"',premake.esc(path.translate(e.imagepath)))end\n_p(3,'/>')elseif n==\"DebuggerTool\"then\n_p(3,'<DebuggerTool')_p(3,'/>')else\n_p(3,'<Tool')_p(4,'Name=\"%s\"',n)_p(3,'/>')end\nend\n_p(2,'</Configuration>')end\nend\n_p(1,'</Configurations>')_p(1,'<References>')_p(1,'</References>')_p(1,'<Files>')o.Files(n)_p(1,'</Files>')_p(1,'<Globals>')_p(1,'</Globals>')_p('</VisualStudioProject>')end", /* actions/vstudio/vs200x_vcproj_user.lua */ "local e=premake.vstudio.vc200x\nfunction e.generate_user(i)e.header('VisualStudioUserFile')_p(1,'ShowAllFiles=\"false\"')_p(1,'>')_p(1,'<Configurations>')for r,n in ipairs(i.solution.vstudio_configs)do\nif n.isreal then\nlocal i=premake.getconfig(i,n.src_buildcfg,n.src_platform)_p(2,'<Configuration')_p(3,'Name=\"%s\"',premake.esc(n.name))_p(3,'>')e.debugdir(i)_p(2,'</Configuration>')end\nend\n_p(1,'</Configurations>')_p('</VisualStudioUserFile>')end\nfunction e.environmentargs(e)if e.environmentargs and#e.environmentargs>0 then\n_p(4,'Environment=\"%s\"',string.gsub(table.concat(e.environmentargs,\"
\"),'\"','"'))if e.flags.EnvironmentArgsDontMerge then\n_p(4,'EnvironmentMerge=\"false\"')end\nend\nend\nfunction e.debugdir(n)_p(3,'<DebugSettings')if n.debugdir then\n_p(4,'WorkingDirectory=\"%s\"',path.translate(n.debugdir,'\\\\'))end\nif#n.debugargs>0 then\n_p(4,'CommandArguments=\"%s\"',table.concat(n.debugargs,\" \"))end\ne.environmentargs(n)_p(3,'/>')end", @@ -226,20 +226,21 @@ const char* builtin_scripts[] = { "local e=premake.vstudio.cs2005\nfunction e.generate_user(e)io.eol=\"\\r\\n\"_p('<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">')_p(' <PropertyGroup>')local e=table.translate(e.libdirs,function(t)return path.getabsolute(e.location..\"/\"..t)end)_p(' <ReferencePath>%s</ReferencePath>',path.translate(table.concat(e,\";\"),\"\\\\\"))_p(' </PropertyGroup>')_p('</Project>')end", /* actions/vstudio/vs2010_vcxproj.lua */ - "premake.vstudio.vc2010={}local e=premake.vstudio.vc2010\nlocal s=premake.vstudio\nlocal function p(e)_p(1,'<ItemGroup Label=\"ProjectConfigurations\">')for n,e in ipairs(e.solution.vstudio_configs)do\n_p(2,'<ProjectConfiguration Include=\"%s\">',premake.esc(e.name))_p(3,'<Configuration>%s</Configuration>',e.buildcfg)_p(3,'<Platform>%s</Platform>',e.platform)_p(2,'</ProjectConfiguration>')end\n_p(1,'</ItemGroup>')end\nlocal function d(e)_p(1,'<PropertyGroup Label=\"Globals\">')_p(2,'<ProjectGuid>{%s}</ProjectGuid>',e.uuid)_p(2,'<RootNamespace>%s</RootNamespace>',e.name)if e.flags and e.flags.Managed then\n_p(2,'<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>')_p(2,'<Keyword>ManagedCProj</Keyword>')else\n_p(2,'<Keyword>Win32Proj</Keyword>')end\n_p(1,'</PropertyGroup>')end\nfunction e.config_type(e)local n={SharedLib=\"DynamicLibrary\",StaticLib=\"StaticLibrary\",ConsoleApp=\"Application\",WindowedApp=\"Application\"}return n[e.kind]end\nlocal function i()return\"Condition=\\\"'$(Configuration)|$(Platform)'" + "premake.vstudio.vc2010={}local e=premake.vstudio.vc2010\nlocal p=premake.vstudio\nlocal function l(e)_p(1,'<ItemGroup Label=\"ProjectConfigurations\">')for n,e in ipairs(e.solution.vstudio_configs)do\n_p(2,'<ProjectConfiguration Include=\"%s\">',premake.esc(e.name))_p(3,'<Configuration>%s</Configuration>',e.buildcfg)_p(3,'<Platform>%s</Platform>',e.platform)_p(2,'</ProjectConfiguration>')end\n_p(1,'</ItemGroup>')end\nlocal function s(e)_p(1,'<PropertyGroup Label=\"Globals\">')_p(2,'<ProjectGuid>{%s}</ProjectGuid>',e.uuid)_p(2,'<RootNamespace>%s</RootNamespace>',e.name)if e.flags and e.flags.Managed then\n_p(2,'<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>')_p(2,'<Keyword>ManagedCProj</Keyword>')else\n_p(2,'<Keyword>Win32Proj</Keyword>')end\n_p(1,'</PropertyGroup>')end\nfunction e.config_type(e)local n={SharedLib=\"DynamicLibrary\",StaticLib=\"StaticLibrary\",ConsoleApp=\"Application\",WindowedApp=\"Application\"}return n[e.kind]end\nlocal function i()return\"Condition=\\\"'$(Configuration)|$(Platform)'" "=='%s'\\\"\"end\nlocal function o(n)local e=\"Disabled\"for i,n in ipairs(n.flags)do\nif(n==\"Optimize\")then\ne=\"Full\"elseif(n==\"OptimizeSize\")then\ne=\"MinSpace\"elseif(n==\"OptimizeSpeed\")then\ne=\"MaxSpeed\"end\nend\nreturn e\nend\nfunction e.configurationPropertyGroup(n,t)_p(1,'<PropertyGroup '..i()..' Label=\"Configuration\">',premake.esc(t.name))_p(2,'<ConfigurationType>%s</ConfigurationType>',e.config_type(n))_p(2,'<UseDebugLibraries>%s</UseDebugLibraries>',iif(o(n)==\"Disabled\",\"true\",\"false\"))_p(2,'<CharacterSet>%s</CharacterSet>',iif(n.flags.Unicode,\"Unicode\",\"MultiByte\"))local e={vs2012=\"v110\",vs2013=\"v120\",vs2015=\"v140\",vs2017=\"v141\"}local e=e[_ACTION]if e then\n_p(2,'<PlatformToolset>%s</PlatformToolset>',e)end\nif n.flags.MFC then\n_p(2,'<UseOfMfc>%s</UseOfMfc>',iif(n.flags.StaticRuntime,\"Static\",\"Dynamic\"))end\nif n.flags.ATL or n.flags.StaticATL then\n_p(2,'<UseOfAtl>%s</UseOfAtl>',iif(n.flags.StaticATL,\"Static\",\"Dynamic\"))end\nif n.flags.Managed then\n_p(2,'<CLRS" - "upport>true</CLRSupport>')end\n_p(1,'</PropertyGroup>')end\nlocal function a(n)for t,e in ipairs(n.solution.vstudio_configs)do\nlocal n=premake.getconfig(n,e.src_buildcfg,e.src_platform)_p(1,'<ImportGroup '..i()..' Label=\"PropertySheets\">',premake.esc(e.name))_p(2,'<Import Project=\"$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists(\\'$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\\')\" Label=\"LocalAppDataPlatform\" />')_p(1,'</ImportGroup>')end\nend\nfunction e.outputProperties(e)for n,t in ipairs(e.solution.vstudio_configs)do\nlocal e=premake.getconfig(e,t.src_buildcfg,t.src_platform)local n=e.buildtarget\n_p(1,'<PropertyGroup '..i()..'>',premake.esc(t.name))_p(2,'<OutDir>%s\\\\</OutDir>',premake.esc(n.directory))if e.platform==\"Xbox360\"then\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',premake.esc(n.name))end\n_p(2,'<IntDir>%s\\\\</IntDir>',premake.esc(e.objectsdir))_p(2,'<TargetName>%s</TargetName>',premake.esc(path.getbasename(n.name)))_p(2,'<TargetExt>%s</TargetExt>'" - ",premake.esc(path.getextension(n.name)))if e.kind==\"SharedLib\"then\nlocal e=(e.flags.NoImportLib~=nil)_p(2,'<IgnoreImportLibrary>%s</IgnoreImportLibrary>',tostring(e))end\nif e.kind~=\"StaticLib\"then\n_p(2,'<LinkIncremental>%s</LinkIncremental>',tostring(premake.config.isincrementallink(e)))end\nif e.flags.NoManifest then\n_p(2,'<GenerateManifest>false</GenerateManifest>')end\n_p(1,'</PropertyGroup>')end\nend\nlocal function f(i)local n\nlocal e=i.flags\nif premake.config.isdebugbuild(i)then\nn=iif(e.StaticRuntime and not e.Managed,\"MultiThreadedDebug\",\"MultiThreadedDebugDLL\")else\nn=iif(e.StaticRuntime and not e.Managed,\"MultiThreaded\",\"MultiThreadedDLL\")end\nreturn n\nend\nlocal function c(e)if not e.flags.NoPCH and e.pchheader then\n_p(3,'<PrecompiledHeader>Use</PrecompiledHeader>')_p(3,'<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>',e.pchheader)else\n_p(3,'<PrecompiledHeader></PrecompiledHeader>')end\nend\nlocal function t(n,e)if#e.defines>0 then\n_p(n,'<PreprocessorDefinitions>%s;%%(Preproc" - "essorDefinitions)</PreprocessorDefinitions>',premake.esc(table.concat(e.defines,\";\")))else\n_p(n,'<PreprocessorDefinitions></PreprocessorDefinitions>')end\nend\nlocal function P(n,e)if#e.includedirs>0 then\n_p(n,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>',premake.esc(path.translate(table.concat(e.includedirs,\";\"),'\\\\')))end\nend\nlocal function n(n,e)if#e.includedirs>0 or#e.resincludedirs>0 then\nlocal e=table.join(e.includedirs,e.resincludedirs)_p(n,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>',premake.esc(path.translate(table.concat(e,\";\"),'\\\\')))end\nend\nlocal function g(e)_p(2,'<ResourceCompile>')t(3,e)n(3,e)_p(2,'</ResourceCompile>')end\nlocal function m(e)if e.flags.NoExceptions then\n_p(2,'<ExceptionHandling>false</ExceptionHandling>')elseif e.flags.SEH then\n_p(2,'<ExceptionHandling>Async</ExceptionHandling>')end\nend\nlocal function u(e)if e.flags.NoRTTI and not e.flags.Managed then\n" - "_p(3,'<RuntimeTypeInfo>false</RuntimeTypeInfo>')end\nend\nlocal function _(e)if e.flags.NativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>')elseif e.flags.NoNativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>')end\nend\nlocal function C(e)if e.flags.EnableSSE then\n_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>')elseif e.flags.EnableSSE2 then\n_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>')end\nend\nlocal function l(e)if e.flags.FloatFast then\n_p(3,'<FloatingPointModel>Fast</FloatingPointModel>')elseif e.flags.FloatStrict and not e.flags.Managed then\n_p(3,'<FloatingPointModel>Strict</FloatingPointModel>')end\nend\nlocal function r(e)local n=''if e.flags.Symbols then\nif e.platform==\"x64\"or e.flags.Managed\nor premake.config.isoptimizedbuild(e.flags)or e.flags.NoEditAndContinue\nthen\nn=\"ProgramDatabase\"else\nn=\"EditAndContinue\"end\nend\n_p(3,'<Debug" - "InformationFormat>%s</DebugInformationFormat>',n)end\nlocal function h(e)if premake.config.isdebugbuild(e)and not e.flags.NoMinimalRebuild then\n_p(3,'<MinimalRebuild>true</MinimalRebuild>')else\n_p(3,'<MinimalRebuild>false</MinimalRebuild>')end\nend\nlocal function n(e)if e.language==\"C\"then\n_p(3,'<CompileAs>CompileAsC</CompileAs>')end\nend\nlocal function b(e)_p(2,'<ClCompile>')if#e.buildoptions>0 then\n_p(3,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',table.concat(premake.esc(e.buildoptions),\" \"))end\n_p(3,'<Optimization>%s</Optimization>',o(e))P(3,e)t(3,e)h(e)if not premake.config.isoptimizedbuild(e.flags)then\nif not e.flags.Managed then\n_p(3,'<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>')end\nif e.flags.ExtraWarnings then\n_p(3,'<SmallerTypeCheck>true</SmallerTypeCheck>')end\nelse\n_p(3,'<StringPooling>true</StringPooling>')end\n_p(3,'<RuntimeLibrary>%s</RuntimeLibrary>',f(e))_p(3,'<FunctionLevelLinking>true</FunctionLevelLinking>')c(e)if e.flags.ExtraWarnings then" - "\n_p(3,'<WarningLevel>Level4</WarningLevel>')else\n_p(3,'<WarningLevel>Level3</WarningLevel>')end\nif e.flags.FatalWarnings then\n_p(3,'<TreatWarningAsError>true</TreatWarningAsError>')end\nm(e)u(e)_(e)C(e)l(e)r(e)if e.flags.Symbols then\n_p(3,'<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>',path.getbasename(e.buildtarget.name))end\nif e.flags.NoFramePointer then\n_p(3,'<OmitFramePointers>true</OmitFramePointers>')end\nn(e)_p(2,'</ClCompile>')end\nlocal function r(e)if#e.postbuildcommands>0 then\n_p(2,'<PostBuildEvent>')_p(3,'<Command>%s</Command>',premake.esc(table.implode(e.postbuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'</PostBuildEvent>')end\nif#e.prebuildcommands>0 then\n_p(2,'<PreBuildEvent>')_p(3,'<Command>%s</Command>',premake.esc(table.implode(e.prebuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'</PreBuildEvent>')end\nif#e.prelinkcommands>0 then\n_p(2,'<PreLinkEvent>')_p(3,'<Command>%s</Command>',premake.esc(table.implode(e.prelinkcommands,\"\",\"\",\"\\r\\n\")))_p(2,'</PreLinkEvent>')en" - "d\nend\nlocal function o(n,e)if#e.linkoptions>0 then\n_p(n,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',table.concat(premake.esc(e.linkoptions),\" \"))end\nend\nlocal function t(i,e)local n={x32='MachineX86',x64='MachineX64'}if n[e.platform]then\n_p(i,'<TargetMachine>%s</TargetMachine>',n[e.platform])end\nend\nlocal function c(e)if e.kind=='StaticLib'and e.platform~=\"Xbox360\"then\n_p(1,'<Lib>')_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',e.buildtarget.name)o(2,e)t(2,e)_p(1,'</Lib>')end\nend\nlocal function l(e)if e.kind==\"SharedLib\"then\nlocal n=e.linktarget.fullpath\n_p(3,'<ImportLibrary>%s</ImportLibrary>',iif(e.flags.NoImportLib,e.objectsdir..\"\\\\\"..path.getname(n),n))end\nend\nfunction e.link(n)_p(2,'<Link>')_p(3,'<SubSystem>%s</SubSystem>',iif(n.kind==\"ConsoleApp\",\"Console\",\"Windows\"))_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>',tostring(n.flags.Symbols~=nil))if premake.config.isoptimizedbuild(n.flags)then\n_p(3,'<EnableCOMDATFolding>true</EnableCOMDATFol" - "ding>')_p(3,'<OptimizeReferences>true</OptimizeReferences>')end\nif n.kind~='StaticLib'then\ne.additionalDependencies(n)_p(3,'<OutputFile>$(OutDir)%s</OutputFile>',n.buildtarget.name)if#n.libdirs>0 then\n_p(3,'<AdditionalLibraryDirectories>%s;%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>',premake.esc(path.translate(table.concat(n.libdirs,';'),'\\\\')))end\nif e.config_type(n)=='Application'and not n.flags.WinMain and not n.flags.Managed then\n_p(3,'<EntryPointSymbol>%s</EntryPointSymbol>',iif(n.flags.Unicode,\"wmainCRTStartup\",\"mainCRTStartup\"))end\nl(n)local e=premake.findfile(n,\".def\")if e then\n_p(3,'<ModuleDefinitionFile>%s</ModuleDefinitionFile>',e)end\nt(3,n)o(3,n)end\n_p(2,'</Link>')end\nfunction e.additionalDependencies(e)local e=premake.getlinks(e,\"system\",\"fullpath\")if#e>0 then\n_p(3,'<AdditionalDependencies>%s;%%(AdditionalDependencies)</AdditionalDependencies>',table.concat(e,\";\"))end\nend\nlocal function l(n)for o,t in ipairs(n.solution.vstudio_configs)do\nlocal n=prem" - "ake.getconfig(n,t.src_buildcfg,t.src_platform)_p(1,'<ItemDefinitionGroup '..i()..'>',premake.esc(t.name))b(n)g(n)c(n)e.link(n)r(n)_p(1,'</ItemDefinitionGroup>')end\nend\nfunction e.getfilegroup(i,t)local e=i.vc2010sortedfiles\nif not e then\ne={ClCompile={},ClInclude={},None={},ResourceCompile={},}for n in premake.project.eachfile(i)do\nif path.iscppfile(n.name)then\ntable.insert(e.ClCompile,n)elseif path.iscppheader(n.name)then\ntable.insert(e.ClInclude,n)elseif path.isresourcefile(n.name)then\ntable.insert(e.ResourceCompile,n)else\ntable.insert(e.None,n)end\nend\ni.vc2010sortedfiles=e\nend\nreturn e[t]end\nfunction e.files(n)e.simplefilesgroup(n,\"ClInclude\")e.compilerfilesgroup(n)e.simplefilesgroup(n,\"None\")e.simplefilesgroup(n,\"ResourceCompile\")end\nfunction e.simplefilesgroup(i,n)local e=e.getfilegroup(i,n)if#e>0 then\n_p(1,'<ItemGroup>')for i,e in ipairs(e)do\n_p(2,'<%s Include=\"%s\" />',n,path.translate(e.name,\"\\\\\"))end\n_p(1,'</ItemGroup>')end\nend\nfunction e.compilerfilesgroup(n)local t=n.s" - "olution.vstudio_configs\nlocal o=e.getfilegroup(n,\"ClCompile\")if#o>0 then\nlocal e={}for t,i in ipairs(t)do\nlocal n=premake.getconfig(n,i.src_buildcfg,i.src_platform)if n.pchheader and n.pchsource and not n.flags.NoPCH then\ne[i]=path.translate(n.pchsource,\"\\\\\")end\nend\n_p(1,'<ItemGroup>')for o,n in ipairs(o)do\nlocal o=path.translate(n.name,\"\\\\\")_p(2,'<ClCompile Include=\"%s\">',o)for t,n in ipairs(t)do\nif e[n]and o==e[n]then\n_p(3,'<PrecompiledHeader '..i()..'>Create</PrecompiledHeader>',premake.esc(n.name))e[n]=nil\nend\nend\n_p(2,'</ClCompile>')end\n_p(1,'</ItemGroup>')end\nend\nfunction e.header(e)io.eol=\"\\r\\n\"_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')local n=\"\"if e then\nn=' DefaultTargets=\"'..e..'\"'end\n_p('<Project%s ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">',n)end\nfunction premake.vs2010_vcxproj(n)io.indent=\" \"e.header(\"Build\")p(n)d(n)_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />')for t,i in ipair" - "s(n.solution.vstudio_configs)do\nlocal n=premake.getconfig(n,i.src_buildcfg,i.src_platform)e.configurationPropertyGroup(n,i)end\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />')_p(1,'<ImportGroup Label=\"ExtensionSettings\">')_p(1,'</ImportGroup>')a(n)_p(1,'<PropertyGroup Label=\"UserMacros\" />')e.outputProperties(n)l(n)e.files(n)e.projectReferences(n)_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />')_p(1,'<ImportGroup Label=\"ExtensionTargets\">')_p(1,'</ImportGroup>')_p('</Project>')end\nfunction e.projectReferences(n)local e=premake.getdependencies(n)if#e>0 then\n_p(1,'<ItemGroup>')for i,e in ipairs(e)do\nlocal n=path.getrelative(n.location,s.projectfile(e))_p(2,'<ProjectReference Include=\"%s\">',path.translate(n,\"\\\\\"))_p(3,'<Project>{%s}</Project>',e.uuid)_p(2,'</ProjectReference>')end\n_p(1,'</ItemGroup>')end\nend\nfunction e.debugdir(e)if e.debugdir then\n_p(' <LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDirectory>',path.translate(e.debugdir," - "'\\\\'))_p(' <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>')end\nif e.debugargs then\n_p(' <LocalDebuggerCommandArguments>%s</LocalDebuggerCommandArguments>',table.concat(e.debugargs,\" \"))end\nend\nfunction e.debugenvs(e)if e.debugenvs and#e.debugenvs>0 then\n_p(2,'<LocalDebuggerEnvironment>%s%s</LocalDebuggerEnvironment>',table.concat(e.debugenvs,\"\\n\"),iif(e.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)',''))if e.flags.DebugEnvsDontMerge then\n_p(2,'<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>')end\nend\nend\nfunction premake.vs2010_vcxproj_user(t)io.indent=\" \"e.header()for o,n in ipairs(t.solution.vstudio_configs)do\nlocal t=premake.getconfig(t,n.src_buildcfg,n.src_platform)_p(' <PropertyGroup '..i()..'>',premake.esc(n.name))e.debugdir(t)e.debugenvs(t)_p(' </PropertyGroup>')end\n_p('</Project>')end", + "upport>true</CLRSupport>')end\n_p(1,'</PropertyGroup>')end\nlocal function r(n)for t,e in ipairs(n.solution.vstudio_configs)do\nlocal n=premake.getconfig(n,e.src_buildcfg,e.src_platform)_p(1,'<ImportGroup '..i()..' Label=\"PropertySheets\">',premake.esc(e.name))_p(2,'<Import Project=\"$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists(\\'$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\\')\" Label=\"LocalAppDataPlatform\" />')_p(1,'</ImportGroup>')end\nend\nfunction e.outputProperties(e)for n,t in ipairs(e.solution.vstudio_configs)do\nlocal e=premake.getconfig(e,t.src_buildcfg,t.src_platform)local n=e.buildtarget\n_p(1,'<PropertyGroup '..i()..'>',premake.esc(t.name))_p(2,'<OutDir>%s\\\\</OutDir>',premake.esc(n.directory))if e.platform==\"Xbox360\"then\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',premake.esc(n.name))end\n_p(2,'<IntDir>%s\\\\</IntDir>',premake.esc(e.objectsdir))_p(2,'<TargetName>%s</TargetName>',premake.esc(path.getbasename(n.name)))_p(2,'<TargetExt>%s</TargetExt>'" + ",premake.esc(path.getextension(n.name)))if e.kind==\"SharedLib\"then\nlocal e=(e.flags.NoImportLib~=nil)_p(2,'<IgnoreImportLibrary>%s</IgnoreImportLibrary>',tostring(e))end\nif e.kind~=\"StaticLib\"then\n_p(2,'<LinkIncremental>%s</LinkIncremental>',tostring(premake.config.isincrementallink(e)))end\nif e.flags.NoManifest then\n_p(2,'<GenerateManifest>false</GenerateManifest>')end\n_p(1,'</PropertyGroup>')end\nend\nlocal function d(i)local n\nlocal e=i.flags\nif premake.config.isdebugbuild(i)then\nn=iif(e.StaticRuntime and not e.Managed,\"MultiThreadedDebug\",\"MultiThreadedDebugDLL\")else\nn=iif(e.StaticRuntime and not e.Managed,\"MultiThreaded\",\"MultiThreadedDLL\")end\nreturn n\nend\nlocal function f(e)if not e.flags.NoPCH and e.pchheader then\n_p(3,'<PrecompiledHeader>Use</PrecompiledHeader>')_p(3,'<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>',e.pchheader)else\n_p(3,'<PrecompiledHeader></PrecompiledHeader>')end\nend\nlocal function t(n,e)if#e.defines>0 then\n_p(n,'<PreprocessorDefinitions>%s;%%(Preproc" + "essorDefinitions)</PreprocessorDefinitions>',premake.esc(table.concat(e.defines,\";\")))else\n_p(n,'<PreprocessorDefinitions></PreprocessorDefinitions>')end\nend\nlocal function P(n,e)if#e.includedirs>0 then\n_p(n,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>',premake.esc(path.translate(table.concat(e.includedirs,\";\"),'\\\\')))end\nend\nlocal function n(n,e)if#e.includedirs>0 or#e.resincludedirs>0 then\nlocal e=table.join(e.includedirs,e.resincludedirs)_p(n,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>',premake.esc(path.translate(table.concat(e,\";\"),'\\\\')))end\nend\nlocal function h(e)_p(2,'<ResourceCompile>')t(3,e)n(3,e)_p(2,'</ResourceCompile>')end\nlocal function u(e)if e.flags.NoExceptions then\n_p(2,'<ExceptionHandling>false</ExceptionHandling>')elseif e.flags.SEH then\n_p(2,'<ExceptionHandling>Async</ExceptionHandling>')end\nend\nlocal function c(e)if e.flags.NoRTTI and not e.flags.Managed then\n" + "_p(3,'<RuntimeTypeInfo>false</RuntimeTypeInfo>')end\nend\nlocal function m(e)if e.flags.NativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>')elseif e.flags.NoNativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>')end\nend\nlocal function g(e)if e.flags.EnableSSE then\n_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>')elseif e.flags.EnableSSE2 then\n_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>')end\nend\nlocal function b(e)if e.flags.FloatFast then\n_p(3,'<FloatingPointModel>Fast</FloatingPointModel>')elseif e.flags.FloatStrict and not e.flags.Managed then\n_p(3,'<FloatingPointModel>Strict</FloatingPointModel>')end\nend\nlocal function a(e)local n=''if e.flags.Symbols then\nif e.platform==\"x64\"or e.flags.Managed\nor premake.config.isoptimizedbuild(e.flags)or e.flags.NoEditAndContinue\nthen\nn=\"ProgramDatabase\"else\nn=\"EditAndContinue\"end\nend\n_p(3,'<Debug" + "InformationFormat>%s</DebugInformationFormat>',n)end\nlocal function n(e)if premake.config.isdebugbuild(e)and not e.flags.NoMinimalRebuild then\n_p(3,'<MinimalRebuild>true</MinimalRebuild>')else\n_p(3,'<MinimalRebuild>false</MinimalRebuild>')end\nend\nlocal function _(e)if e.language==\"C\"then\n_p(3,'<CompileAs>CompileAsC</CompileAs>')end\nend\nlocal function C(e)_p(2,'<ClCompile>')if#e.buildoptions>0 then\n_p(3,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',table.concat(premake.esc(e.buildoptions),\" \"))end\n_p(3,'<Optimization>%s</Optimization>',o(e))P(3,e)t(3,e)n(e)if not premake.config.isoptimizedbuild(e.flags)then\nif not e.flags.Managed then\n_p(3,'<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>')end\nif e.flags.ExtraWarnings then\n_p(3,'<SmallerTypeCheck>true</SmallerTypeCheck>')end\nelse\n_p(3,'<StringPooling>true</StringPooling>')end\n_p(3,'<RuntimeLibrary>%s</RuntimeLibrary>',d(e))_p(3,'<FunctionLevelLinking>true</FunctionLevelLinking>')f(e)if e.flags.ExtraWarnings then" + "\n_p(3,'<WarningLevel>Level4</WarningLevel>')else\n_p(3,'<WarningLevel>Level3</WarningLevel>')end\nif e.flags.FatalWarnings then\n_p(3,'<TreatWarningAsError>true</TreatWarningAsError>')end\nu(e)c(e)m(e)g(e)b(e)a(e)if e.flags.Symbols then\n_p(3,'<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>',path.getbasename(e.buildtarget.name))end\nif e.flags.NoFramePointer then\n_p(3,'<OmitFramePointers>true</OmitFramePointers>')end\n_(e)_p(2,'</ClCompile>')end\nlocal function c(e)if#e.postbuildcommands>0 then\n_p(2,'<PostBuildEvent>')_p(3,'<Command>%s</Command>',premake.esc(table.implode(e.postbuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'</PostBuildEvent>')end\nif#e.prebuildcommands>0 then\n_p(2,'<PreBuildEvent>')_p(3,'<Command>%s</Command>',premake.esc(table.implode(e.prebuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'</PreBuildEvent>')end\nif#e.prelinkcommands>0 then\n_p(2,'<PreLinkEvent>')_p(3,'<Command>%s</Command>',premake.esc(table.implode(e.prelinkcommands,\"\",\"\",\"\\r\\n\")))_p(2,'</PreLinkEvent>')en" + "d\nend\nlocal function o(n,e)if#e.linkoptions>0 then\n_p(n,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',table.concat(premake.esc(e.linkoptions),\" \"))end\nend\nlocal function t(i,e)local n={x32='MachineX86',x64='MachineX64'}if n[e.platform]then\n_p(i,'<TargetMachine>%s</TargetMachine>',n[e.platform])end\nend\nlocal function a(e)if e.kind=='StaticLib'and e.platform~=\"Xbox360\"then\n_p(1,'<Lib>')_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',e.buildtarget.name)o(2,e)t(2,e)_p(1,'</Lib>')end\nend\nlocal function d(e)if e.kind==\"SharedLib\"then\nlocal n=e.linktarget.fullpath\n_p(3,'<ImportLibrary>%s</ImportLibrary>',iif(e.flags.NoImportLib,e.objectsdir..\"\\\\\"..path.getname(n),n))end\nend\nfunction e.link(n)_p(2,'<Link>')_p(3,'<SubSystem>%s</SubSystem>',iif(n.kind==\"ConsoleApp\",\"Console\",\"Windows\"))_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>',tostring(n.flags.Symbols~=nil))if premake.config.isoptimizedbuild(n.flags)then\n_p(3,'<EnableCOMDATFolding>true</EnableCOMDATFol" + "ding>')_p(3,'<OptimizeReferences>true</OptimizeReferences>')end\nif n.kind~='StaticLib'then\ne.additionalDependencies(n)_p(3,'<OutputFile>$(OutDir)%s</OutputFile>',n.buildtarget.name)if#n.libdirs>0 then\n_p(3,'<AdditionalLibraryDirectories>%s;%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>',premake.esc(path.translate(table.concat(n.libdirs,';'),'\\\\')))end\nif e.config_type(n)=='Application'and not n.flags.WinMain and not n.flags.Managed then\n_p(3,'<EntryPointSymbol>%s</EntryPointSymbol>',iif(n.flags.Unicode,\"wmainCRTStartup\",\"mainCRTStartup\"))end\nd(n)local e=premake.findfile(n,\".def\")if e then\n_p(3,'<ModuleDefinitionFile>%s</ModuleDefinitionFile>',e)end\nt(3,n)o(3,n)end\n_p(2,'</Link>')end\nfunction e.additionalDependencies(e)local e=premake.getlinks(e,\"system\",\"fullpath\")if#e>0 then\n_p(3,'<AdditionalDependencies>%s;%%(AdditionalDependencies)</AdditionalDependencies>',table.concat(e,\";\"))end\nend\nlocal function d(n)for o,t in ipairs(n.solution.vstudio_configs)do\nlocal n=prem" + "ake.getconfig(n,t.src_buildcfg,t.src_platform)_p(1,'<ItemDefinitionGroup '..i()..'>',premake.esc(t.name))C(n)h(n)a(n)e.link(n)c(n)_p(1,'</ItemDefinitionGroup>')end\nend\nfunction e.getfilegroup(i,t)local e=i.vc2010sortedfiles\nif not e then\ne={ClCompile={},ClInclude={},None={},ResourceCompile={},}for n in premake.project.eachfile(i)do\nif path.iscppfile(n.name)then\ntable.insert(e.ClCompile,n)elseif path.iscppheader(n.name)then\ntable.insert(e.ClInclude,n)elseif path.isresourcefile(n.name)then\ntable.insert(e.ResourceCompile,n)else\ntable.insert(e.None,n)end\nend\ni.vc2010sortedfiles=e\nend\nreturn e[t]end\nfunction e.files(n)e.simplefilesgroup(n,\"ClInclude\")e.compilerfilesgroup(n)e.simplefilesgroup(n,\"None\")e.simplefilesgroup(n,\"ResourceCompile\")end\nfunction e.simplefilesgroup(i,n)local e=e.getfilegroup(i,n)if#e>0 then\n_p(1,'<ItemGroup>')for i,e in ipairs(e)do\n_p(2,'<%s Include=\"%s\" />',n,path.translate(e.name,\"\\\\\"))end\n_p(1,'</ItemGroup>')end\nend\nfunction e.individualSourceFile(a,t,n)local" + " e=a.solution.vstudio_configs\nlocal o=path.translate(n.name,\"\\\\\")_p(2,'<ClCompile Include=\"%s\">',o)for n,e in ipairs(e)do\nif t[e]and o==t[e]then\n_p(3,'<PrecompiledHeader '..i()..'>Create</PrecompiledHeader>',premake.esc(e.name))t[e]=nil\nend\nend\nif path.iscfile(n.name)~=premake.project.iscproject(a)then\n_p(3,'<CompileAs>%s</CompileAs>',iif(path.iscfile(n.name),'CompileAsC','CompileAsCpp'))end\n_p(2,'</ClCompile>')end\nfunction e.compilerfilesgroup(n)local i=n.solution.vstudio_configs\nlocal o=e.getfilegroup(n,\"ClCompile\")if#o>0 then\nlocal t={}for e,i in ipairs(i)do\nlocal e=premake.getconfig(n,i.src_buildcfg,i.src_platform)if e.pchheader and e.pchsource and not e.flags.NoPCH then\nt[i]=path.translate(e.pchsource,\"\\\\\")end\nend\n_p(1,'<ItemGroup>')for o,i in ipairs(o)do\ne.individualSourceFile(n,t,i)end\n_p(1,'</ItemGroup>')end\nend\nfunction e.header(n)io.eol=\"\\r\\n\"_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')local e=\"\"if n then\ne=' DefaultTargets=\"'..n..'\"'end\n_p('<Project%s Too" + "lsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">',e)end\nfunction premake.vs2010_vcxproj(n)io.indent=\" \"e.header(\"Build\")l(n)s(n)_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />')for t,i in ipairs(n.solution.vstudio_configs)do\nlocal n=premake.getconfig(n,i.src_buildcfg,i.src_platform)e.configurationPropertyGroup(n,i)end\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />')_p(1,'<ImportGroup Label=\"ExtensionSettings\">')_p(1,'</ImportGroup>')r(n)_p(1,'<PropertyGroup Label=\"UserMacros\" />')e.outputProperties(n)d(n)e.files(n)e.projectReferences(n)_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />')_p(1,'<ImportGroup Label=\"ExtensionTargets\">')_p(1,'</ImportGroup>')_p('</Project>')end\nfunction e.projectReferences(n)local e=premake.getdependencies(n)if#e>0 then\n_p(1,'<ItemGroup>')for i,e in ipairs(e)do\nlocal n=path.getrelative(n.location,p.projectfile(e))_p(2,'<ProjectReference Include=\"%s\">',path.trans" + "late(n,\"\\\\\"))_p(3,'<Project>{%s}</Project>',e.uuid)_p(2,'</ProjectReference>')end\n_p(1,'</ItemGroup>')end\nend\nfunction e.debugdir(e)if e.debugdir then\n_p(' <LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDirectory>',path.translate(e.debugdir,'\\\\'))_p(' <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>')end\nif e.debugargs then\n_p(' <LocalDebuggerCommandArguments>%s</LocalDebuggerCommandArguments>',table.concat(e.debugargs,\" \"))end\nend\nfunction e.debugenvs(e)if e.debugenvs and#e.debugenvs>0 then\n_p(2,'<LocalDebuggerEnvironment>%s%s</LocalDebuggerEnvironment>',table.concat(e.debugenvs,\"\\n\"),iif(e.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)',''))if e.flags.DebugEnvsDontMerge then\n_p(2,'<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>')end\nend\nend\nfunction premake.vs2010_vcxproj_user(t)io.indent=\" \"e.header()for o,n in ipairs(t.solution.vstudio_configs)do\nlocal t=premake.getconfig(t,n.src_buildcfg,n.src_platform)_p(' <PropertyGroup '..i" + "()..'>',premake.esc(n.name))e.debugdir(t)e.debugenvs(t)_p(' </PropertyGroup>')end\n_p('</Project>')end", /* actions/vstudio/vs2010_vcxproj_filters.lua */ "local e=premake.vstudio.vc2010\nlocal i=premake.project\nfunction e.filteridgroup(e)local l={}local t=false\nfor e in i.eachfile(e)do\nlocal i=string.explode(e.vpath,\"/\",true)local e=\"\"for n=1,#i-1 do\nif not t then\nt=true\n_p(1,'<ItemGroup>')end\ne=e..i[n]if not l[e]then\nl[e]=true\n_p(2,'<Filter Include=\"%s\">',e)_p(3,'<UniqueIdentifier>{%s}</UniqueIdentifier>',os.uuid())_p(2,'</Filter>')end\ne=e..\"\\\\\"end\nend\nif t then\n_p(1,'</ItemGroup>')end\nend\nfunction e.filefiltergroup(l,t)local e=e.getfilegroup(l,t)if#e>0 then\n_p(1,'<ItemGroup>')for l,e in ipairs(e)do\nlocal l\nif e.name~=e.vpath then\nl=path.getdirectory(e.vpath)else\nl=path.getdirectory(e.name)end\nif l~=\".\"then\n_p(2,'<%s Include=\"%s\">',t,path.translate(e.name,\"\\\\\"))_p(3,'<Filter>%s</Filter>',path.translate(l,\"\\\\\"))_p(2,'</%s>',t)else\n_p(2,'<%s Include=\"%s\" />',t,path.translate(e.name,\"\\\\\"))end\nend\n_p(1,'</ItemGroup>')end\nend\nfunction e.generate_filters(t)io.indent=\" \"e.header()e.filteridgroup(t)e.filefilterg" |