Ticket #2191: premake4_VS2012_support.patch

File premake4_VS2012_support.patch, 65.6 KB (added by Jorma Rebane, 11 years ago)

Split patch, only VS2012 support for premake4

  • premake/premake4.lua

     
    707707    end
    708708
    709709    -- runtime-library-specific
    710     if _ACTION == "vs2005" or _ACTION == "vs2008" or _ACTION == "vs2010" then
     710    if _ACTION == "vs2005" or _ACTION == "vs2008" or _ACTION == "vs2010" or _ACTION == "vs2012" then
    711711        table.insert(source_dirs, "lib/sysdep/rtl/msc");
    712712    else
    713713        table.insert(source_dirs, "lib/sysdep/rtl/gcc");
     
    11871187        lcxxtestpath = path.translate(lcxxtestpath, "\\")
    11881188    end
    11891189
    1190     if _ACTION ~= "gmake" and _ACTION ~= "vs2010" then
     1190    if _ACTION ~= "gmake" and _ACTION ~= "vs2010" and _ACTION ~= "vs2012" then
    11911191        prebuildcommands { lcxxtestpath.." --root "..lcxxtestrootoptions.." -o "..lcxxtestrootfile }
    11921192    end
    11931193
     
    12051205            files { src_file }
    12061206            cxxtesthdrfiles { v }
    12071207
    1208             if _ACTION ~= "gmake" and _ACTION ~= "vs2010" then
     1208            if _ACTION ~= "gmake" and _ACTION ~= "vs2010" and _ACTION ~= "vs2012" then
    12091209                -- see detailed comment above.
    12101210                src_file = path.rebase(src_file, path.getabsolute("."), _OPTIONS["outpath"])
    12111211                v = path.rebase(v, path.getabsolute("."), _OPTIONS["outpath"])
  • premake/premake4/scripts/release.lua

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
     
    148148        exec("premake4 /to=build/vs2005 vs2005")
    149149        exec("premake4 /to=build/vs2008 vs2008")
    150150        exec("premake4 /to=build/vs2010 vs2010")
     151        exec("premake4 /to=build/vs2012 vs2012")
    151152        exec("premake4 /to=build/gmake.windows /os=windows gmake")
    152153        exec("premake4 /to=build/gmake.unix /os=linux gmake")
    153154        exec("premake4 /to=build/gmake.macosx /os=macosx /platform=universal32 gmake")
  • premake/premake4/src/actions/vstudio/_vstudio.lua

     
    293293        local extension
    294294        if (prj.language == "C#") then
    295295            extension = ".csproj"
    296         elseif (_ACTION == "vs2010"  and prj.language == "C++" )then
     296        elseif (_ACTION == "vs2010" or _ACTION == "vs2012") then
    297297            extension = ".vcxproj"
    298         elseif (_ACTION == "vs2010"  and prj.language == "C" )then
    299             extension = ".vcxproj"
    300298        else
    301299            extension = ".vcproj"
    302300        end
     
    487485        oncleanproject  = premake.vstudio.cleanproject,
    488486        oncleantarget   = premake.vstudio.cleantarget
    489487    }
     488   
     489    newaction
     490    {
     491        trigger         = "vs2012",
     492        shortname       = "Visual Studio 2012",
     493        description     = "Generate Visual Studio 2012 project files (experimental)",
     494        os              = "windows",
     495
     496        valid_kinds     = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
     497       
     498        valid_languages = { "C++","C"},
     499       
     500        valid_tools     = {
     501            cc     = { "msc"   },
     502            --dotnet = { "msnet" },
     503        },
     504
     505        onsolution = function(sln)
     506            premake.generate(sln, "%%.sln", premake.vs_generic_solution)
     507        end,
     508       
     509        onproject = function(prj)
     510            premake.generate(prj, "%%.vcxproj", premake.vs2010_vcxproj)
     511            premake.generate(prj, "%%.vcxproj.user", premake.vs2010_vcxproj_user)
     512            premake.generate(prj, "%%.vcxproj.filters", premake.vs2010_vcxproj_filters)
     513        end,
     514       
     515
     516        oncleansolution = premake.vstudio.cleansolution,
     517        oncleanproject  = premake.vstudio.cleanproject,
     518        oncleantarget   = premake.vstudio.cleantarget
     519    }
     520   
  • premake/premake4/src/actions/vstudio/vs2010_vcxproxj.lua

     
    105105            _p(2,'<ProjectGuid>{%s}</ProjectGuid>',prj.uuid)
    106106            _p(2,'<RootNamespace>%s</RootNamespace>',prj.name)
    107107            _p(2,'<Keyword>Win32Proj</Keyword>')
     108
     109            if _ACTION == "vs2012" then
     110                _p(2,[[<VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and '$(VisualStudioVersion)' == ''">$(VCTargetsPath11)</VCTargetsPath>]])
     111            end
     112           
    108113        _p(1,'</PropertyGroup>')
    109114    end
    110115   
     
    144149                    , premake.esc(cfginfo.name))
    145150                _p(2,'<ConfigurationType>%s</ConfigurationType>',vs10_helpers.config_type(cfg))
    146151                _p(2,'<CharacterSet>%s</CharacterSet>',iif(cfg.flags.Unicode,"Unicode","MultiByte"))
     152                _p(2,'<UseDebugLibraries>%s</UseDebugLibraries>'
     153                    ,iif(optimisation(cfg) == "Disabled","true","false"))
     154
     155                if _ACTION == "vs2012" then
     156                    _p(2, '<PlatformToolset>v110</PlatformToolset>')           
     157                end
    147158           
    148             if cfg.flags.MFC then
    149                 _p(2,'<UseOfMfc>Dynamic</UseOfMfc>')
    150             end
    151                 _p(2,'<UseDebugLibraries>%s</UseDebugLibraries>'
    152                         ,iif(optimisation(cfg) == "Disabled","true","false"))               
     159                if cfg.flags.MFC then
     160                    _p(2,'<UseOfMfc>Dynamic</UseOfMfc>')
     161                end
    153162            _p(1,'</PropertyGroup>')
    154163        end
    155164    end
     
    726735
    727736        _p('</Project>')
    728737    end
    729    
    730738
    731739    function premake.vs2010_vcxproj_user(prj)
    732740        _p(xml_version_and_encoding)
  • premake/premake4/src/actions/vstudio/vs_generic_solution.lua

     
    44    {
    55        vs2005 = '9.00',
    66        vs2008 = '10.00',
    7         vs2010 = '11.00'
     7        vs2010 = '11.00',
     8        vs2012 = '12.00'
    89    }
    910    return t[_ACTION]
    1011end
     
    1415    {
    1516        vs2005 = '2005',
    1617        vs2008 = '2008',
    17         vs2010 = '2010'
     18        vs2010 = '2010',
     19        vs2012 = '2012'
    1820    }
    1921    return t[_ACTION]
    2022end
  • premake/premake4/src/host/scripts.c

     
    170170    "%\")\nos.remove(fname .. \".vcproj\")\nos.remove(fname .. \".vcproj.user\")\nos.remove(fname .. \".vcxproj\")\nos.remove(fname .. \".vcxproj.user\")\nos.remove(fname .. \".vcxproj.filters\")\nos.remove(fname .. \".csproj\")\nos.remove(fname .. \".csproj.user\")\nos.remove(fname .. \".pidb\")\nos.remove(fname .. \".sdf\")\nend\nfunction premake.vstudio.cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nos.remove(name .. \".vshost.exe\")\nos.remove(name .. \".exe.manifest\")\nend\nlocal function output(indent, value)\n_p(indent .. value)\nend\nlocal function attrib(indent, name, value)\n_p(indent .. \"\\t\" .. name .. '=\"' .. value .. '\"')\nend\nfunction _VS.files(prj, fname, state, nestlevel)\nlocal indent = string.rep(\"\\t\", nestlevel + 2)\nif (state == \"GroupStart\") then\noutput(indent, \"<Filter\")\nattrib(indent, \"Name\", path.getname(fname))\nattrib(indent, \"Filter\", \"\")\noutput(indent, \"\\t>\")\nelseif (state == \"GroupEnd\") then\noutput("
    171171    "indent, \"</Filter>\")\nelse\noutput(indent, \"<File\")\nattrib(indent, \"RelativePath\", path.translate(fname, \"\\\\\"))\noutput(indent, \"\\t>\")\nif (not prj.flags.NoPCH and prj.pchsource == fname) then\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nif cfginfo.isreal then\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\noutput(indent, \"\\t<FileConfiguration\")\nattrib(indent, \"\\tName\", cfginfo.name)\noutput(indent, \"\\t\\t>\")\noutput(indent, \"\\t\\t<Tool\")\nattrib(indent, \"\\t\\tName\", iif(cfg.system == \"Xbox360\", \"VCCLX360CompilerTool\", \"VCCLCompilerTool\"))\nattrib(indent, \"\\t\\tUsePrecompiledHeader\", \"1\")\noutput(indent, \"\\t\\t/>\")\noutput(indent, \"\\t</FileConfiguration>\")\nend\nend\nend\nif (path.getextension(fname) == \".asm\") then\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nif cfginfo.isreal then\nif not (prj.solution.nasmformat) then\nprj.solution.nasmformat = 'win32'\nend\nif not (prj.solution.nasmpath) then\npr"
    172172    "j.solution.nasmpath = 'nasm'\nend\nlocal nasmpath = path.translate(path.getrelative(prj.location, prj.solution.nasmpath), \"\\\\\")\nlocal command = nasmpath..\" -i \"..path.translate(path.getdirectory(fname), \"\\\\\")..\"\\\\ -f \"..prj.solution.nasmformat..\n\" &quot;$(InputPath)&quot; -o &quot;$(IntDir)\\\\$(InputName).obj&quot;\"\noutput(indent, \"\\t<FileConfiguration\")\nattrib(indent, \"\\tName\", cfginfo.name)\noutput(indent, \"\\t\\t>\")\noutput(indent, \"\\t\\t<Tool\")\nattrib(indent, \"\\t\\tName\", \"VCCustomBuildTool\")\nattrib(indent, \"\\t\\tDescription\", \"Assembling $(InputPath)\")\nattrib(indent, \"\\t\\tCommandLine\", command)\nattrib(indent, \"\\t\\tOutputs\", \"$(IntDir)\\\\$(InputName).obj\")\noutput(indent, \"\\t\\t/>\")\noutput(indent, \"\\t</FileConfiguration>\")\nend\nend\nend\noutput(indent, \"</File>\")\nend\nend\nfunction _VS.optimization(cfg)\nlocal result = 0\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = 3\nelseif (value == \"OptimizeSize\") t"
    173     "hen\nresult = 1\nelseif (value == \"OptimizeSpeed\") then\nresult = 2\nend\nend\nreturn result\nend\nfunction _VS.projectfile(prj)\nlocal extension\nif (prj.language == \"C#\") then\nextension = \".csproj\"\nelseif (_ACTION == \"vs2010\"  and prj.language == \"C++\" )then\nextension = \".vcxproj\"\nelseif (_ACTION == \"vs2010\"  and prj.language == \"C\" )then\nextension = \".vcxproj\"\nelse\nextension = \".vcproj\"\nend\nlocal fname = path.join(prj.location, prj.name)\nreturn fname..extension\nend\nfunction _VS.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\nnewaction {\ntrigger         = \"vs2002\",\nshortname       = \"Visual Studio 2002\",\ndescription     = \"Generate Microsoft Visual Studio 2002 project files\",\nos              = \"windows\",\nvalid_kinds     = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools     = {"
    174     "\ncc     = { \"msc\"   },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2002_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2002_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2002_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject  = premake.vstudio.cleanproject,\noncleantarget   = premake.vstudio.cleantarget\n}\nnewaction {\ntrigger         = \"vs2003\",\nshortname       = \"Visual Studio 2003\",\ndescription     = \"Generate Microsoft Visual Studio 2003 project files\",\nos              = \"windows\",\nvalid_kinds     = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools     = {\ncc     = { \"msc\"   },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln"
    175     ", \"%%.sln\", premake.vs2003_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2002_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2002_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject  = premake.vstudio.cleanproject,\noncleantarget   = premake.vstudio.cleantarget\n}\nnewaction {\ntrigger         = \"vs2005\",\nshortname       = \"Visual Studio 2005\",\ndescription     = \"Generate Microsoft Visual Studio 2005 project files\",\nos              = \"windows\",\nvalid_kinds     = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools     = {\ncc     = { \"msc\"   },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2005_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj)"
    176     " then\npremake.generate(prj, \"%%.csproj\", premake.vs2005_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2005_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject  = premake.vstudio.cleanproject,\noncleantarget   = premake.vstudio.cleantarget\n}\nnewaction {\ntrigger         = \"vs2008\",\nshortname       = \"Visual Studio 2008\",\ndescription     = \"Generate Microsoft Visual Studio 2008 project files\",\nos              = \"windows\",\nvalid_kinds     = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools     = {\ncc     = { \"msc\"   },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2005_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2005_csproj)\npremake.generate(prj, \"%%.csproj.us"
    177     "er\", premake.vs2005_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject  = premake.vstudio.cleanproject,\noncleantarget   = premake.vstudio.cleantarget\n}\nnewaction \n{\ntrigger         = \"vs2010\",\nshortname       = \"Visual Studio 2010\",\ndescription     = \"Generate Visual Studio 2010 project files (experimental)\",\nos              = \"windows\",\nvalid_kinds     = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C++\",\"C\"},\nvalid_tools     = {\ncc     = { \"msc\"   },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs_generic_solution)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.vcxproj.filters\", premake.vs2010_vcxproj_filters)\nend,\noncleansolution = premake.vstudio.cleansol"
    178     "ution,\noncleanproject  = premake.vstudio.cleanproject,\noncleantarget   = premake.vstudio.cleantarget\n}\n",
     173    "hen\nresult = 1\nelseif (value == \"OptimizeSpeed\") then\nresult = 2\nend\nend\nreturn result\nend\nfunction _VS.projectfile(prj)\nlocal extension\nif (prj.language == \"C#\") then\nextension = \".csproj\"\nelseif (_ACTION == \"vs2010\" or _ACTION == \"vs2012\") then\nextension = \".vcxproj\"\nelse\nextension = \".vcproj\"\nend\nlocal fname = path.join(prj.location, prj.name)\nreturn fname..extension\nend\nfunction _VS.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\nnewaction {\ntrigger         = \"vs2002\",\nshortname       = \"Visual Studio 2002\",\ndescription     = \"Generate Microsoft Visual Studio 2002 project files\",\nos              = \"windows\",\nvalid_kinds     = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools     = {\ncc     = { \"msc\"   },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.gen"
     174    "erate(sln, \"%%.sln\", premake.vs2002_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2002_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2002_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject  = premake.vstudio.cleanproject,\noncleantarget   = premake.vstudio.cleantarget\n}\nnewaction {\ntrigger         = \"vs2003\",\nshortname       = \"Visual Studio 2003\",\ndescription     = \"Generate Microsoft Visual Studio 2003 project files\",\nos              = \"windows\",\nvalid_kinds     = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools     = {\ncc     = { \"msc\"   },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2003_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetpro"
     175    "ject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2002_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2002_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject  = premake.vstudio.cleanproject,\noncleantarget   = premake.vstudio.cleantarget\n}\nnewaction {\ntrigger         = \"vs2005\",\nshortname       = \"Visual Studio 2005\",\ndescription     = \"Generate Microsoft Visual Studio 2005 project files\",\nos              = \"windows\",\nvalid_kinds     = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools     = {\ncc     = { \"msc\"   },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2005_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2005_csproj)\npremake.generate(prj, \"%%."
     176    "csproj.user\", premake.vs2005_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject  = premake.vstudio.cleanproject,\noncleantarget   = premake.vstudio.cleantarget\n}\nnewaction {\ntrigger         = \"vs2008\",\nshortname       = \"Visual Studio 2008\",\ndescription     = \"Generate Microsoft Visual Studio 2008 project files\",\nos              = \"windows\",\nvalid_kinds     = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools     = {\ncc     = { \"msc\"   },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2005_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2005_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2005_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vc"
     177    "proj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject  = premake.vstudio.cleanproject,\noncleantarget   = premake.vstudio.cleantarget\n}\nnewaction \n{\ntrigger         = \"vs2012\",\nshortname       = \"Visual Studio 2012\",\ndescription     = \"Generate Visual Studio 2012 project files (experimental)\",\nos              = \"windows\",\nvalid_kinds     = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C++\",\"C\"},\nvalid_tools     = {\ncc     = { \"msc\"   },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs_generic_solution)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.vcxproj.filters\", premake.vs2010_vcxproj_filters)\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject  = premake.vstudio.cleanproject,\noncleantarget   = premake.vstudio.clea"
     178    "ntarget\n}\n",
    179179
    180180    /* actions/vstudio/vs2002_solution.lua */
    181181    "function premake.vs2002_solution(sln)\nio.eol = '\\r\\n'\nsln.vstudio_configs = premake.vstudio_buildconfigs(sln)\n_p('Microsoft Visual Studio Solution File, Format Version 7.00')\nfor prj in premake.solution.eachproject(sln) do\nlocal projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj)))\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', _VS.tool(prj), prj.name, projpath, prj.uuid)\n_p('EndProject')\nend\n_p('Global')\n_p(1,'GlobalSection(SolutionConfiguration) = preSolution')\nfor i, cfgname in ipairs(sln.configurations) do\n_p(2,'ConfigName.%d = %s', i - 1, cfgname)\nend\n_p(1,'EndGlobalSection')\n_p(1,'GlobalSection(ProjectDependencies) = postSolution')\n_p(1,'EndGlobalSection')\n_p(1,'GlobalSection(ProjectConfiguration) = postSolution')\nfor prj in premake.solution.eachproject(sln) do\nfor _, cfgname in ipairs(sln.configurations) do\n_p(2,'{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(prj))\n_p(2,'{%s}.%s.Build.0 = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch("
     
    231231    "function premake.vs2005_csproj_user(prj)\nio.eol = \"\\r\\n\"\n_p('<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">')\n_p('  <PropertyGroup>')\nlocal refpaths = table.translate(prj.libdirs, function(v) return path.getabsolute(prj.location .. \"/\" .. v) end)\n_p('    <ReferencePath>%s</ReferencePath>', path.translate(table.concat(refpaths, \";\"), \"\\\\\"))\n_p('  </PropertyGroup>')\n_p('</Project>')\nend\n",
    232232
    233233    /* actions/vstudio/vs_generic_solution.lua */
    234     "\nlocal vs_format_version = function()\nlocal t =\n{\nvs2005 = '9.00',\n    vs2008 = '10.00',\n    vs2010 = '11.00'\n}\nreturn t[_ACTION]\nend\nlocal vs_version = function()\nlocal t =\n{\nvs2005 = '2005',\n    vs2008 = '2008',\n    vs2010 = '2010'\n}\nreturn t[_ACTION]\nend\nlocal vs_write_version_info = function()\n_p('Microsoft Visual Studio Solution File, Format Version %s', vs_format_version())\n_p('# Visual Studio %s', vs_version() )\nend\nlocal vs_write_projects = function(sln)\nfor prj in premake.solution.eachproject(sln) do\nlocal projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj)), \"\\\\\")\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', _VS.tool(prj), prj.name, projpath, prj.uuid)\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\n_p('\\tProjectSection(ProjectDependencies) = postProject')\nfor _, dep in ipairs(deps) do\n_p('\\t\\t{%s} = {%s}', dep.uuid, dep.uuid)\nend\n_p('\\tEndProjectSection')\nend\n_p('EndProject')\nend\nend\nlocal vs_write_pre_version "
    235     "= function(sln)\nio.eol = '\\r\\n'\nsln.vstudio_configs = premake.vstudio_buildconfigs(sln)\n_p('\\239\\187\\191')\nend\nfunction premake.vs_generic_solution(sln)\nvs_write_pre_version(sln)\nvs_write_version_info()\nvs_write_projects(sln)\n_p('Global')\npremake.vs2005_solution_platforms(sln)\npremake.vs2005_solution_project_platforms(sln)\npremake.vs2005_solution_properties(sln)\n_p('EndGlobal')\nend",
     234    "\nlocal vs_format_version = function()\nlocal t =\n{\nvs2005 = '9.00',\n    vs2008 = '10.00',\n    vs2010 = '11.00',\nvs2012 = '12.00'\n}\nreturn t[_ACTION]\nend\nlocal vs_version = function()\nlocal t =\n{\nvs2005 = '2005',\n    vs2008 = '2008',\n    vs2010 = '2010',\nvs2012 = '2012'\n}\nreturn t[_ACTION]\nend\nlocal vs_write_version_info = function()\n_p('Microsoft Visual Studio Solution File, Format Version %s', vs_format_version())\n_p('# Visual Studio %s', vs_version() )\nend\nlocal vs_write_projects = function(sln)\nfor prj in premake.solution.eachproject(sln) do\nlocal projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj)), \"\\\\\")\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', _VS.tool(prj), prj.name, projpath, prj.uuid)\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\n_p('\\tProjectSection(ProjectDependencies) = postProject')\nfor _, dep in ipairs(deps) do\n_p('\\t\\t{%s} = {%s}', dep.uuid, dep.uuid)\nend\n_p('\\tEndProjectSection')\nend\n_p('EndProject')\n"
     235    "end\nend\nlocal vs_write_pre_version = function(sln)\nio.eol = '\\r\\n'\nsln.vstudio_configs = premake.vstudio_buildconfigs(sln)\n_p('\\239\\187\\191')\nend\nfunction premake.vs_generic_solution(sln)\nvs_write_pre_version(sln)\nvs_write_version_info()\nvs_write_projects(sln)\n_p('Global')\npremake.vs2005_solution_platforms(sln)\npremake.vs2005_solution_project_platforms(sln)\npremake.vs2005_solution_properties(sln)\n_p('EndGlobal')\nend",
    236236
    237237    /* actions/vstudio/vs2010_vcxproxj.lua */
    238238    "\npremake.vstudio.vs10_helpers = { }\nlocal vs10_helpers = premake.vstudio.vs10_helpers\nfunction vs10_helpers.remove_relative_path(file)\nfile = file:gsub(\"%.%./\",'')\nfile = file:gsub(\"%./\",'')\nfile = file:gsub(\"^source/\",'')\nreturn file\nend\nfunction vs10_helpers.file_path(file)\nfile = vs10_helpers.remove_relative_path(file)\nlocal path = string.find(file,'/[%w%.%_%-]+$')\nif path then\nreturn string.sub(file,1,path-1)\nelse\nreturn nil\nend\nend\nfunction vs10_helpers.list_of_directories_in_path(path)\nlocal list={}\npath = vs10_helpers.remove_relative_path(path)\nif path then\nfor dir in string.gmatch(path,\"[%w%-%_%.]+/\")do\nif #list == 0 then\nlist[1] = dir:sub(1,#dir-1)\nelse\nlist[#list +1] = list[#list] ..\"/\" ..dir:sub(1,#dir-1)\nend\nend\nend\nreturn list\nend\nfunction vs10_helpers.table_of_file_filters(files)\nlocal filters ={}\nfor _, valueTable in pairs(files) do\nfor _, entry in ipairs(valueTable) do\nlocal result = vs10_helpers.list_of_directories_in_path(entry)\nfor __,dir in ipa"
    239239    "irs(result) do\nif table.contains(filters,dir) ~= true then\nfilters[#filters +1] = dir\nend\nend\nend\nend\nreturn filters\nend\nfunction vs10_helpers.get_file_extension(file)\nlocal ext_start,ext_end = string.find(file,\"%.[%w_%-]+$\")\nif ext_start then\nreturn  string.sub(file,ext_start+1,ext_end)\nend\nend\nfunction vs10_helpers.sort_input_files(files,sorted_container)\nlocal types = \n{\nh= \"ClInclude\",\nhpp= \"ClInclude\",\nhxx= \"ClInclude\",\nc= \"ClCompile\",\ncpp= \"ClCompile\",\ncxx= \"ClCompile\",\ncc= \"ClCompile\",\nrc  = \"ResourceCompile\",\nasm = \"ClASM\"\n}\nfor _, current_file in ipairs(files) do\nlocal ext = vs10_helpers.get_file_extension(current_file)\nif ext then\nlocal type = types[ext]\nif type then\ntable.insert(sorted_container[type],current_file)\nelse\ntable.insert(sorted_container.None,current_file)\nend\nend\nend\nend\nlocal function vs2010_config(prj)\n_p(1,'<ItemGroup Label=\"ProjectConfigurations\">')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\n_p(2,'<Proje"
    240     "ctConfiguration Include=\"%s\">', premake.esc(cfginfo.name))\n_p(3,'<Configuration>%s</Configuration>',cfginfo.buildcfg)\n_p(3,'<Platform>%s</Platform>',cfginfo.platform)\n_p(2,'</ProjectConfiguration>')\nend\n_p(1,'</ItemGroup>')\nend\nlocal function vs2010_globals(prj)\n_p(1,'<PropertyGroup Label=\"Globals\">')\n_p(2,'<ProjectGuid>{%s}</ProjectGuid>',prj.uuid)\n_p(2,'<RootNamespace>%s</RootNamespace>',prj.name)\n_p(2,'<Keyword>Win32Proj</Keyword>')\n_p(1,'</PropertyGroup>')\nend\nfunction vs10_helpers.config_type(config)\nlocal t =\n{\nSharedLib = \"DynamicLibrary\",\nStaticLib = \"StaticLibrary\",\nConsoleApp = \"Application\",\nWindowedApp = \"Application\"\n}\nreturn t[config.kind]\nend\nlocal function if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)\\'==\\'%s\\'\"'\nend\nlocal function optimisation(cfg)\nlocal result = \"Disabled\"\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = \"Full\"\nelseif (value == \"OptimizeSize\") then\nresult = \"Min"
    241     "Space\"\nelseif (value == \"OptimizeSpeed\") then\nresult = \"MaxSpeed\"\nend\nend\nreturn result\nend\nlocal function config_type_block(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<PropertyGroup '..if_config_and_platform() ..' Label=\"Configuration\">'\n, premake.esc(cfginfo.name))\n_p(2,'<ConfigurationType>%s</ConfigurationType>',vs10_helpers.config_type(cfg))\n_p(2,'<CharacterSet>%s</CharacterSet>',iif(cfg.flags.Unicode,\"Unicode\",\"MultiByte\"))\nif cfg.flags.MFC then\n_p(2,'<UseOfMfc>Dynamic</UseOfMfc>')\nend\n_p(2,'<UseDebugLibraries>%s</UseDebugLibraries>'\n,iif(optimisation(cfg) == \"Disabled\",\"true\",\"false\"))\n_p(1,'</PropertyGroup>')\nend\nend\nlocal function import_props(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ImportGroup '..if_config_and_platform() ..' Label=\"PropertySheets\">"
    242     "'\n,premake.esc(cfginfo.name))\n_p(2,'<Import Project=\"$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists(\\'$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\\')\" Label=\"LocalAppDataPlatform\" />')\n_p(1,'</ImportGroup>')\nend\nend\nlocal function incremental_link(cfg,cfginfo)\nif cfg.kind ~= \"StaticLib\" then\nShoudLinkIncrementally = 'false'\nif optimisation(cfg) == \"Disabled\" then\nShoudLinkIncrementally = 'true'\nend\n_p(2,'<LinkIncremental '..if_config_and_platform() ..'>%s</LinkIncremental>'\n,premake.esc(cfginfo.name),ShoudLinkIncrementally)\nend\nend\nlocal function ignore_import_lib(cfg,cfginfo)\nif cfg.kind == \"SharedLib\" then\nlocal shouldIgnore = \"false\"\nif cfg.flags.NoImportLib then shouldIgnore = \"true\" end\n _p(2,'<IgnoreImportLibrary '..if_config_and_platform() ..'>%s</IgnoreImportLibrary>'\n,premake.esc(cfginfo.name),shouldIgnore)\nend\nend\nlocal function intermediate_and_out_dirs(prj)\n_p(1,'<PropertyGroup>')\n_p(2,'<_ProjectFileVersion>10.0.30319."
    243     "1</_ProjectFileVersion>')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(2,'<OutDir '..if_config_and_platform() ..'>%s\\\\</OutDir>'\n, premake.esc(cfginfo.name),premake.esc(cfg.buildtarget.directory) )\n_p(2,'<IntDir '..if_config_and_platform() ..'>%s\\\\</IntDir>'\n, premake.esc(cfginfo.name), premake.esc(cfg.objectsdir))\n_p(2,'<TargetName '..if_config_and_platform() ..'>%s</TargetName>'\n,premake.esc(cfginfo.name),path.getbasename(cfg.buildtarget.name))\nignore_import_lib(cfg,cfginfo)\nincremental_link(cfg,cfginfo)\nif cfg.flags.NoManifest then\n_p(2,'<GenerateManifest '..if_config_and_platform() ..'>false</GenerateManifest>'\n,premake.esc(cfginfo.name))\nend\nend\n_p(1,'</PropertyGroup>')\nend\nlocal function runtime(cfg)\nlocal runtime\nif premake.config.isdebugbuild(cfg) then\nruntime = iif(cfg.flags.StaticRuntime,\"MultiThreadedDebug\", \"MultiThreadedDebugDLL\")\nelse\nruntime = iif(cfg.flags.StaticRuntime,"
    244     " \"MultiThreaded\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nlocal function precompiled_header(cfg)\n      if not cfg.flags.NoPCH and cfg.pchheader then\n_p(3,'<PrecompiledHeader>Use</PrecompiledHeader>')\n_p(3,'<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>', path.getname(cfg.pchheader))\nelse\n_p(3,'<PrecompiledHeader></PrecompiledHeader>')\nend\nend\nlocal function preprocessor(indent,cfg)\nif #cfg.defines > 0 then\n_p(indent,'<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>'\n,premake.esc(table.concat(cfg.defines, \";\")))\nelse\n_p(indent,'<PreprocessorDefinitions></PreprocessorDefinitions>')\nend\nend\nlocal function include_dirs(indent,cfg)\nif #cfg.includedirs > 0 then\n_p(indent,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>'\n,premake.esc(path.translate(table.concat(cfg.includedirs, \";\"), '\\\\')))\nend\nend\nlocal function resource_compile(cfg)\n_p(2,'<ResourceCompile>')\npreprocessor(3,cfg)\ninclude_dir"
    245     "s(3,cfg)\n_p(2,'</ResourceCompile>')\nend\nlocal function exceptions(cfg)\nif cfg.flags.NoExceptions then\n_p(2,'<ExceptionHandling>false</ExceptionHandling>')\nelseif cfg.flags.SEH then\n_p(2,'<ExceptionHandling>Async</ExceptionHandling>')\nend\nend\nlocal function rtti(cfg)\nif cfg.flags.NoRTTI then\n_p(3,'<RuntimeTypeInfo>false</RuntimeTypeInfo>')\nend\nend\nlocal function wchar_t_buildin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>')\nend\nend\nlocal function sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>')\nelseif cfg.flags.EnableSSE2 then\n_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>')\nend\nend\nlocal function floating_point(cfg)\n     if cfg.flags.FloatFast then\n_p(3,'<FloatingPointModel>Fast</FloatingPointModel"
    246     ">')\nelseif cfg.flags.FloatStrict then\n_p(3,'<FloatingPointModel>Strict</FloatingPointModel>')\nend\nend\nlocal function debug_info(cfg)\nlocal debug_info = ''\nif cfg.flags.Symbols then\nif optimisation(cfg) ~= \"Disabled\" or cfg.flags.NoEditAndContinue then\ndebug_info = \"ProgramDatabase\"\nelseif cfg.platform ~= \"x64\" then\ndebug_info = \"EditAndContinue\"\nelse\ndebug_info = \"OldStyle\"\nend\nend\n_p(3,'<DebugInformationFormat>%s</DebugInformationFormat>',debug_info)\nend\nlocal function minimal_build(cfg)\nif premake.config.isdebugbuild(cfg) and not cfg.flags.NoMinimalRebuild then\n_p(3,'<MinimalRebuild>true</MinimalRebuild>')\nelse\n_p(3,'<MinimalRebuild>false</MinimalRebuild>')\nend\nend\nlocal function compile_language(cfg)\nif cfg.language == \"C\" then\n_p(3,'<CompileAs>CompileAsC</CompileAs>')\nend\nend\nlocal function vs10_clcompile(cfg)\n_p(2,'<ClCompile>')\nif #cfg.buildoptions > 0 then\n_p(3,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',\ntable.concat(premake.esc(cfg.bu"
    247     "ildoptions), \" \"))\nend\n_p(3,'<Optimization>%s</Optimization>',optimisation(cfg))\ninclude_dirs(3,cfg)\npreprocessor(3,cfg)\nminimal_build(cfg)\nif optimisation(cfg) == \"Disabled\" then\n_p(3,'<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>')\nif cfg.flags.ExtraWarnings then\n_p(3,'<SmallerTypeCheck>true</SmallerTypeCheck>')\nend\nelse\n_p(3,'<StringPooling>true</StringPooling>')\nend\n_p(3,'<RuntimeLibrary>%s</RuntimeLibrary>', runtime(cfg))\n_p(3,'<FunctionLevelLinking>true</FunctionLevelLinking>')\nprecompiled_header(cfg)\nif cfg.flags.ExtraWarnings then\n_p(3,'<WarningLevel>Level4</WarningLevel>')\nelse\n_p(3,'<WarningLevel>Level3</WarningLevel>')\nend\nif cfg.flags.FatalWarnings then\n_p(3,'<TreatWarningAsError>true</TreatWarningAsError>')\nend\nexceptions(cfg)\nrtti(cfg)\nwchar_t_buildin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(cfg)\nif cfg.flags.NoFramePointer then\n_p(3,'<OmitFramePointers>true</OmitFramePointers>')\nend\ncompile_language(cfg)\n_p(2,'</ClCompile>')\nend\nlocal func"
    248     "tion event_hooks(cfg, prj)\nif #cfg.postbuildcommands> 0 then\n    _p(2,'<PostBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PostBuildEvent>')\nend\nif #cfg.prebuildcommands> 0 or prj.cxxtestrootfile then\n    _p(2,'<PreBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\nif(prj.solution.cxxtestpath and prj.cxxtestrootfile and prj.cxxtesthdrfiles and prj.cxxtestsrcfiles) then\nlocal cxxtestpath = path.translate(path.getrelative(prj.location, prj.solution.cxxtestpath),\"\\\\\")\nlocal cxxtestrootfile = path.translate(prj.cxxtestrootfile,\"\\\\\")\n_p(3,'<Command>%s --root %s &gt; %s</Command>', cxxtestpath, prj.cxxtestrootoptions, cxxtestrootfile)\nend\n_p(2,'</PreBuildEvent>')\nend\nif #cfg.prelinkcommands> 0 then\n    _p(2,'<PreLinkEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PreLinkEvent>'"
    249     ")\nend\nend\nlocal function additional_options(indent,cfg)\nif #cfg.linkoptions > 0 then\n_p(indent,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',\ntable.concat(premake.esc(cfg.linkoptions), \" \"))\nend\nend\nlocal function item_def_lib(cfg)\nif cfg.kind == 'StaticLib' then\n_p(1,'<Lib>')\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',cfg.buildtarget.name)\nadditional_options(2,cfg)\n_p(1,'</Lib>')\nend\nend\nlocal function link_target_machine(cfg)\nlocal target\nif cfg.platform == nil or cfg.platform == \"x32\" then target =\"MachineX86\"\nelseif cfg.platform == \"x64\" then target =\"MachineX64\"\nend\n_p(3,'<TargetMachine>%s</TargetMachine>', target)\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'<ImportLibrary>%s</ImportLibrary>',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nlocal function common_link_section(cfg)\n_p(3,'<SubSystem>%s</SubSystem>',iif(c"
    250     "fg.kind == \"ConsoleApp\",\"Console\", \"Windows\"))\nif cfg.flags.Symbols then \n_p(3,'<GenerateDebugInformation>true</GenerateDebugInformation>')\nelse\n_p(3,'<GenerateDebugInformation>false</GenerateDebugInformation>')\nend\nif optimisation(cfg) ~= \"Disabled\" then\n_p(3,'<OptimizeReferences>true</OptimizeReferences>')\n_p(3,'<EnableCOMDATFolding>true</EnableCOMDATFolding>')\nend\nif cfg.flags.Symbols then\n_p(3,'<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>'\n, path.getbasename(cfg.buildtarget.name))\nend\nend\nlocal function item_link(cfg)\n_p(2,'<Link>')\nif cfg.kind ~= 'StaticLib' then\nif #cfg.links > 0 then\n_p(3,'<AdditionalDependencies>%s;%%(AdditionalDependencies)</AdditionalDependencies>',\ntable.concat(premake.getlinks(cfg, \"all\", \"fullpath\"), \";\"))\nend\n_p(3,'<OutputFile>$(OutDir)%s</OutputFile>', cfg.buildtarget.name)\n_p(3,'<AdditionalLibraryDirectories>%s%s%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>',\ntable.concat(premake.esc(path.translate(cf"
    251     "g.libdirs, '\\\\')) , \";\"),\niif(cfg.libdirs and #cfg.libdirs >0,';',''))\ncommon_link_section(cfg)\nif vs10_helpers.config_type(cfg) == 'Application' and not cfg.flags.WinMain then\n_p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>')\nend\nimport_lib(cfg)\n_p(3,'<TargetMachine>%s</TargetMachine>', iif(cfg.platform == \"x64\", \"MachineX64\", \"MachineX86\"))\nadditional_options(3,cfg)\nelse\ncommon_link_section(cfg)\nend\n_p(2,'</Link>')\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ItemDefinitionGroup ' ..if_config_and_platform() ..'>'\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nitem_link(cfg)\nevent_hooks(cfg, prj)\n_p(1,'</ItemDefinitionGroup>')\nend\nend\n  --     <ProjectReference Include=\"zlibvc.vcxproj\">\n  --       <Project>{8fd826f8-3739-44e6-8cc8-997122e53b8d}</Project>\n  --     </ProjectReference"
    252     ">\n  --   </ItemGroup>\nlocal function write_cxxtestgen_block(prj)\nif(prj.solution.cxxtestpath and prj.cxxtestrootfile and prj.cxxtesthdrfiles and prj.cxxtestsrcfiles) then\nlocal cxxtestpath = path.translate(path.getrelative(prj.location, prj.solution.cxxtestpath),\"\\\\\")\n_p(1,'<ItemGroup>')\nfor i, file in ipairs(prj.cxxtesthdrfiles) do\nlocal cxxtesthdrfile = path.translate(file,\"\\\\\")\nlocal cxxtestsrcfile = path.translate(prj.cxxtestsrcfiles[i],\"\\\\\")\n_p(2,'<CustomBuild Include=\\\"%s\\\">', cxxtesthdrfile)\n      _p(3,'<Message>Generating %s</Message>', path.getname(prj.cxxtestsrcfiles[i]))\n      _p(3,'<Command>%s --part %s -o \\\"%s\\\" \\\"%s\\\"</Command>', \ncxxtestpath, prj.cxxtestoptions, cxxtestsrcfile, cxxtesthdrfile)\n      _p(3,'<Outputs>%s;%%(Outputs)</Outputs>', cxxtestsrcfile)\n_p(2,'</CustomBuild>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nlocal function write_file_type_block(files,group_type)\nif #files > 0  then\n_p(1,'<ItemGroup>')\nfor _, current_file in ipairs(files) do\n_p(2,"
    253     "'<%s Include=\\\"%s\\\" />', group_type,path.translate(current_file,\"\\\\\"))\nend\n_p(1,'</ItemGroup>')\nend\nend\nlocal function write_file_compile_block(files,prj,configs)\nif #files > 0  then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = cfg.pchsource\nend\nend\n_p(1,'<ItemGroup>')\nfor _, current_file in ipairs(files) do\n_p(2,'<ClCompile Include=\\\"%s\\\">', path.translate(current_file, \"\\\\\"))\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and current_file == config_mappings[cfginfo] then \n_p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>'\n,premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil\nend\nend\n_p(2,'</ClCompile>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nlocal function write_nasm_asm_block(files, prj, configs)\nif not (prj.solution.nasmfor"
    254     "mat) then\nprj.solution.nasmformat = 'win32'\nend\nif not (prj.solution.nasmpath) then\nprj.solution.nasmpath = 'nasm'\nend\nif #files > 0 then\n_p(1,'<ItemGroup>')\nlocal nasmpath = path.translate(path.getrelative(prj.location, prj.solution.nasmpath),\"\\\\\")\nfor _, current_file in ipairs(files) do\n_p(2,'<CustomBuild Include=\\\"%s\\\">', path.translate(current_file,\"\\\\\"))\n_p(3,'<Message>Assembling %%(FullPath)</Message>')\n_p(3,'<Command>%s -i %s -f %s \\\"%%(FullPath)\\\" -o \\\"$(IntDir)%%(Filename).obj\\\"</Command>', \nnasmpath, \npath.translate(path.getdirectory(current_file),\"\\\\\")..\"\\\\\", \nprj.solution.nasmformat)\n_p(3,'<Outputs>$(IntDir)%%(Filename).obj;%%(Outputs)</Outputs>')\n_p(2,'</CustomBuild>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nlocal function vcxproj_files(prj)\nlocal sorted =\n{\nClCompile={},\nClInclude={},\nClASM={},\nNone={},\nResourceCompile ={}\n}\ncfg = premake.getconfig(prj)\nvs10_helpers.sort_input_files(cfg.files,sorted)\nwrite_cxxtestgen_block(prj)\nwrite_file_typ"
    255     "e_block(sorted.ClInclude,\"ClInclude\")\nwrite_file_compile_block(sorted.ClCompile,prj,prj.solution.vstudio_configs)\nwrite_nasm_asm_block(sorted.ClASM, prj, prj.solution.vstudion_configs)\nwrite_file_type_block(sorted.None,'None')\nwrite_file_type_block(sorted.ResourceCompile,'ResourceCompile')\nend\nlocal function write_filter_includes(sorted_table)\nlocal directories = vs10_helpers.table_of_file_filters(sorted_table)\nif #directories >0 then\n_p(1,'<ItemGroup>')\nfor _, dir in pairs(directories) do\n_p(2,'<Filter Include=\"%s\">',path.translate(dir,\"\\\\\"))\n_p(3,'<UniqueIdentifier>{%s}</UniqueIdentifier>',os.uuid())\n_p(2,'</Filter>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nlocal function write_file_filter_block(files,group_type)\nif #files > 0  then\n_p(1,'<ItemGroup>')\nfor _, current_file in ipairs(files) do\nlocal path_to_file = vs10_helpers.file_path(current_file)\nif path_to_file then\n_p(2,'<%s Include=\\\"%s\\\">', group_type,path.translate(current_file, \"\\\\\"))\n_p(3,'<Filter>%s</Filter>',path."
    256     "translate(path_to_file,\"\\\\\"))\n_p(2,'</%s>',group_type)\nelse\n_p(2,'<%s Include=\\\"%s\\\" />', group_type,path.translate(current_file, \"\\\\\"))\nend\nend\n_p(1,'</ItemGroup>')\nend\nend\nlocal tool_version_and_xmlns = 'ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\"'\nlocal xml_version_and_encoding = '<?xml version=\"1.0\" encoding=\"utf-8\"?>'\nlocal function vcxproj_filter_files(prj)\nlocal sorted =\n{\nClCompile={},\nClInclude={},\nClASM={},\nNone={},\nResourceCompile ={}\n}\ncfg = premake.getconfig(prj)\nvs10_helpers.sort_input_files(cfg.files,sorted)\nio.eol = \"\\r\\n\"\n_p(xml_version_and_encoding)\n_p('<Project ' ..tool_version_and_xmlns ..'>')\nwrite_filter_includes(sorted)\nwrite_file_filter_block(sorted.ClInclude,\"ClInclude\")\nwrite_file_filter_block(sorted.ClCompile,\"ClCompile\")\nwrite_file_filter_block(prj.cxxtesthdrfiles,\"CustomBuild\")\nwrite_file_filter_block(sorted.ClASM,\"ClASM\")\nwrite_file_filter_block(sorted.None,\"None\")\nwrite_file_filter"
    257     "_block(sorted.ResourceCompile,\"ResourceCompile\")\n_p('</Project>')\nend\nfunction premake.vs2010_vcxproj(prj)\nio.eol = \"\\r\\n\"\n_p(xml_version_and_encoding)\n_p('<Project DefaultTargets=\"Build\" ' ..tool_version_and_xmlns ..'>')\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />')\nconfig_type_block(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />')\n_p(1,'<ImportGroup Label=\"ExtensionSettings\">')\n_p(1,'</ImportGroup>')\nimport_props(prj)\n_p(1,'<PropertyGroup Label=\"UserMacros\" />')\nintermediate_and_out_dirs(prj)\nitem_definitions(prj)\nvcxproj_files(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />')\n_p(1,'<ImportGroup Label=\"ExtensionTargets\">')\n_p(1,'</ImportGroup>')\n_p('</Project>')\nend\nfunction premake.vs2010_vcxproj_user(prj)\n_p(xml_version_and_encoding)\n_p('<Project ' ..tool_version_and_xmlns ..'>')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nloc"
    258     "al cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.flags.NoDebugHeap then\n_p(1,'<PropertyGroup Condition=\"\\'$(Configuration)|$(Platform)\\'==\\'%s\\'\">', premake.esc(cfginfo.name))\n_p(2,'<LocalDebuggerEnvironment>_NO_DEBUG_HEAP=1</LocalDebuggerEnvironment>')\n_p(1,'</PropertyGroup>')\nend\nend\n_p('</Project>')\nend\nfunction premake.vs2010_vcxproj_filters(prj)\nvcxproj_filter_files(prj)\nend\n",
     240    "ctConfiguration Include=\"%s\">', premake.esc(cfginfo.name))\n_p(3,'<Configuration>%s</Configuration>',cfginfo.buildcfg)\n_p(3,'<Platform>%s</Platform>',cfginfo.platform)\n_p(2,'</ProjectConfiguration>')\nend\n_p(1,'</ItemGroup>')\nend\nlocal function vs2010_globals(prj)\n_p(1,'<PropertyGroup Label=\"Globals\">')\n_p(2,'<ProjectGuid>{%s}</ProjectGuid>',prj.uuid)\n_p(2,'<RootNamespace>%s</RootNamespace>',prj.name)\n_p(2,'<Keyword>Win32Proj</Keyword>')\nif _ACTION == \"vs2012\" then\n_p(2,[[<VCTargetsPath Condition=\"'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and '$(VisualStudioVersion)' == ''\">$(VCTargetsPath11)</VCTargetsPath>]])\nend\n_p(1,'</PropertyGroup>')\nend\nfunction vs10_helpers.config_type(config)\nlocal t =\n{\nSharedLib = \"DynamicLibrary\",\nStaticLib = \"StaticLibrary\",\nConsoleApp = \"Application\",\nWindowedApp = \"Application\"\n}\nreturn t[config.kind]\nend\nlocal function if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)\\'==\\'%s\\'\"'\nend\nlocal func"
     241    "tion optimisation(cfg)\nlocal result = \"Disabled\"\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = \"Full\"\nelseif (value == \"OptimizeSize\") then\nresult = \"MinSpace\"\nelseif (value == \"OptimizeSpeed\") then\nresult = \"MaxSpeed\"\nend\nend\nreturn result\nend\nlocal function config_type_block(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<PropertyGroup '..if_config_and_platform() ..' Label=\"Configuration\">'\n, premake.esc(cfginfo.name))\n_p(2,'<ConfigurationType>%s</ConfigurationType>',vs10_helpers.config_type(cfg))\n_p(2,'<CharacterSet>%s</CharacterSet>',iif(cfg.flags.Unicode,\"Unicode\",\"MultiByte\"))\n_p(2,'<UseDebugLibraries>%s</UseDebugLibraries>'\n,iif(optimisation(cfg) == \"Disabled\",\"true\",\"false\"))\nif _ACTION == \"vs2012\" then\n_p(2, '<PlatformToolset>v110</PlatformToolset>')\nend\nif cfg.flags.MFC then\n_p(2,'<UseOfMfc>Dynamic</UseOfMfc>')\nend\n_"
     242    "p(1,'</PropertyGroup>')\nend\nend\nlocal function import_props(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ImportGroup '..if_config_and_platform() ..' Label=\"PropertySheets\">'\n,premake.esc(cfginfo.name))\n_p(2,'<Import Project=\"$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists(\\'$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\\')\" Label=\"LocalAppDataPlatform\" />')\n_p(1,'</ImportGroup>')\nend\nend\nlocal function incremental_link(cfg,cfginfo)\nif cfg.kind ~= \"StaticLib\" then\nShoudLinkIncrementally = 'false'\nif optimisation(cfg) == \"Disabled\" then\nShoudLinkIncrementally = 'true'\nend\n_p(2,'<LinkIncremental '..if_config_and_platform() ..'>%s</LinkIncremental>'\n,premake.esc(cfginfo.name),ShoudLinkIncrementally)\nend\nend\nlocal function ignore_import_lib(cfg,cfginfo)\nif cfg.kind == \"SharedLib\" then\nlocal shouldIgnore = \"false\"\nif cfg.flags.NoImportLib"
     243    " then shouldIgnore = \"true\" end\n _p(2,'<IgnoreImportLibrary '..if_config_and_platform() ..'>%s</IgnoreImportLibrary>'\n,premake.esc(cfginfo.name),shouldIgnore)\nend\nend\nlocal function intermediate_and_out_dirs(prj)\n_p(1,'<PropertyGroup>')\n_p(2,'<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(2,'<OutDir '..if_config_and_platform() ..'>%s\\\\</OutDir>'\n, premake.esc(cfginfo.name),premake.esc(cfg.buildtarget.directory) )\n_p(2,'<IntDir '..if_config_and_platform() ..'>%s\\\\</IntDir>'\n, premake.esc(cfginfo.name), premake.esc(cfg.objectsdir))\n_p(2,'<TargetName '..if_config_and_platform() ..'>%s</TargetName>'\n,premake.esc(cfginfo.name),path.getbasename(cfg.buildtarget.name))\nignore_import_lib(cfg,cfginfo)\nincremental_link(cfg,cfginfo)\nif cfg.flags.NoManifest then\n_p(2,'<GenerateManifest '..if_config_and_platform() ..'>false</GenerateManifest>'\n,prema"
     244    "ke.esc(cfginfo.name))\nend\nend\n_p(1,'</PropertyGroup>')\nend\nlocal function runtime(cfg)\nlocal runtime\nif premake.config.isdebugbuild(cfg) then\nruntime = iif(cfg.flags.StaticRuntime,\"MultiThreadedDebug\", \"MultiThreadedDebugDLL\")\nelse\nruntime = iif(cfg.flags.StaticRuntime, \"MultiThreaded\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nlocal function precompiled_header(cfg)\n      if not cfg.flags.NoPCH and cfg.pchheader then\n_p(3,'<PrecompiledHeader>Use</PrecompiledHeader>')\n_p(3,'<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>', path.getname(cfg.pchheader))\nelse\n_p(3,'<PrecompiledHeader></PrecompiledHeader>')\nend\nend\nlocal function preprocessor(indent,cfg)\nif #cfg.defines > 0 then\n_p(indent,'<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>'\n,premake.esc(table.concat(cfg.defines, \";\")))\nelse\n_p(indent,'<PreprocessorDefinitions></PreprocessorDefinitions>')\nend\nend\nlocal function include_dirs(indent,cfg)\nif #cfg.includedirs > 0 then\n_p(indent,"
     245    "'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>'\n,premake.esc(path.translate(table.concat(cfg.includedirs, \";\"), '\\\\')))\nend\nend\nlocal function resource_compile(cfg)\n_p(2,'<ResourceCompile>')\npreprocessor(3,cfg)\ninclude_dirs(3,cfg)\n_p(2,'</ResourceCompile>')\nend\nlocal function exceptions(cfg)\nif cfg.flags.NoExceptions then\n_p(2,'<ExceptionHandling>false</ExceptionHandling>')\nelseif cfg.flags.SEH then\n_p(2,'<ExceptionHandling>Async</ExceptionHandling>')\nend\nend\nlocal function rtti(cfg)\nif cfg.flags.NoRTTI then\n_p(3,'<RuntimeTypeInfo>false</RuntimeTypeInfo>')\nend\nend\nlocal function wchar_t_buildin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>')\nend\nend\nlocal function sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEn"
     246    "hancedInstructionSet>')\nelseif cfg.flags.EnableSSE2 then\n_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>')\nend\nend\nlocal function floating_point(cfg)\n     if cfg.flags.FloatFast then\n_p(3,'<FloatingPointModel>Fast</FloatingPointModel>')\nelseif cfg.flags.FloatStrict then\n_p(3,'<FloatingPointModel>Strict</FloatingPointModel>')\nend\nend\nlocal function debug_info(cfg)\nlocal debug_info = ''\nif cfg.flags.Symbols then\nif optimisation(cfg) ~= \"Disabled\" or cfg.flags.NoEditAndContinue then\ndebug_info = \"ProgramDatabase\"\nelseif cfg.platform ~= \"x64\" then\ndebug_info = \"EditAndContinue\"\nelse\ndebug_info = \"OldStyle\"\nend\nend\n_p(3,'<DebugInformationFormat>%s</DebugInformationFormat>',debug_info)\nend\nlocal function minimal_build(cfg)\nif premake.config.isdebugbuild(cfg) and not cfg.flags.NoMinimalRebuild then\n_p(3,'<MinimalRebuild>true</MinimalRebuild>')\nelse\n_p(3,'<MinimalRebuild>false</MinimalRebuild>')\nend\nend\nlocal function compile_languag"
     247    "e(cfg)\nif cfg.language == \"C\" then\n_p(3,'<CompileAs>CompileAsC</CompileAs>')\nend\nend\nlocal function vs10_clcompile(cfg)\n_p(2,'<ClCompile>')\nif #cfg.buildoptions > 0 then\n_p(3,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',\ntable.concat(premake.esc(cfg.buildoptions), \" \"))\nend\n_p(3,'<Optimization>%s</Optimization>',optimisation(cfg))\ninclude_dirs(3,cfg)\npreprocessor(3,cfg)\nminimal_build(cfg)\nif optimisation(cfg) == \"Disabled\" then\n_p(3,'<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>')\nif cfg.flags.ExtraWarnings then\n_p(3,'<SmallerTypeCheck>true</SmallerTypeCheck>')\nend\nelse\n_p(3,'<StringPooling>true</StringPooling>')\nend\n_p(3,'<RuntimeLibrary>%s</RuntimeLibrary>', runtime(cfg))\n_p(3,'<FunctionLevelLinking>true</FunctionLevelLinking>')\nprecompiled_header(cfg)\nif cfg.flags.ExtraWarnings then\n_p(3,'<WarningLevel>Level4</WarningLevel>')\nelse\n_p(3,'<WarningLevel>Level3</WarningLevel>')\nend\nif cfg.flags.FatalWarnings then\n_p(3,'<TreatWarningAsError>t"
     248    "rue</TreatWarningAsError>')\nend\nexceptions(cfg)\nrtti(cfg)\nwchar_t_buildin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(cfg)\nif cfg.flags.NoFramePointer then\n_p(3,'<OmitFramePointers>true</OmitFramePointers>')\nend\ncompile_language(cfg)\n_p(2,'</ClCompile>')\nend\nlocal function event_hooks(cfg, prj)\nif #cfg.postbuildcommands> 0 then\n    _p(2,'<PostBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PostBuildEvent>')\nend\nif #cfg.prebuildcommands> 0 or prj.cxxtestrootfile then\n    _p(2,'<PreBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\nif(prj.solution.cxxtestpath and prj.cxxtestrootfile and prj.cxxtesthdrfiles and prj.cxxtestsrcfiles) then\nlocal cxxtestpath = path.translate(path.getrelative(prj.location, prj.solution.cxxtestpath),\"\\\\\")\nlocal cxxtestrootfile = path.translate(prj.cxxtestrootfile,\"\\\\\")\n_p(3,'<Command>%s --root %s &gt; %s</Comm"
     249    "and>', cxxtestpath, prj.cxxtestrootoptions, cxxtestrootfile)\nend\n_p(2,'</PreBuildEvent>')\nend\nif #cfg.prelinkcommands> 0 then\n    _p(2,'<PreLinkEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PreLinkEvent>')\nend\nend\nlocal function additional_options(indent,cfg)\nif #cfg.linkoptions > 0 then\n_p(indent,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',\ntable.concat(premake.esc(cfg.linkoptions), \" \"))\nend\nend\nlocal function item_def_lib(cfg)\nif cfg.kind == 'StaticLib' then\n_p(1,'<Lib>')\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',cfg.buildtarget.name)\nadditional_options(2,cfg)\n_p(1,'</Lib>')\nend\nend\nlocal function link_target_machine(cfg)\nlocal target\nif cfg.platform == nil or cfg.platform == \"x32\" then target =\"MachineX86\"\nelseif cfg.platform == \"x64\" then target =\"MachineX64\"\nend\n_p(3,'<TargetMachine>%s</TargetMachine>', target)\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"Share"
     250    "dLib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'<ImportLibrary>%s</ImportLibrary>',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nlocal function common_link_section(cfg)\n_p(3,'<SubSystem>%s</SubSystem>',iif(cfg.kind == \"ConsoleApp\",\"Console\", \"Windows\"))\nif cfg.flags.Symbols then \n_p(3,'<GenerateDebugInformation>true</GenerateDebugInformation>')\nelse\n_p(3,'<GenerateDebugInformation>false</GenerateDebugInformation>')\nend\nif optimisation(cfg) ~= \"Disabled\" then\n_p(3,'<OptimizeReferences>true</OptimizeReferences>')\n_p(3,'<EnableCOMDATFolding>true</EnableCOMDATFolding>')\nend\nif cfg.flags.Symbols then\n_p(3,'<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>'\n, path.getbasename(cfg.buildtarget.name))\nend\nend\nlocal function item_link(cfg)\n_p(2,'<Link>')\nif cfg.kind ~= 'StaticLib' then\nif #cfg.links > 0 then\n_p(3,'<AdditionalDependencies>%s;%%(AdditionalDependencies)</AdditionalDependencies>',\ntable."
     251    "concat(premake.getlinks(cfg, \"all\", \"fullpath\"), \";\"))\nend\n_p(3,'<OutputFile>$(OutDir)%s</OutputFile>', cfg.buildtarget.name)\n_p(3,'<AdditionalLibraryDirectories>%s%s%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>',\ntable.concat(premake.esc(path.translate(cfg.libdirs, '\\\\')) , \";\"),\niif(cfg.libdirs and #cfg.libdirs >0,';',''))\ncommon_link_section(cfg)\nif vs10_helpers.config_type(cfg) == 'Application' and not cfg.flags.WinMain then\n_p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>')\nend\nimport_lib(cfg)\n_p(3,'<TargetMachine>%s</TargetMachine>', iif(cfg.platform == \"x64\", \"MachineX64\", \"MachineX86\"))\nadditional_options(3,cfg)\nelse\ncommon_link_section(cfg)\nend\n_p(2,'</Link>')\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ItemDefinitionGroup ' ..if_config_and_platform() ..'>'\n,premake.esc(cfginfo.name))\nvs10_clcompil"
     252    "e(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nitem_link(cfg)\nevent_hooks(cfg, prj)\n_p(1,'</ItemDefinitionGroup>')\nend\nend\n  --     <ProjectReference Include=\"zlibvc.vcxproj\">\n  --       <Project>{8fd826f8-3739-44e6-8cc8-997122e53b8d}</Project>\n  --     </ProjectReference>\n  --   </ItemGroup>\nlocal function write_cxxtestgen_block(prj)\nif(prj.solution.cxxtestpath and prj.cxxtestrootfile and prj.cxxtesthdrfiles and prj.cxxtestsrcfiles) then\nlocal cxxtestpath = path.translate(path.getrelative(prj.location, prj.solution.cxxtestpath),\"\\\\\")\n_p(1,'<ItemGroup>')\nfor i, file in ipairs(prj.cxxtesthdrfiles) do\nlocal cxxtesthdrfile = path.translate(file,\"\\\\\")\nlocal cxxtestsrcfile = path.translate(prj.cxxtestsrcfiles[i],\"\\\\\")\n_p(2,'<CustomBuild Include=\\\"%s\\\">', cxxtesthdrfile)\n      _p(3,'<Message>Generating %s</Message>', path.getname(prj.cxxtestsrcfiles[i]))\n      _p(3,'<Command>%s --part %s -o \\\"%s\\\" \\\"%s\\\"</Command>', \ncxxtestpath, prj.cxxtestoptions, cxxtestsrcfile, cxx"
     253    "testhdrfile)\n      _p(3,'<Outputs>%s;%%(Outputs)</Outputs>', cxxtestsrcfile)\n_p(2,'</CustomBuild>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nlocal function write_file_type_block(files,group_type)\nif #files > 0  then\n_p(1,'<ItemGroup>')\nfor _, current_file in ipairs(files) do\n_p(2,'<%s Include=\\\"%s\\\" />', group_type,path.translate(current_file,\"\\\\\"))\nend\n_p(1,'</ItemGroup>')\nend\nend\nlocal function write_file_compile_block(files,prj,configs)\nif #files > 0  then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = cfg.pchsource\nend\nend\n_p(1,'<ItemGroup>')\nfor _, current_file in ipairs(files) do\n_p(2,'<ClCompile Include=\\\"%s\\\">', path.translate(current_file, \"\\\\\"))\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and current_file == config_mappings[cfginfo] then \n_p(3,'<PrecompiledHe"
     254    "ader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>'\n,premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil\nend\nend\n_p(2,'</ClCompile>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nlocal function write_nasm_asm_block(files, prj, configs)\nif not (prj.solution.nasmformat) then\nprj.solution.nasmformat = 'win32'\nend\nif not (prj.solution.nasmpath) then\nprj.solution.nasmpath = 'nasm'\nend\nif #files > 0 then\n_p(1,'<ItemGroup>')\nlocal nasmpath = path.translate(path.getrelative(prj.location, prj.solution.nasmpath),\"\\\\\")\nfor _, current_file in ipairs(files) do\n_p(2,'<CustomBuild Include=\\\"%s\\\">', path.translate(current_file,\"\\\\\"))\n_p(3,'<Message>Assembling %%(FullPath)</Message>')\n_p(3,'<Command>%s -i %s -f %s \\\"%%(FullPath)\\\" -o \\\"$(IntDir)%%(Filename).obj\\\"</Command>', \nnasmpath, \npath.translate(path.getdirectory(current_file),\"\\\\\")..\"\\\\\", \nprj.solution.nasmformat)\n_p(3,'<Outputs>$(IntDir)%%(Filename).obj;%%(Outputs)</Outputs>')\n_p(2,'</CustomBuild>')\nend"
     255    "\n_p(1,'</ItemGroup>')\nend\nend\nlocal function vcxproj_files(prj)\nlocal sorted =\n{\nClCompile={},\nClInclude={},\nClASM={},\nNone={},\nResourceCompile ={}\n}\ncfg = premake.getconfig(prj)\nvs10_helpers.sort_input_files(cfg.files,sorted)\nwrite_cxxtestgen_block(prj)\nwrite_file_type_block(sorted.ClInclude,\"ClInclude\")\nwrite_file_compile_block(sorted.ClCompile,prj,prj.solution.vstudio_configs)\nwrite_nasm_asm_block(sorted.ClASM, prj, prj.solution.vstudion_configs)\nwrite_file_type_block(sorted.None,'None')\nwrite_file_type_block(sorted.ResourceCompile,'ResourceCompile')\nend\nlocal function write_filter_includes(sorted_table)\nlocal directories = vs10_helpers.table_of_file_filters(sorted_table)\nif #directories >0 then\n_p(1,'<ItemGroup>')\nfor _, dir in pairs(directories) do\n_p(2,'<Filter Include=\"%s\">',path.translate(dir,\"\\\\\"))\n_p(3,'<UniqueIdentifier>{%s}</UniqueIdentifier>',os.uuid())\n_p(2,'</Filter>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nlocal function write_file_filter_block(files,group_ty"
     256    "pe)\nif #files > 0  then\n_p(1,'<ItemGroup>')\nfor _, current_file in ipairs(files) do\nlocal path_to_file = vs10_helpers.file_path(current_file)\nif path_to_file then\n_p(2,'<%s Include=\\\"%s\\\">', group_type,path.translate(current_file, \"\\\\\"))\n_p(3,'<Filter>%s</Filter>',path.translate(path_to_file,\"\\\\\"))\n_p(2,'</%s>',group_type)\nelse\n_p(2,'<%s Include=\\\"%s\\\" />', group_type,path.translate(current_file, \"\\\\\"))\nend\nend\n_p(1,'</ItemGroup>')\nend\nend\nlocal tool_version_and_xmlns = 'ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\"'\nlocal xml_version_and_encoding = '<?xml version=\"1.0\" encoding=\"utf-8\"?>'\nlocal function vcxproj_filter_files(prj)\nlocal sorted =\n{\nClCompile={},\nClInclude={},\nClASM={},\nNone={},\nResourceCompile ={}\n}\ncfg = premake.getconfig(prj)\nvs10_helpers.sort_input_files(cfg.files,sorted)\nio.eol = \"\\r\\n\"\n_p(xml_version_and_encoding)\n_p('<Project ' ..tool_version_and_xmlns ..'>')\nwrite_filter_includes(sorted)\nwrit"
     257    "e_file_filter_block(sorted.ClInclude,\"ClInclude\")\nwrite_file_filter_block(sorted.ClCompile,\"ClCompile\")\nwrite_file_filter_block(prj.cxxtesthdrfiles,\"CustomBuild\")\nwrite_file_filter_block(sorted.ClASM,\"ClASM\")\nwrite_file_filter_block(sorted.None,\"None\")\nwrite_file_filter_block(sorted.ResourceCompile,\"ResourceCompile\")\n_p('</Project>')\nend\nfunction premake.vs2010_vcxproj(prj)\nio.eol = \"\\r\\n\"\n_p(xml_version_and_encoding)\n_p('<Project DefaultTargets=\"Build\" ' ..tool_version_and_xmlns ..'>')\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />')\nconfig_type_block(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />')\n_p(1,'<ImportGroup Label=\"ExtensionSettings\">')\n_p(1,'</ImportGroup>')\nimport_props(prj)\n_p(1,'<PropertyGroup Label=\"UserMacros\" />')\nintermediate_and_out_dirs(prj)\nitem_definitions(prj)\nvcxproj_files(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" /"
     258    ">')\n_p(1,'<ImportGroup Label=\"ExtensionTargets\">')\n_p(1,'</ImportGroup>')\n_p('</Project>')\nend\nfunction premake.vs2010_vcxproj_user(prj)\n_p(xml_version_and_encoding)\n_p('<Project ' ..tool_version_and_xmlns ..'>')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.flags.NoDebugHeap then\n_p(1,'<PropertyGroup Condition=\"\\'$(Configuration)|$(Platform)\\'==\\'%s\\'\">', premake.esc(cfginfo.name))\n_p(2,'<LocalDebuggerEnvironment>_NO_DEBUG_HEAP=1</LocalDebuggerEnvironment>')\n_p(1,'</PropertyGroup>')\nend\nend\n_p('</Project>')\nend\nfunction premake.vs2010_vcxproj_filters(prj)\nvcxproj_filter_files(prj)\nend\n",
    259259
    260260    /* actions/xcode/_xcode.lua */
    261261    "premake.xcode = { }\nnewaction \n{\ntrigger         = \"xcode3\",\nshortname       = \"Xcode 3\",\ndescription     = \"Generate Apple Xcode 3 project files (experimental)\",\nos              = \"macosx\",\nvalid_kinds     = { \"ConsoleApp\", \"WindowedApp\", \"SharedLib\", \"StaticLib\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools     = {\ncc     = { \"gcc\" },\n},\nvalid_platforms = { \nNative = \"Native\", \nx32 = \"Native 32-bit\", \nx64 = \"Native 64-bit\", \nUniversal32 = \"32-bit Universal\", \nUniversal64 = \"64-bit Universal\", \nUniversal = \"Universal\",\n},\ndefault_platform = \"Universal\",\nonsolution = function(sln)\npremake.xcode.preparesolution(sln)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", premake.xcode.project)\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\nend,\noncheckproject = function(prj)\nlocal last\nfor cfg in premake.eachconfig(prj) do\nif last and last ~= cfg.kind then\nerror(\"Project '"
  • workspaces

  • workspaces/update-workspaces-with-atlas.bat

    Property changes on: workspaces
    ___________________________________________________________________
    Added: svn:ignore
    ## -0,0 +1 ##
    +vc2012
     
     1@echo off
     2rem ** Create Visual Studio Workspaces on Windows **
     3
     4cd ..\premake
     5if not exist ..\workspaces\vc2012\SKIP_PREMAKE_HERE premake4\bin\release\premake4 --outpath="../workspaces/vc2012" --collada --atlas %* vs2012
     6cd ..\workspaces
  • workspaces/update-workspaces.bat

     
    44cd ..\premake
    55if not exist ..\workspaces\vc2008\SKIP_PREMAKE_HERE premake4\bin\release\premake4 --outpath="../workspaces/vc2008" --collada %* vs2008
    66if not exist ..\workspaces\vc2010\SKIP_PREMAKE_HERE premake4\bin\release\premake4 --outpath="../workspaces/vc2010" --collada %* vs2010
     7if not exist ..\workspaces\vc2012\SKIP_PREMAKE_HERE premake4\bin\release\premake4 --outpath="../workspaces/vc2012" --collada %* vs2012
    78cd ..\workspaces