From 199dfb07ada3f9ff3b99d768c62eb11e70fed78a Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 11 Apr 2017 20:05:29 +0000 Subject: 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 --- premake4.lua | 161 +++++++++++++++++++++++++++++++-- src/actions/vstudio/vs200x_vcproj.lua | 86 +++++++++--------- src/actions/vstudio/vs2010_vcxproj.lua | 25 +++-- 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, '') + _p(depth, '\t') + _p(depth, '') + 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, '') + end, + + onbranchexit = function(node, depth) + _p(depth, '') + end, + + -- source files are handled at the leaves + onleaf = function(node, depth) + local fname = node.cfg.name + + _p(depth, '') + depth = depth + 1 + + vc200x.individualSourceFile(prj, depth, fname) + + depth = depth - 1 + _p(depth, '') + 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,'', translatedpath) + for _, cfginfo in ipairs(configs) do + if config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then + _p(3,'Create', 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,'%s', iif(path.iscfile(file.name), 'CompileAsC', 'CompileAsCpp')) + end + _p(2,'') + 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,'') + for _, file in ipairs(files) do + vc2010.individualSourceFile(prj, config_mappings, file) + end + _p(1,'') + 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("()(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, '') + _p(depth, '\t') + _p(depth, '') + end + + end + end + end + -- -- Write out the 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, '') - _p(depth, '\t') - _p(depth, '') - end - - end - end + vc200x.individualSourceFile(prj, depth, fname) depth = depth - 1 _p(depth, '') 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,'', translatedpath) + for _, cfginfo in ipairs(configs) do + if config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then + _p(3,'Create', 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,'%s', iif(path.iscfile(file.name), 'CompileAsC', 'CompileAsCpp')) + end + _p(2,'') + end function vc2010.compilerfilesgroup(prj) local configs = prj.solution.vstudio_configs @@ -541,15 +556,7 @@ _p(1,'') for _, file in ipairs(files) do - local translatedpath = path.translate(file.name, "\\") - _p(2,'', translatedpath) - for _, cfginfo in ipairs(configs) do - if config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then - _p(3,'Create', premake.esc(cfginfo.name)) - config_mappings[cfginfo] = nil --only one source file per pch - end - end - _p(2,'') + vc2010.individualSourceFile(prj, config_mappings, file) end _p(1,'') 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,'')_p('')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('')_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,'')end\nfunction o.Files(o)local e=premake.project.buildsourcetree(o)i.traverse(e,{onbranchenter=function(o,e)_p(e,'')end,onbranchexit=function(o,e)_p(e,'')end,onleaf=function(l,e)local t=l.cfg.name\n_p(e,'')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,'')_p(e,'\\t')_p(e,'')end\nend\nend\ne=e-1\n_p(e,'')end,},false,2)end\nfunction o.Platforms(e)local o={}_p(1,'')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,'')end\nend\n_p(1,'')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,'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,'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,'\"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,'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,'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,'0 then\n_p(4,'AdditionalManifestFiles=\"%s\"',premake.esc(table.concat(e,\";\")))end\n_p(3,'/>')end\nfunction o.VCMIDLTool(e)_p(3,'')end\nfunction o.buildstepsblock(n,e)_p(3,'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,'')_p(1,'')end\n_p(1,'')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,'0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.deploymentoptions),\" \"))end\n_p(3,'/>')elseif n==\"VCX360ImageTool\"then\n_p(3,'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,'')else\n_p(3,'')end\nend\n_p(2,'')end\nend\n_p(1,'')_p(1,'')_p(1,'')_p(1,'')o.Files(e)_p(1,'')_p(1,'')_p(1,'')_p('')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('')_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,'')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,'')_p(e,'\\t')_p(e,'')end\nend\nend\nend\nfunction o.Files(n)local e=premake.project.buildsourcetree(n)a.traverse(e,{onbranchenter=function(o,e)_p(e,'')end,onbranchexit=function(o,e)_p(e,'')end,onleaf=function(i,e)local i=i.cfg.name\n_p(e,'')e=e+1\no.individualSourceFile(n,e,i)e=e-1\n_p(e,'')end,},false,2)end\nfunction o.Platforms(e)local o={}_p(1,'')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,'')end\nend\n_p(1,'')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,'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,'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,'\"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,'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,'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,'0 then\n_p(4,'AdditionalManifestFiles=\"%s\"',premake.esc(table.concat(e,\";\")))end\n_p(3,'/>')end\nfunction o.VCMIDLTool(e)_p(3,'')end\nfunction o.buildstepsblock(n,e)_p(3,'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,'')_p(1,'')end\n_p(1,'')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,'0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.deploymentoptions),\" \"))end\n_p(3,'/>')elseif n==\"VCX360ImageTool\"then\n_p(3,'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,'')else\n_p(3,'')end\nend\n_p(2,'')end\nend\n_p(1,'')_p(1,'')_p(1,'')_p(1,'')o.Files(n)_p(1,'')_p(1,'')_p(1,'')_p('')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,'')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,'')e.debugdir(i)_p(2,'')end\nend\n_p(1,'')_p('')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,'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('')_p(' ')local e=table.translate(e.libdirs,function(t)return path.getabsolute(e.location..\"/\"..t)end)_p(' %s',path.translate(table.concat(e,\";\"),\"\\\\\"))_p(' ')_p('')end", /* actions/vstudio/vs2010_vcxproj.lua */ - "premake.vstudio.vc2010={}local e=premake.vstudio.vc2010\nlocal s=premake.vstudio\nlocal function p(e)_p(1,'')for n,e in ipairs(e.solution.vstudio_configs)do\n_p(2,'',premake.esc(e.name))_p(3,'%s',e.buildcfg)_p(3,'%s',e.platform)_p(2,'')end\n_p(1,'')end\nlocal function d(e)_p(1,'')_p(2,'{%s}',e.uuid)_p(2,'%s',e.name)if e.flags and e.flags.Managed then\n_p(2,'v4.0')_p(2,'ManagedCProj')else\n_p(2,'Win32Proj')end\n_p(1,'')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,'')for n,e in ipairs(e.solution.vstudio_configs)do\n_p(2,'',premake.esc(e.name))_p(3,'%s',e.buildcfg)_p(3,'%s',e.platform)_p(2,'')end\n_p(1,'')end\nlocal function s(e)_p(1,'')_p(2,'{%s}',e.uuid)_p(2,'%s',e.name)if e.flags and e.flags.Managed then\n_p(2,'v4.0')_p(2,'ManagedCProj')else\n_p(2,'Win32Proj')end\n_p(1,'')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,'',premake.esc(t.name))_p(2,'%s',e.config_type(n))_p(2,'%s',iif(o(n)==\"Disabled\",\"true\",\"false\"))_p(2,'%s',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,'%s',e)end\nif n.flags.MFC then\n_p(2,'%s',iif(n.flags.StaticRuntime,\"Static\",\"Dynamic\"))end\nif n.flags.ATL or n.flags.StaticATL then\n_p(2,'%s',iif(n.flags.StaticATL,\"Static\",\"Dynamic\"))end\nif n.flags.Managed then\n_p(2,'true')end\n_p(1,'')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,'',premake.esc(e.name))_p(2,'')_p(1,'')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,'',premake.esc(t.name))_p(2,'%s\\\\',premake.esc(n.directory))if e.platform==\"Xbox360\"then\n_p(2,'$(OutDir)%s',premake.esc(n.name))end\n_p(2,'%s\\\\',premake.esc(e.objectsdir))_p(2,'%s',premake.esc(path.getbasename(n.name)))_p(2,'%s'" - ",premake.esc(path.getextension(n.name)))if e.kind==\"SharedLib\"then\nlocal e=(e.flags.NoImportLib~=nil)_p(2,'%s',tostring(e))end\nif e.kind~=\"StaticLib\"then\n_p(2,'%s',tostring(premake.config.isincrementallink(e)))end\nif e.flags.NoManifest then\n_p(2,'false')end\n_p(1,'')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,'Use')_p(3,'%s',e.pchheader)else\n_p(3,'')end\nend\nlocal function t(n,e)if#e.defines>0 then\n_p(n,'%s;%%(Preproc" - "essorDefinitions)',premake.esc(table.concat(e.defines,\";\")))else\n_p(n,'')end\nend\nlocal function P(n,e)if#e.includedirs>0 then\n_p(n,'%s;%%(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,'%s;%%(AdditionalIncludeDirectories)',premake.esc(path.translate(table.concat(e,\";\"),'\\\\')))end\nend\nlocal function g(e)_p(2,'')t(3,e)n(3,e)_p(2,'')end\nlocal function m(e)if e.flags.NoExceptions then\n_p(2,'false')elseif e.flags.SEH then\n_p(2,'Async')end\nend\nlocal function u(e)if e.flags.NoRTTI and not e.flags.Managed then\n" - "_p(3,'false')end\nend\nlocal function _(e)if e.flags.NativeWChar then\n_p(3,'true')elseif e.flags.NoNativeWChar then\n_p(3,'false')end\nend\nlocal function C(e)if e.flags.EnableSSE then\n_p(3,'StreamingSIMDExtensions')elseif e.flags.EnableSSE2 then\n_p(3,'StreamingSIMDExtensions2')end\nend\nlocal function l(e)if e.flags.FloatFast then\n_p(3,'Fast')elseif e.flags.FloatStrict and not e.flags.Managed then\n_p(3,'Strict')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,'%s',n)end\nlocal function h(e)if premake.config.isdebugbuild(e)and not e.flags.NoMinimalRebuild then\n_p(3,'true')else\n_p(3,'false')end\nend\nlocal function n(e)if e.language==\"C\"then\n_p(3,'CompileAsC')end\nend\nlocal function b(e)_p(2,'')if#e.buildoptions>0 then\n_p(3,'%s %%(AdditionalOptions)',table.concat(premake.esc(e.buildoptions),\" \"))end\n_p(3,'%s',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,'EnableFastChecks')end\nif e.flags.ExtraWarnings then\n_p(3,'true')end\nelse\n_p(3,'true')end\n_p(3,'%s',f(e))_p(3,'true')c(e)if e.flags.ExtraWarnings then" - "\n_p(3,'Level4')else\n_p(3,'Level3')end\nif e.flags.FatalWarnings then\n_p(3,'true')end\nm(e)u(e)_(e)C(e)l(e)r(e)if e.flags.Symbols then\n_p(3,'$(OutDir)%s.pdb',path.getbasename(e.buildtarget.name))end\nif e.flags.NoFramePointer then\n_p(3,'true')end\nn(e)_p(2,'')end\nlocal function r(e)if#e.postbuildcommands>0 then\n_p(2,'')_p(3,'%s',premake.esc(table.implode(e.postbuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'')end\nif#e.prebuildcommands>0 then\n_p(2,'')_p(3,'%s',premake.esc(table.implode(e.prebuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'')end\nif#e.prelinkcommands>0 then\n_p(2,'')_p(3,'%s',premake.esc(table.implode(e.prelinkcommands,\"\",\"\",\"\\r\\n\")))_p(2,'')en" - "d\nend\nlocal function o(n,e)if#e.linkoptions>0 then\n_p(n,'%s %%(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,'%s',n[e.platform])end\nend\nlocal function c(e)if e.kind=='StaticLib'and e.platform~=\"Xbox360\"then\n_p(1,'')_p(2,'$(OutDir)%s',e.buildtarget.name)o(2,e)t(2,e)_p(1,'')end\nend\nlocal function l(e)if e.kind==\"SharedLib\"then\nlocal n=e.linktarget.fullpath\n_p(3,'%s',iif(e.flags.NoImportLib,e.objectsdir..\"\\\\\"..path.getname(n),n))end\nend\nfunction e.link(n)_p(2,'')_p(3,'%s',iif(n.kind==\"ConsoleApp\",\"Console\",\"Windows\"))_p(3,'%s',tostring(n.flags.Symbols~=nil))if premake.config.isoptimizedbuild(n.flags)then\n_p(3,'true')_p(3,'true')end\nif n.kind~='StaticLib'then\ne.additionalDependencies(n)_p(3,'$(OutDir)%s',n.buildtarget.name)if#n.libdirs>0 then\n_p(3,'%s;%%(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,'%s',iif(n.flags.Unicode,\"wmainCRTStartup\",\"mainCRTStartup\"))end\nl(n)local e=premake.findfile(n,\".def\")if e then\n_p(3,'%s',e)end\nt(3,n)o(3,n)end\n_p(2,'')end\nfunction e.additionalDependencies(e)local e=premake.getlinks(e,\"system\",\"fullpath\")if#e>0 then\n_p(3,'%s;%%(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,'',premake.esc(t.name))b(n)g(n)c(n)e.link(n)r(n)_p(1,'')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,'')for i,e in ipairs(e)do\n_p(2,'<%s Include=\"%s\" />',n,path.translate(e.name,\"\\\\\"))end\n_p(1,'')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,'')for o,n in ipairs(o)do\nlocal o=path.translate(n.name,\"\\\\\")_p(2,'',o)for t,n in ipairs(t)do\nif e[n]and o==e[n]then\n_p(3,'Create',premake.esc(n.name))e[n]=nil\nend\nend\n_p(2,'')end\n_p(1,'')end\nend\nfunction e.header(e)io.eol=\"\\r\\n\"_p('')local n=\"\"if e then\nn=' DefaultTargets=\"'..e..'\"'end\n_p('',n)end\nfunction premake.vs2010_vcxproj(n)io.indent=\" \"e.header(\"Build\")p(n)d(n)_p(1,'')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,'')_p(1,'')_p(1,'')a(n)_p(1,'')e.outputProperties(n)l(n)e.files(n)e.projectReferences(n)_p(1,'')_p(1,'')_p(1,'')_p('')end\nfunction e.projectReferences(n)local e=premake.getdependencies(n)if#e>0 then\n_p(1,'')for i,e in ipairs(e)do\nlocal n=path.getrelative(n.location,s.projectfile(e))_p(2,'',path.translate(n,\"\\\\\"))_p(3,'{%s}',e.uuid)_p(2,'')end\n_p(1,'')end\nend\nfunction e.debugdir(e)if e.debugdir then\n_p(' %s',path.translate(e.debugdir," - "'\\\\'))_p(' WindowsLocalDebugger')end\nif e.debugargs then\n_p(' %s',table.concat(e.debugargs,\" \"))end\nend\nfunction e.debugenvs(e)if e.debugenvs and#e.debugenvs>0 then\n_p(2,'%s%s',table.concat(e.debugenvs,\"\\n\"),iif(e.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)',''))if e.flags.DebugEnvsDontMerge then\n_p(2,'false')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(' ',premake.esc(n.name))e.debugdir(t)e.debugenvs(t)_p(' ')end\n_p('')end", + "upport>true')end\n_p(1,'')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,'',premake.esc(e.name))_p(2,'')_p(1,'')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,'',premake.esc(t.name))_p(2,'%s\\\\',premake.esc(n.directory))if e.platform==\"Xbox360\"then\n_p(2,'$(OutDir)%s',premake.esc(n.name))end\n_p(2,'%s\\\\',premake.esc(e.objectsdir))_p(2,'%s',premake.esc(path.getbasename(n.name)))_p(2,'%s'" + ",premake.esc(path.getextension(n.name)))if e.kind==\"SharedLib\"then\nlocal e=(e.flags.NoImportLib~=nil)_p(2,'%s',tostring(e))end\nif e.kind~=\"StaticLib\"then\n_p(2,'%s',tostring(premake.config.isincrementallink(e)))end\nif e.flags.NoManifest then\n_p(2,'false')end\n_p(1,'')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,'Use')_p(3,'%s',e.pchheader)else\n_p(3,'')end\nend\nlocal function t(n,e)if#e.defines>0 then\n_p(n,'%s;%%(Preproc" + "essorDefinitions)',premake.esc(table.concat(e.defines,\";\")))else\n_p(n,'')end\nend\nlocal function P(n,e)if#e.includedirs>0 then\n_p(n,'%s;%%(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,'%s;%%(AdditionalIncludeDirectories)',premake.esc(path.translate(table.concat(e,\";\"),'\\\\')))end\nend\nlocal function h(e)_p(2,'')t(3,e)n(3,e)_p(2,'')end\nlocal function u(e)if e.flags.NoExceptions then\n_p(2,'false')elseif e.flags.SEH then\n_p(2,'Async')end\nend\nlocal function c(e)if e.flags.NoRTTI and not e.flags.Managed then\n" + "_p(3,'false')end\nend\nlocal function m(e)if e.flags.NativeWChar then\n_p(3,'true')elseif e.flags.NoNativeWChar then\n_p(3,'false')end\nend\nlocal function g(e)if e.flags.EnableSSE then\n_p(3,'StreamingSIMDExtensions')elseif e.flags.EnableSSE2 then\n_p(3,'StreamingSIMDExtensions2')end\nend\nlocal function b(e)if e.flags.FloatFast then\n_p(3,'Fast')elseif e.flags.FloatStrict and not e.flags.Managed then\n_p(3,'Strict')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,'%s',n)end\nlocal function n(e)if premake.config.isdebugbuild(e)and not e.flags.NoMinimalRebuild then\n_p(3,'true')else\n_p(3,'false')end\nend\nlocal function _(e)if e.language==\"C\"then\n_p(3,'CompileAsC')end\nend\nlocal function C(e)_p(2,'')if#e.buildoptions>0 then\n_p(3,'%s %%(AdditionalOptions)',table.concat(premake.esc(e.buildoptions),\" \"))end\n_p(3,'%s',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,'EnableFastChecks')end\nif e.flags.ExtraWarnings then\n_p(3,'true')end\nelse\n_p(3,'true')end\n_p(3,'%s',d(e))_p(3,'true')f(e)if e.flags.ExtraWarnings then" + "\n_p(3,'Level4')else\n_p(3,'Level3')end\nif e.flags.FatalWarnings then\n_p(3,'true')end\nu(e)c(e)m(e)g(e)b(e)a(e)if e.flags.Symbols then\n_p(3,'$(OutDir)%s.pdb',path.getbasename(e.buildtarget.name))end\nif e.flags.NoFramePointer then\n_p(3,'true')end\n_(e)_p(2,'')end\nlocal function c(e)if#e.postbuildcommands>0 then\n_p(2,'')_p(3,'%s',premake.esc(table.implode(e.postbuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'')end\nif#e.prebuildcommands>0 then\n_p(2,'')_p(3,'%s',premake.esc(table.implode(e.prebuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'')end\nif#e.prelinkcommands>0 then\n_p(2,'')_p(3,'%s',premake.esc(table.implode(e.prelinkcommands,\"\",\"\",\"\\r\\n\")))_p(2,'')en" + "d\nend\nlocal function o(n,e)if#e.linkoptions>0 then\n_p(n,'%s %%(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,'%s',n[e.platform])end\nend\nlocal function a(e)if e.kind=='StaticLib'and e.platform~=\"Xbox360\"then\n_p(1,'')_p(2,'$(OutDir)%s',e.buildtarget.name)o(2,e)t(2,e)_p(1,'')end\nend\nlocal function d(e)if e.kind==\"SharedLib\"then\nlocal n=e.linktarget.fullpath\n_p(3,'%s',iif(e.flags.NoImportLib,e.objectsdir..\"\\\\\"..path.getname(n),n))end\nend\nfunction e.link(n)_p(2,'')_p(3,'%s',iif(n.kind==\"ConsoleApp\",\"Console\",\"Windows\"))_p(3,'%s',tostring(n.flags.Symbols~=nil))if premake.config.isoptimizedbuild(n.flags)then\n_p(3,'true')_p(3,'true')end\nif n.kind~='StaticLib'then\ne.additionalDependencies(n)_p(3,'$(OutDir)%s',n.buildtarget.name)if#n.libdirs>0 then\n_p(3,'%s;%%(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,'%s',iif(n.flags.Unicode,\"wmainCRTStartup\",\"mainCRTStartup\"))end\nd(n)local e=premake.findfile(n,\".def\")if e then\n_p(3,'%s',e)end\nt(3,n)o(3,n)end\n_p(2,'')end\nfunction e.additionalDependencies(e)local e=premake.getlinks(e,\"system\",\"fullpath\")if#e>0 then\n_p(3,'%s;%%(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,'',premake.esc(t.name))C(n)h(n)a(n)e.link(n)c(n)_p(1,'')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,'')for i,e in ipairs(e)do\n_p(2,'<%s Include=\"%s\" />',n,path.translate(e.name,\"\\\\\"))end\n_p(1,'')end\nend\nfunction e.individualSourceFile(a,t,n)local" + " e=a.solution.vstudio_configs\nlocal o=path.translate(n.name,\"\\\\\")_p(2,'',o)for n,e in ipairs(e)do\nif t[e]and o==t[e]then\n_p(3,'Create',premake.esc(e.name))t[e]=nil\nend\nend\nif path.iscfile(n.name)~=premake.project.iscproject(a)then\n_p(3,'%s',iif(path.iscfile(n.name),'CompileAsC','CompileAsCpp'))end\n_p(2,'')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,'')for o,i in ipairs(o)do\ne.individualSourceFile(n,t,i)end\n_p(1,'')end\nend\nfunction e.header(n)io.eol=\"\\r\\n\"_p('')local e=\"\"if n then\ne=' DefaultTargets=\"'..n..'\"'end\n_p('',e)end\nfunction premake.vs2010_vcxproj(n)io.indent=\" \"e.header(\"Build\")l(n)s(n)_p(1,'')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,'')_p(1,'')_p(1,'')r(n)_p(1,'')e.outputProperties(n)d(n)e.files(n)e.projectReferences(n)_p(1,'')_p(1,'')_p(1,'')_p('')end\nfunction e.projectReferences(n)local e=premake.getdependencies(n)if#e>0 then\n_p(1,'')for i,e in ipairs(e)do\nlocal n=path.getrelative(n.location,p.projectfile(e))_p(2,'',path.trans" + "late(n,\"\\\\\"))_p(3,'{%s}',e.uuid)_p(2,'')end\n_p(1,'')end\nend\nfunction e.debugdir(e)if e.debugdir then\n_p(' %s',path.translate(e.debugdir,'\\\\'))_p(' WindowsLocalDebugger')end\nif e.debugargs then\n_p(' %s',table.concat(e.debugargs,\" \"))end\nend\nfunction e.debugenvs(e)if e.debugenvs and#e.debugenvs>0 then\n_p(2,'%s%s',table.concat(e.debugenvs,\"\\n\"),iif(e.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)',''))if e.flags.DebugEnvsDontMerge then\n_p(2,'false')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(' ',premake.esc(n.name))e.debugdir(t)e.debugenvs(t)_p(' ')end\n_p('')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,'')end\ne=e..i[n]if not l[e]then\nl[e]=true\n_p(2,'',e)_p(3,'{%s}',os.uuid())_p(2,'')end\ne=e..\"\\\\\"end\nend\nif t then\n_p(1,'')end\nend\nfunction e.filefiltergroup(l,t)local e=e.getfilegroup(l,t)if#e>0 then\n_p(1,'')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,'%s',path.translate(l,\"\\\\\"))_p(2,'',t)else\n_p(2,'<%s Include=\"%s\" />',t,path.translate(e.name,\"\\\\\"))end\nend\n_p(1,'')end\nend\nfunction e.generate_filters(t)io.indent=\" \"e.header()e.filteridgroup(t)e.filefilterg" -- cgit v1.2.3