From d28ce552ce6f3aa16a1eaf2c50148b207ea7f124 Mon Sep 17 00:00:00 2001 From: LiamDevine Date: Thu, 15 Jul 2010 00:47:35 +0100 Subject: [PATCH] embeded lua source. Checked clean operation on a solution with multiple projects, yet no intergration tests added. --- src/host/scripts.c | 53 +++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/src/host/scripts.c b/src/host/scripts.c index 909bd1f3..fb412478 100644 --- a/src/host/scripts.c +++ b/src/host/scripts.c @@ -164,12 +164,12 @@ const char* builtin_scripts[] = { "dcfg in ipairs(sln.configurations) do\nfor _, platform in ipairs(platforms) do\nlocal entry = { }\nentry.src_buildcfg = buildcfg\nentry.src_platform = platform\nif platform ~= \"PS3\" then\nentry.buildcfg = buildcfg\nentry.platform = premake.vstudio_platforms[platform]\nelse\nentry.buildcfg = platform .. \" \" .. buildcfg\nentry.platform = \"Win32\"\nend\nentry.name = entry.buildcfg .. \"|\" .. entry.platform\nentry.isreal = (platform ~= \"any\" and platform ~= \"mixed\")\ntable.insert(cfgs, entry)\nend\nend\nreturn cfgs\nend\nfunction _VS.cfgtype(cfg)\nif (cfg.kind == \"SharedLib\") then\nreturn 2\nelseif (cfg.kind == \"StaticLib\") then\nreturn 4\nelse\nreturn 1\nend\nend\nfunction premake.vstudio.cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\npremake.clean.file(sln, \"%%.ncb\")\npremake.clean.file(sln, \"%%.userprefs\")\npremake.clean.file(sln, \"%%.usertasks\")\nend\nfunction premake.vstudio.cleanproject(prj)\nlocal fext = iif(premake.isdotnetproject(prj), \"." "csproj\", \".vcproj\")\nlocal fname = premake.project.getfilename(prj, \"%%\")\nos.remove(fname .. fext)\nos.remove(fname .. fext .. \".user\")\nos.remove(fname .. \".pidb\")\nlocal userfiles = os.matchfiles(fname .. \".*.user\")\nfor _, fname in ipairs(userfiles) do\nos.remove(fname)\nend\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, \"\")\nelseif (state == \"GroupEnd\") then\noutput(indent, \"\")\nelse\nou" "tput(indent, \"\")\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\")\noutput(indent, \"\\t\\t\")\noutput(indent, \"\\t\")\nend\nend\nend\noutput(indent, \"\")\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\") then\nresult = 1\nelseif (value == \"OptimizeSpeed\") then\nresult = 2\nen" - "d\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 = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = funct" - "ion(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, \"%%.sln\", premake.vs2003_solution)\nend,\nonproject = function(prj)\ni" - "f 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) then\npremake.generate(prj, \"%%.csproj\", premake.vs2005_csproj)\npremak" - "e.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.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 \n{\ntrigger = \"vs2010\",\nshortname = \"Visual Studio 2010\",\ndescription = \"Generate Microsoft Visual Studio 2010 project files\",\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.vs2010_cleansolution,\noncleanproject = premake.vs2010_cleanproject,\noncleantarget = premak" - "e.vs2010_cleantarget\n}", + "d\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\nfunction premake.vs2010_cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\nend\nfunction premake.vs2010_cleanproject(prj)\nlocal fname = premake.project.getfilename(prj, \"%%\")\nlocal vcxname = fname .. \".vcxproj\"\nos.remove(fname .. '.vcxproj')\nos.remove(fname .. '.vcxproj.user')\nos.remove(fname .. '.vcxproj.filters')\nos.remove(fname .. '.sdf')\nend\nfunction premake.v" + "s2010_cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\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.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.cle" + "antarget\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.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\",\ndesc" + "ription = \"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, \"%%.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\",\n" + "valid_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_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 Microsoft Visual Studio 2010 project files\",\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.vs2010_cleansolution,\noncleanproject = premake.vs2010_cleanproject,\noncleantarget = premake.vs2010_cleantarget\n}", /* actions/vstudio/vs2002_solution.lua */ "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(" @@ -229,24 +229,24 @@ const char* builtin_scripts[] = { "= 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", /* actions/vstudio/vs2010_vcxproxj.lua */ - "\npremake.vstudio.vcxproj = { }\nfunction remove_relative_path(file)\nfile = file:gsub(\"%.%.\\\\\",'')\nfile = file:gsub(\"%.\\\\\",'')\nreturn file\nend\nfunction file_path(file)\nfile = 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 list_of_directories_in_path(path)\nlocal list={}\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 table_of_filters(t)\nlocal filters ={}\nfor key, value in pairs(t) do\nlocal result = list_of_directories_in_path(value)\nfor __,dir in ipairs(result) do\nif table.contains(filters,dir) ~= true then\nfilters[#filters +1] = dir\nend\nend\nend\nreturn filters\nend\nfunction table_of_file_filters(files)\nlocal filters ={}\nfor key, valueTable in pairs(files) do\nfor _, entry in ipairs(valueTable)" - " do\nlocal result = list_of_directories_in_path(entry)\nfor __,dir in ipairs(result) do\nif table.contains(filters,dir) ~= true then\nfilters[#filters +1] = dir\nend\nend\nend\nend\nreturn filters\nend\nlocal function vs2010_config(prj)\n_p(1,'')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\n_p(2,'', premake.esc(cfginfo.name))\n_p(3,'%s',cfginfo.buildcfg)\n_p(3,'%s',cfginfo.platform)\n_p(2,'')\nend\n_p(1,'')\nend\nlocal function vs2010_globals(prj)\n_p(1,'')\n_p(2,'{%s}',prj.uuid)\n_p(2,'%s',prj.name)\n_p(2,'Win32Proj')\n_p(1,'')\nend\nfunction config_type(config)\nlocal t =\n{\nSharedLib = \"DynamicLibrary\",\nStaticLib = \"StaticLibrary\",\nConsoleApp = \"Application\",\n}\nreturn t[config.kind]\nend\nfunct" - "ion if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)'\nend\nfunction 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,''\n, premake.esc(cfginfo.name))\n_p(2,'%s',config_type(cfg))\n_p(2,'%s',iif(cfg.flags.Unicode,\"Unicode\",\"MultiByte\"))\nif cfg.flags.MFC then\n_p(2,'Dynamic')\nend\nlocal use_debug = \"false\"\nif optimisation(cfg) == \"Disabled\" then \nuse_debug = \"true\" \nelse\n_p(2,'true')\nend\n_p(2,'%s',use_debug)\n_p(1,'')\nend\nend\nfunction 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,''\n,premake.esc(cfginfo.name))\n_p(2,'')\n_p(1,'')\nend\nend\nfunction incremental_link(cfg,cfginfo)\nif cfg.kind ~= \"StaticLib\" then\nShoudLinkIncrementally = 'false'\nif optimisation(cfg) == \"Disabled\" then\nShoudLinkIncrementally = 'true'\nend\n_p(2,'%s'\n,premake.esc(cfginfo.name),ShoudLinkIncrementally)\nend\nend\nfunction ignore_import_lib(cfg,cfginfo)\nif cfg.kind == \"SharedLib\" then\nlocal shouldIgnore = \"false\"\nif cfg.flags.NoImportLib then shouldIgnore = \"true\" end\n _p(2,'%s'\n,premake.esc(cfginfo.name),sho" - "uldIgnore)\nend\nend\nfunction intermediate_and_out_dirs(prj)\n_p(1,'')\n_p(2,'<_ProjectFileVersion>10.0.30319.1')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(2,'%s\\\\'\n, premake.esc(cfginfo.name),premake.esc(cfg.buildtarget.directory) )\n_p(2,'%s\\\\'\n, premake.esc(cfginfo.name), premake.esc(cfg.objectsdir))\n_p(2,'%s'\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,'false'\n,premake.esc(cfginfo.name))\nend\nend\n_p(1,'')\nend\nfunction 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\nfunction runtime(cfg)\nlocal runtime\nif cfg.flags.StaticRuntime then\nruntime = iif(cfg.flags.Symbols,\"MultiThreadedDebug\",\"MultiThreaded\")\nelse\nruntime = iif(cfg.flags.Symbols, \"MultiThreadedDebugDLL\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nfunction precompiled_header(cfg)\n if not cfg.flags.NoPCH and cfg.pchheader then\n_p(3,'Use')\n_p(3,'%s', path.getname(cfg.pchheader))\nelse\n_p(3,'')\nend\nend\nfunction preprocessor(indent,cfg)\nif #cfg.defines > 0 then\n_p(indent,'%s;%%(PreprocessorDefinitions)'\n,premake.esc(table.concat(cfg.defines, \";\"" - ")))\nelse\n_p(indent,'')\nend\nend\nfunction include_dirs(indent,cfg)\nif #cfg.includedirs > 0 then\n_p(indent,'%s;%%(AdditionalIncludeDirectories)'\n,premake.esc(path.translate(table.concat(cfg.includedirs, \";\"), '\\\\')))\nend\nend\nfunction resource_compile(cfg)\n_p(2,'')\npreprocessor(3,cfg)\ninclude_dirs(3,cfg)\n_p(2,'')\nend\nfunction exceptions(cfg)\nif cfg.flags.NoExceptions then\n_p(2,'false')\nelseif cfg.flags.SEH then\n_p(2,'Async')\nend\nend\nfunction rtti(cfg)\nif cfg.flags.NoRTTI then\n_p(3,'false')\nend\nend\nfunction wchar_t_buildin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'true')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'false')\nend\nend\nfunction sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3,'StreamingSIMDExtensions')\nelseif cfg.flags.EnableSSE2 then\n_p(3,'StreamingSIMDExtensions2')\nend\nend\nfunction floating_point(cfg)\n if cfg.flags.FloatFast then\n_p(3,'Fast')\nelseif cfg.flags.FloatStrict then\n_p(3,'Strict')\nend\nend\nfunction debug_info(cfg)\nif cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then\n_p(3,'EditAndContinue')\nelse\n_p(3,'')\nend\nend\nfunction minimal_build(cfg)\nif cfg.flags.Symbols and not cfg.flags.NoMinimalRebuild then\n_p(3,'true')\nelseif cfg.flags.Symbols then\n_p(3,'false')\nend\nend\nfunction compile_language(cfg)\nif cfg.lang" - "uage == \"C\" then\n_p(3,'CompileAsC')\nend\nend\nfunction vs10_clcompile(cfg)\n_p(2,'')\nif #cfg.buildoptions > 0 then\n_p(3,'%s %%(AdditionalOptions)',\ntable.concat(premake.esc(cfg.buildoptions), \" \"))\nend\n_p(3,'%s',optimisation(cfg))\ninclude_dirs(3,cfg)\npreprocessor(3,cfg)\nminimal_build(cfg)\nif optimisation(cfg) == \"Disabled\" then\n_p(3,'EnableFastChecks')\nif cfg.flags.ExtraWarnings then\n_p(3,'true')\nend\nelse\n_p(3,'true')\nend\n_p(3,'%s', runtime(cfg))\n_p(3,'true')\nprecompiled_header(cfg)\nif cfg.flags.ExtraWarnings then\n_p(3,'Level4')\nelse\n_p(3,'Level3')\nend\nif cfg.flags.FatalWarnings then\n_p(3,'true" - "')\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,'true')\nend\ncompile_language(cfg)\n_p(2,'')\nend\nfunction event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nend\nfunction item_def_lib(cfg)\nif cfg.kind == 'StaticLib' then\n_p(1,'')\n_p(2,'$(OutDir)%s',cfg.buildtarget.name)\n_p(1,'<" - "/Lib>')\nend\nend\nfunction 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,'%s', target)\nend\nfunction import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'%s',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nfunction common_link_section(cfg)\n_p(3,'%s',iif(cfg.kind == \"ConsoleApp\",\"Console\", \"Windows\"))\nif cfg.flags.Symbols then \n_p(3,'true')\nelse\n_p(3,'false')\nend\nif optimisation(cfg) ~= \"Disabled\" then\n_p(3,'true')\n_p(3,'true')\nend\n_p(3,'$(OutDir)%s." - "pdb'\n, path.getbasename(cfg.buildtarget.name))\nend\nfunction item_link(cfg)\n_p(2,'')\nif cfg.kind ~= 'StaticLib' then\nif #cfg.links > 0 then\n_p(3,'%s;%%(AdditionalDependencies)',\ntable.concat(premake.getlinks(cfg, \"all\", \"fullpath\"), \";\"))\nend\n_p(3,'$(OutDir)%s', cfg.buildtarget.name)\n_p(3,'%s%s%%(AdditionalLibraryDirectories)',\ntable.concat(premake.esc(path.translate(cfg.libdirs, '\\\\')) , \";\"),\niif(cfg.libdirs and #cfg.libdirs >0,';',''))\ncommon_link_section(cfg)\nif (cfg.kind == \"ConsoleApp\" or cfg.kind == \"WindowedApp\") and not cfg.flags.WinMain then\n_p(3,'mainCRTStartup')\nend\nimport_lib(cfg)\n_p(3,'%s', iif(cfg.platform == \"x64\", \"MachineX64\", \"MachineX86\"))\nelse\ncommon_link_section(cfg)\nend\n_p(2,'')\nend\n \nfunction item_defi" - "nitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nitem_link(cfg)\nevent_hooks(cfg)\n_p(1,'')\nend\nend\nfunction 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 sort_input_files(files,sorted_container)\nlocal types = \n{\nh= \"ClInclude\",\nhpp= \"ClInclude\",\nhxx= \"ClInclude\",\nc= \"ClCompile\",\ncpp= \"ClCompile\",\ncxx= \"ClCompile\",\ncc= \"ClCompile\"\n}\nfor _, current_file in ipairs(files) do\nlocal translated_path = path.translate(current_file, '\\\\')\nlocal ext = get_file_extension(translated_path)\nif ext then\nlocal type = types[ext]\nif type then\ntable.insert(sorted_contai" - "ner[type],translated_path)\nelse\ntable.insert(sorted_container.None,translated_path)\nend\nend\nend\nend\n -- \n -- {8fd826f8-3739-44e6-8cc8-997122e53b8d}\n -- \n -- \nfunction write_file_type_block(files,group_type)\nif #files > 0 then\n_p(1,'')\nfor _, current_file in ipairs(files) do\n_p(2,'<%s Include=\\\"%s\\\" />', group_type,current_file)\nend\n_p(1,'')\nend\nend\nfunction vcxproj_files(prj)\nlocal sorted =\n{\nClCompile={},\nClInclude={},\nNone={}\n}\ncfg = premake.getconfig(prj)\nsort_input_files(cfg.files,sorted)\nwrite_file_type_block(sorted.ClInclude,\"ClInclude\")\nwrite_file_type_block(sorted.ClCompile,'ClCompile')\nwrite_file_type_block(sorted.None,'None')\nend\nfunction write_filter_includes(sorted_table)\nlocal directories = table_of_file_filters(sorted_table)\nif #directories >0 then\n_p(1,'')\nfor _, dir in pairs(directories) do\n_p(2,'',dir)\n_p(3,'{%s}',os.uuid())\n_p(2,'')\nend\n_p(1,'')\nend\nend\nfunction write_file_filter_block(files,group_type)\nif #files > 0 then\n_p(1,'')\nfor _, current_file in ipairs(files) do\nlocal path_to_file = file_path(current_file)\nif path_to_file then\n_p(2,'<%s Include=\\\"%s\\\">', group_type,path.translate(current_file, \"\\\\\"))\n_p(3,'%s',path_to_file)\n_p(2,'',group_type)\nelse\n_p(2,'<%s Include=\\\"%s\\\" />', group_type,path.translate(current_file, \"\\\\\"))\nend\nend\n_p(1,'')\nend\nend\nfunction vcxproj_filter_files(prj)\nlocal sorted =\n{\nClCompile={},\nClInclude={},\nNone={}\n}\ncfg = premake.getconfig(prj)\nsort_input_files(cfg.files,sorted)\nio.eol = \"\\r\\n\"\n_p('')\n_p('')\nwrite_filter_includes(sorted)\nwrite_file_filter_block(sorted" - ".ClInclude,\"ClInclude\")\nwrite_file_filter_block(sorted.ClCompile,\"ClCompile\")\nwrite_file_filter_block(sorted.None,\"None\")\n_p('')\nend\n -- \n -- \n -- \n -- Create\n -- Create\n --\n --\nfunction premake.vs2010_vcxproj(prj)\nio.eol = \"\\r\\n\"\n_p('')\n_p('')\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'')\nconfig_type_block(prj)\n_p(1,'')\n_p(1,'')\n_p(1,'')\nimport_props(prj)\n_p(1,'')\nintermediate_and_out_dirs(prj)\nitem_definitions(prj)\nvcxproj_files(prj)\n_p(1,'')\n_p(1,'')\n_p(1,'')\n_p('')\nend\nfunction premake.vs2010_vcxproj_user(prj)\n_p('')\n_p('')\n_p('')\nend\nfunction premake.vs2010_vcxproj_filters(prj)\nvcxproj_filter_files(prj)\nend\nfunction premake.vs2010_cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\nend\nfunction premake.vs2010_cleanproject(prj)\nio.write('vs2010 clean action')\nlocal fname = premake.project.getfilename(prj, \"%%\")\nlocal vcxname = fname .. \".vcxproj\"\nio.write(vcxname)\nos.remove(fname .. '.vcxproj')\nos.remove(fname .. '.vcxproj.user')\nos" - ".remove(fname .. '.vcxproj.filters')\nos.remove(fname .. '.sdf')\nlocal userfiles = os.matchfiles(fname .. \".vcxproj.user\")\nfor _, fname in ipairs(userfiles) do\nos.remove(fname)\nend\nlocal filter_files = os.matchfiles(fname .. \".vcxproj.filter\")\nfor _, fname in ipairs(filter_files) do\nos.remove(fname)\nend\nlocal proj_files = os.matchfiles(fname .. \".vcxproj\")\nfor _, fname in ipairs(proj_files) do\nos.remove(fname)\nend\nlocal sdf_files = os.matchfiles(fname .. \".sdf\")\nfor _, fname in ipairs(sdf_files) do\nos.remove(fname)\nend\nend\nfunction premake.vs2010_cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nend\n", + "\npremake.vstudio.vs10_helpers = { }\nlocal vs10_helpers = premake.vstudio.vs10_helpers\nfunction vs10_helpers.remove_relative_path(file)\nfile = file:gsub(\"%.%.\\\\\",'')\nfile = file:gsub(\"%.\\\\\",'')\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={}\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_filters(t)\nlocal filters ={}\nfor key, value in pairs(t) do\nlocal result = vs10_helpers.list_of_directories_in_path(value)\nfor __,dir in ipairs(result) do\nif table.contains(filters,dir) ~= true then\nfilters[#filters +1] = dir\nend\nend\nend\nreturn filters\nend" + "\nfunction vs10_helpers.table_of_file_filters(files)\nlocal filters ={}\nfor key, valueTable in pairs(files) do\nfor _, entry in ipairs(valueTable) do\nlocal result = vs10_helpers.list_of_directories_in_path(entry)\nfor __,dir in ipairs(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\"\n}\nfor _, current_file in ipairs(files) do\nlocal translated_path = path.translate(current_file, '\\\\')\nlocal ext = vs10_helpers.get_file_extension(translated_path)\nif ext then\nlocal type = types[ext]\nif type then\ntable.insert(sorted_container[type" + "],translated_path)\nelse\ntable.insert(sorted_container.None,translated_path)\nend\nend\nend\nend\nlocal function vs2010_config(prj)\n_p(1,'')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\n_p(2,'', premake.esc(cfginfo.name))\n_p(3,'%s',cfginfo.buildcfg)\n_p(3,'%s',cfginfo.platform)\n_p(2,'')\nend\n_p(1,'')\nend\nlocal function vs2010_globals(prj)\n_p(1,'')\n_p(2,'{%s}',prj.uuid)\n_p(2,'%s',prj.name)\n_p(2,'Win32Proj')\n_p(1,'')\nend\nlocal function config_type(config)\nlocal t =\n{\nSharedLib = \"DynamicLibrary\",\nStaticLib = \"StaticLibrary\",\nConsoleApp = \"Application\",\n}\nreturn t[config.kind]\nend\nlocal function if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)'\nend\nloc" + "al function 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,''\n, premake.esc(cfginfo.name))\n_p(2,'%s',config_type(cfg))\n_p(2,'%s',iif(cfg.flags.Unicode,\"Unicode\",\"MultiByte\"))\nif cfg.flags.MFC then\n_p(2,'Dynamic')\nend\nlocal use_debug = \"false\"\nif optimisation(cfg) == \"Disabled\" then \nuse_debug = \"true\" \nelse\n_p(2,'true')\nend\n_p(2,'%s',use_debug)\n_p(1,'')\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,''\n,premake.esc(cfginfo.name))\n_p(2,'')\n_p(1,'')\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,'%s'\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,'%s'\n,premake.esc(cfginfo.name),shouldIgnore)\nend\nend\nlocal function intermediate_and_out_dirs(prj)\n_p(1,'')\n_p(2,'<_ProjectFileVersion>10.0.30319.1')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(2,'%s\\\\'\n, premake.esc(cfginfo.name),premake.esc(cfg.buildtarget.directory) )\n_p(2,'%s\\\\'\n, premake.esc(cfginfo.name), premake.esc(cfg.objectsdir))\n_p(2,'%s'\n,premake.esc(cfginfo.name),path.getbasename(cfg.buildtarget.name))\nignore_import_lib(cfg,cfginfo)\nincremental_l" + "ink(cfg,cfginfo)\nif cfg.flags.NoManifest then\n_p(2,'false'\n,premake.esc(cfginfo.name))\nend\nend\n_p(1,'')\nend\nlocal function runtime(cfg)\nlocal runtime\nif cfg.flags.StaticRuntime then\nruntime = iif(cfg.flags.Symbols,\"MultiThreadedDebug\",\"MultiThreaded\")\nelse\nruntime = iif(cfg.flags.Symbols, \"MultiThreadedDebugDLL\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nlocal function precompiled_header(cfg)\n if not cfg.flags.NoPCH and cfg.pchheader then\n_p(3,'Use')\n_p(3,'%s', path.getname(cfg.pchheader))\nelse\n_p(3,'')\nend\nend\nlocal function preprocessor(indent,cfg)\nif #cfg.defines > 0 then\n_p(indent,'%s;%%(PreprocessorDefinitions)'\n,premake.esc(table.concat(cfg.defines, \";\")))\nelse\n_p(indent,'')\nend\nend\nlocal function include_dirs(indent,cfg)\nif #cfg.includedirs > 0 then\n_p(indent,'%s;%%(AdditionalIncludeDirectories)'\n,premake.esc(path.translate(table.concat(cfg.includedirs, \";\"), '\\\\')))\nend\nend\nlocal function resource_compile(cfg)\n_p(2,'')\npreprocessor(3,cfg)\ninclude_dirs(3,cfg)\n_p(2,'')\nend\nlocal function exceptions(cfg)\nif cfg.flags.NoExceptions then\n_p(2,'false')\nelseif cfg.flags.SEH then\n_p(2,'Async')\nend\nend\nlocal function rtti(cfg)\nif cfg.flags.NoRTTI then\n_p(3,'false')\nend\nend\nlocal function wchar_t_buildin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'true')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'false')\nend" + "\nend\nlocal function sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3,'StreamingSIMDExtensions')\nelseif cfg.flags.EnableSSE2 then\n_p(3,'StreamingSIMDExtensions2')\nend\nend\nlocal function floating_point(cfg)\n if cfg.flags.FloatFast then\n_p(3,'Fast')\nelseif cfg.flags.FloatStrict then\n_p(3,'Strict')\nend\nend\nlocal function debug_info(cfg)\nif cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then\n_p(3,'EditAndContinue')\nelse\n_p(3,'')\nend\nend\nlocal function minimal_build(cfg)\nif cfg.flags.Symbols and not cfg.flags.NoMinimalRebuild then\n_p(3,'true')\nelseif cfg.flags.Symbols then\n_p(3,'false')\nend\nend\nlocal function compile_lang" + "uage(cfg)\nif cfg.language == \"C\" then\n_p(3,'CompileAsC')\nend\nend\nlocal function vs10_clcompile(cfg)\n_p(2,'')\nif #cfg.buildoptions > 0 then\n_p(3,'%s %%(AdditionalOptions)',\ntable.concat(premake.esc(cfg.buildoptions), \" \"))\nend\n_p(3,'%s',optimisation(cfg))\ninclude_dirs(3,cfg)\npreprocessor(3,cfg)\nminimal_build(cfg)\nif optimisation(cfg) == \"Disabled\" then\n_p(3,'EnableFastChecks')\nif cfg.flags.ExtraWarnings then\n_p(3,'true')\nend\nelse\n_p(3,'true')\nend\n_p(3,'%s', runtime(cfg))\n_p(3,'true')\nprecompiled_header(cfg)\nif cfg.flags.ExtraWarnings then\n_p(3,'Level4')\nelse\n_p(3,'Level3')\nend\nif cfg.flags.FatalWarnings then\n_p(3,'true')\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,'true')\nend\ncompile_language(cfg)\n_p(2,'')\nend\nlocal function event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nend\nlocal function item_def_lib(cfg)\nif cfg.kind == 'StaticLib' then\n_p(1,'')\n_p(2,'$(OutDir)%s',cfg.buildtarget.name)\n_p(1,'')\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,'%s', target)\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'%s',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nlocal function common_link_section(cfg)\n_p(3,'%s',iif(cfg.kind == \"ConsoleApp\",\"Console\", \"Windows\"))\nif cfg.flags.Symbols then \n_p(3,'true')\nelse\n_p(3,'false')\nend\nif optimisation(cfg) ~= \"Disabled\" then\n_p(3,'true')\n_p(3,'true')\nend\n_p(3,'$(OutDir)%s.pdb'\n, path.getbasename(cfg.buildtarget.name))\nend\nlocal function item_link(cfg)\n_p(2,'')\nif cfg.kind ~= 'StaticLib' then\nif #cfg.links > 0 then\n_p(3,'%s;%%(AdditionalDependencies)',\ntable.concat(premake.getlinks(cfg, \"all\", \"fullpath\"), \";\"))\nend\n_p(3,'$(OutDir)%s', cfg.buildtarget.name)\n_p(3,'%s%s%%(AdditionalLibraryDirectories)',\ntable.concat(premake.esc(path.translate(cfg.libdirs, '\\\\')) , \";\"),\niif(cfg.libdirs and #cfg.libdirs >0,';',''))\ncommon_link_section(cfg)\nif (cfg.kind == \"ConsoleApp\" or cfg.kind == \"WindowedApp\") and not cfg.flags.WinMain then\n_p(3,'mainCRTStartup')\nend\nimport_lib(cfg)\n_p(3,'%s', iif(cfg.platform == \"x64\", \"MachineX64\", \"MachineX86\"))\nelse\ncommon_link_s" + "ection(cfg)\nend\n_p(2,'')\nend\n \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,''\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nitem_link(cfg)\nevent_hooks(cfg)\n_p(1,'')\nend\nend\n -- \n -- {8fd826f8-3739-44e6-8cc8-997122e53b8d}\n -- \n -- \nlocal function write_file_type_block(files,group_type)\nif #files > 0 then\n_p(1,'')\nfor _, current_file in ipairs(files) do\n_p(2,'<%s Include=\\\"%s\\\" />', group_type,current_file)\nend\n_p(1,'')\nend\nend\nlocal function vcxproj_files(prj)\nlocal sorted =\n{\nClCompile={},\nClInclude={},\nNone={}\n}\ncfg = premake.getconfig(prj)\nvs10_h" + "elpers.sort_input_files(cfg.files,sorted)\nwrite_file_type_block(sorted.ClInclude,\"ClInclude\")\nwrite_file_type_block(sorted.ClCompile,'ClCompile')\nwrite_file_type_block(sorted.None,'None')\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,'')\nfor _, dir in pairs(directories) do\n_p(2,'',dir)\n_p(3,'{%s}',os.uuid())\n_p(2,'')\nend\n_p(1,'')\nend\nend\nlocal function write_file_filter_block(files,group_type)\nif #files > 0 then\n_p(1,'')\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,'%s',path_to_file)\n_p(2,'',group_type)\nelse\n_p(2,'<%s Include=\\\"%s\\\" />', group_type,path.translate(current_file, \"\\\\\"))\ne" + "nd\nend\n_p(1,'')\nend\nend\nlocal function vcxproj_filter_files(prj)\nlocal sorted =\n{\nClCompile={},\nClInclude={},\nNone={}\n}\ncfg = premake.getconfig(prj)\nvs10_helpers.sort_input_files(cfg.files,sorted)\nio.eol = \"\\r\\n\"\n_p('')\n_p('')\nwrite_filter_includes(sorted)\nwrite_file_filter_block(sorted.ClInclude,\"ClInclude\")\nwrite_file_filter_block(sorted.ClCompile,\"ClCompile\")\nwrite_file_filter_block(sorted.None,\"None\")\n_p('')\nend\n -- \n -- \n -- \n -- Create\n -- Create\n --\n --\nfunction premake.vs2010_vcxproj(prj)" + "\nio.eol = \"\\r\\n\"\n_p('')\n_p('')\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'')\nconfig_type_block(prj)\n_p(1,'')\n_p(1,'')\n_p(1,'')\nimport_props(prj)\n_p(1,'')\nintermediate_and_out_dirs(prj)\nitem_definitions(prj)\nvcxproj_files(prj)\n_p(1,'')\n_p(1,'')\n_p(1,'')\n_p('')\nend\nfunction premake.vs2010_vcxproj_user(prj)\n_p('')\n_p('')\n_p('')\nend\nfuncti" + "on premake.vs2010_vcxproj_filters(prj)\nvcxproj_filter_files(prj)\nend\n", /* actions/xcode/_xcode.lua */ "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 '" @@ -280,9 +280,8 @@ const char* builtin_scripts[] = { "BXProject(tr)\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr)\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\n", /* actions/clean/_clean.lua */ - "premake.clean = { }\nfunction premake.clean.directory(obj, pattern)\nlocal fname = premake.project.getfilename(obj, pattern)\nos.rmdir(fname)\nend\nfunction premake.clean.file(obj, pattern)\nlocal fname = premake.project.getfilename(obj, pattern)\nos.remove(fname)\nend\nnewaction {\ntrigger = \"clean\",\ndescription = \"Remove all binaries and generated files\",\nonsolution = function(sln)\nfor action in premake.action.each() do\nif action.oncleansolution then\naction.oncleansolution(sln)\nend\nend\nend,\nonproject = function(prj)\nfor action in premake.action.each() do\nif action.trigger ==\"vs2010\" then\nif action.oncleanproject then\nio.write('vs2010 has an on clean and we are going to call it\\n')\nelse\nio.write('vs2010 does not have an on clean\\n')\nend\nif action.oncleansolution then\nio.write('vs2010 has an oncleansolution and we are going to call it\\n')\nelse\nio.write('vs2010 does not have an oncleansolution\\n')\nend\nif action.oncleantarget then\nio.write('vs2010 has an oncleantarget and we " - "are going to call it\\n')\nelse\nio.write('vs2010 does not have an oncleantarget\\n')\nend\nend\nif action.oncleanproject then\naction.oncleanproject(prj)\nend\nend\nif (prj.objectsdir) then\npremake.clean.directory(prj, prj.objectsdir)\nend\nlocal platforms = prj.solution.platforms or { }\nif not table.contains(platforms, \"Native\") then\nplatforms = table.join(platforms, { \"Native\" })\nend\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.clean.directory(prj, cfg.objectsdir)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"windows\", \"windows\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"posix\", \"linux\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"posix\", \"macosx\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"PS3\", \"windows\").fullpath)\nif cfg.kind == \"WindowedApp\" then\npremake.clean.directory(prj, premake.get" - "target(cfg, \"build\", \"posix\", \"posix\", \"linux\").fullpath .. \".app\")\nend\npremake.clean.file(prj, premake.gettarget(cfg, \"link\", \"windows\", \"windows\", \"windows\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"link\", \"posix\", \"posix\", \"linux\").fullpath)\nlocal target = path.join(premake.project.getfilename(prj, cfg.buildtarget.directory), cfg.buildtarget.basename)\nfor action in premake.action.each() do\nif action.oncleantarget then\naction.oncleantarget(target)\nend\nend\nend\nend\nend\n}\n", + "premake.clean = { }\nfunction premake.clean.directory(obj, pattern)\nlocal fname = premake.project.getfilename(obj, pattern)\nos.rmdir(fname)\nend\nfunction premake.clean.file(obj, pattern)\nlocal fname = premake.project.getfilename(obj, pattern)\nos.remove(fname)\nend\nnewaction {\ntrigger = \"clean\",\ndescription = \"Remove all binaries and generated files\",\nonsolution = function(sln)\nfor action in premake.action.each() do\nif action.oncleansolution then\naction.oncleansolution(sln)\nend\nend\nend,\nonproject = function(prj)\nfor action in premake.action.each() do\nif action.oncleanproject then\naction.oncleanproject(prj)\nend\nend\nif (prj.objectsdir) then\npremake.clean.directory(prj, prj.objectsdir)\nend\nlocal platforms = prj.solution.platforms or { }\nif not table.contains(platforms, \"Native\") then\nplatforms = table.join(platforms, { \"Native\" })\nend\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.clean.directory(prj, cfg.objectsdir)\nprema" + "ke.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"windows\", \"windows\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"posix\", \"linux\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"posix\", \"macosx\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"PS3\", \"windows\").fullpath)\nif cfg.kind == \"WindowedApp\" then\npremake.clean.directory(prj, premake.gettarget(cfg, \"build\", \"posix\", \"posix\", \"linux\").fullpath .. \".app\")\nend\npremake.clean.file(prj, premake.gettarget(cfg, \"link\", \"windows\", \"windows\", \"windows\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"link\", \"posix\", \"posix\", \"linux\").fullpath)\nlocal target = path.join(premake.project.getfilename(prj, cfg.buildtarget.directory), cfg.buildtarget.basename)\nfor action in premake.action.each() do\nif action.oncleantarget then\naction.oncleantarget(target)\nend\nend\nend\nend\nend\n}\n", /* _premake_main.lua */ "local scriptfile = \"premake4.lua\"\nlocal shorthelp = \"Type 'premake4 --help' for help\"\nlocal versionhelp = \"premake4 (Premake Build Script Generator) %s\"\nlocal function injectplatform(platform)\nif not platform then return true end\nplatform = premake.checkvalue(platform, premake.fields.platforms.allowed)\nfor sln in premake.solution.each() do\nlocal platforms = sln.platforms or { }\nif #platforms == 0 then\ntable.insert(platforms, \"Native\")\nend\nif not table.contains(platforms, \"Native\") then\nreturn false, sln.name .. \" does not target native platform\\nNative platform settings are required for the --platform feature.\"\nend\nif not table.contains(platforms, platform) then\ntable.insert(platforms, platform)\nend\nsln.platforms = platforms\nend\nreturn true\nend\nfunction _premake_main(scriptpath)\nif (scriptpath) then\nlocal scripts = dofile(scriptpath .. \"/_manifest.lua\")\nfor _,v in ipairs(scripts) do\ndofile(scriptpath .. \"/\" .. v)\nend\nend\npremake.action.set(_ACTION)\nmath.r"