@ -1,4 +1,4 @@
/* Premake's Lua scripts, as static data buffers for release mode builds */
/* Premake's Lua scripts, as static data buffers for release mode builds */
/* DO NOT EDIT - this file is autogenerated - see BUILD.txt */
/* To regenerate this file, run: premake4 embed */
@ -259,58 +259,59 @@ const char* builtin_scripts[] = {
" GS = %s \" , make.list(tool.getswiftlinkflags(cfg))) \n _p(1, \" AR_FLAGS = %s \" , make.list(tool.getarchiveflags(cfg, cfg, false))) \n _p(1, \" LD_FLAGS = %s \" , make.list(tool.getldflags(cfg))) \n _p(1, \" LDDEPS = %s \" , make.list(premake.getlinks(cfg, \" siblings \" , \" fullpath \" ))) \n if cfg.flags.Symbols then \n _p(1, \" SYMBOLS = $(TARGET).dSYM \" ) \n end \n local sdk = tool.get_sdk_path(cfg) \n if sdk then \n _p(1, \" TOOLCHAIN_PATH = %s \" , tool.get_toolchain_path(cfg)) \n _p(1, \" SDK_PATH = %s \" , sdk) \n _p(1, \" PLATFORM_PATH = %s \" , tool.get_sdk_platform_path(cfg)) \n _p(1, \" SDK = -sdk $(SDK_PATH) \" ) \n else \n _p(1, \" SDK_PATH = \" ) \n _p(1, \" SDK = \" ) \n end \n _p(1,'WORK_DIRS = $(OUT_DIR) $(OBJDIR)') \n _p('endif') \n _p('') \n end " ,
/* actions/vstudio/_vstudio.lua */
" premake.vstudio = { } \n local toolsets = { \n vs2010 = \" v100 \" , \n vs2012 = \" v110 \" , \n vs2013 = \" v120 \" , \n vs2015 = \" v140 \" , \n vs2017 = \" v141 \" , \n }\n premake.vstudio.toolset = toolsets[_ACTION] or \" unknown? \" \n premake.vstudio.splashpath = '' \n local vstudio = premake.vstudio \n vstudio.platforms = { \n any = \" Any CPU \" , \n mixed = \" Mixed Platforms \" , \n Native = \" Win32 \" , \n x86 = \" x86 \" , \n x32 = \" Win32 \" , \n x64 = \" x64 \" , \n PS3 = \" PS3 \" , \n Xbox360 = \" Xbox 360 \" , \n ARM = \" ARM \" , \n Orbis = \" ORBIS \" , \n Durango = \" Durango \" , \n } \n function vstudio.arch(prj) \n if (prj.language == \" C# \" ) then \n return \" Any CPU \" \n else \n return \" Win32 \" \n end \n end \n function vstudio.iswinrt() \n return vstudio.storeapp ~= nil and vstudio.storeapp ~= '' \n end \n function vstudio.buildconfigs(sln) \n local cfgs = { } \n local platforms = premake.filterplatforms(sln, vstudio.platforms, \" Native \" ) \n local hascpp = premake.hascppproject(sln) \n local hasdotnet = premake.hasdotnetproject(sln) \n if hasdotnet and (_ ACTION > \" vs2008 \" "
" or hascpp) then\n table.insert(platforms, 1, \" mixed \" ) \n end \n if hasdotnet and (_ACTION < \" vs2010 \" or not hascpp) then \n table.insert(platforms, 1, \" any \" ) \n end \n if _ACTION > \" vs2008 \" then \n local platforms2010 = { } \n for _, platform in ipairs(platforms) do \n if vstudio.platforms[platform] == \" Win32 \" then \n if hascpp then \n table.insert(platforms2010, platform) \n end \n if hasdotnet then \n table.insert(platforms2010, \" x86 \" ) \n end \n else \n table.insert(platforms2010, platform) \n end \n end \n platforms = platforms2010 \n end \n for _, buildcfg in ipairs(sln.configurations) do \n for _, platform in ipairs(platforms) do \n local entry = { } \n entry.src_buildcfg = buildcfg \n entry.src_platform = platform \n if platform ~= \" PS3 \" or _ACTION > \" vs2008 \" then \n entry.buildcfg = buildcfg \n entry.platform = vstudio.platforms[platform] \n else \n entry.buildcfg = platform .. \" \" .. buildcfg \n entry.platform = \" Win32 \" \n end \n entry.name = entry.buildcfg .. \" | \" .. entry.platform \n entry.isreal = (platform ~= \" any \" and plat form ~= \" mixed \" ) \n "
" table.insert(cfgs, entry)\n end \n end \n return cfgs \n end \n function premake.vstudio.bakeimports(sln) \n for _,iprj in ipairs(sln.importedprojects) do \n if string.find(iprj.location, \" .csproj \" ) ~= nil then \n iprj.language = \" C# \" \n else \n iprj.language = \" C++ \" \n end \n local f, err = io.open(iprj.location, \" r \" ) \n if (not f) then \n error(err, 1) \n end \n local projcontents = f:read( \" *all \" ) \n f:close() \n local found, _, uuid = string.find(projcontents, \" <ProjectGuid>{([%w%-]+)}</ProjectGuid> \" ) \n if not found then \n error( \" Could not find ProjectGuid element in project \" .. iprj.location, 1) \n end \n iprj.uuid = uuid \n if iprj.language == \" C++ \" and string.find(projcontents, \" <CLRSupport>true</CLRSupport> \" ) then \n iprj.flags.Managed = true \n end \n iprj.relpath = path.getrelative(sln.location, iprj.location) \n end \n end \n function premake.vstudio.getimportprj(prjpath, sln) \n for _,iprj in ipairs(sln.importedprojects) do \n if prjpath == iprj.relpath then \n return iprj \n end \n end \n error( \" Could not find reference impo rt project \" .. prj "
" path, 1)\n end \n function vstudio.cleansolution(sln) \n premake.clean.file(sln, \" %%.sln \" ) \n premake.clean.file(sln, \" %%.suo \" ) \n premake.clean.file(sln, \" %%.ncb \" ) \n premake.clean.file(sln, \" %%.userprefs \" ) \n premake.clean.file(sln, \" %%.usertasks \" ) \n end \n function vstudio.cleanproject(prj) \n local fname = premake.project.getfilename(prj, \" %% \" ) \n os.remove(fname .. \" .vcproj \" ) \n os.remove(fname .. \" .vcproj.user \" ) \n os.remove(fname .. \" .vcxproj \" ) \n os.remove(fname .. \" .vcxproj.user \" ) \n os.remove(fname .. \" .vcxproj.filters \" ) \n os.remove(fname .. \" .csproj \" ) \n os.remove(fname .. \" .csproj.user \" ) \n os.remove(fname .. \" .pidb \" ) \n os.remove(fname .. \" .sdf \" ) \n end \n function vstudio.cleantarget(name) \n os.remove(name .. \" .pdb \" ) \n os.remove(name .. \" .idb \" ) \n os.remove(name .. \" .ilk \" ) \n os.remove(name .. \" .vshost.exe \" ) \n os.remove(name .. \" .exe.manifest \" ) \n end \n function vstudio.projectfile(prj) \n local pattern \n if prj.language == \" C# \" then \n pattern = \" %%.csproj \" \n else \n pattern = iif(_ACTION > \" vs2008 \" , \" %%. "
" vcxproj\" , \" %%.vcproj \" ) \n end \n local fname = premake.project.getbasename(prj.name, pattern) \n fname = path.join(prj.location, fname) \n return fname \n end \n function vstudio.tool(prj) \n if (prj.language == \" C# \" ) then \n return \" FAE04EC0-301F-11D3-BF4B-00C04F79EFBC \" \n else \n return \" 8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942 \" \n end \n end \n " ,
" premake.vstudio = { } \n local toolsets = { \n vs2010 = \" v100 \" , \n vs2012 = \" v110 \" , \n vs2013 = \" v120 \" , \n vs2015 = \" v140 \" , \n vs2017 = \" v141 \" , \n vsllvm = \" llvm \" , \n }\n premake.vstudio.toolset = toolsets[_ACTION] or \" unknown? \" \n premake.vstudio.splashpath = '' \n local vstudio = premake.vstudio \n vstudio.platforms = { \n any = \" Any CPU \" , \n mixed = \" Mixed Platforms \" , \n Native = \" Win32 \" , \n x86 = \" x86 \" , \n x32 = \" Win32 \" , \n x64 = \" x64 \" , \n PS3 = \" PS3 \" , \n Xbox360 = \" Xbox 360 \" , \n ARM = \" ARM \" , \n Orbis = \" ORBIS \" , \n Durango = \" Durango \" , \n } \n function vstudio.arch(prj) \n if (prj.language == \" C# \" ) then \n return \" Any CPU \" \n else \n return \" Win32 \" \n end \n end \n function vstudio.iswinrt() \n return vstudio.storeapp ~= nil and vstudio.storeapp ~= '' \n end \n function vstudio.buildconfigs(sln) \n local cfgs = { } \n local platforms = premake.filterplatforms(sln, vstudio.platforms, \" Native \" ) \n local hascpp = premake.hascppproject(sln) \n local hasdotnet = premake.hasdotnetproject(sln) \n if hasdotnet and (_ "
" ACTION > \" vs2008 \" or hascpp) then\n table.insert(platforms, 1, \" mixed \" ) \n end \n if hasdotnet and (_ACTION < \" vs2010 \" or not hascpp) then \n table.insert(platforms, 1, \" any \" ) \n end \n if _ACTION > \" vs2008 \" then \n local platforms2010 = { } \n for _, platform in ipairs(platforms) do \n if vstudio.platforms[platform] == \" Win32 \" then \n if hascpp then \n table.insert(platforms2010, platform) \n end \n if hasdotnet then \n table.insert(platforms2010, \" x86 \" ) \n end \n else \n table.insert(platforms2010, platform) \n end \n end \n platforms = platforms2010 \n end \n for _, buildcfg in ipairs(sln.configurations) do \n for _, platform in ipairs(platforms) do \n local entry = { } \n entry.src_buildcfg = buildcfg \n entry.src_platform = platform \n if platform ~= \" PS3 \" or _ACTION > \" vs2008 \" then \n entry.buildcfg = buildcfg \n entry.platform = vstudio.platforms[platform] \n else \n entry.buildcfg = platform .. \" \" .. buildcfg \n entry.platform = \" Win32 \" \n end \n entry.name = entry.buildcfg .. \" | \" .. entry.platform \n entry.isreal = (platform ~= \" any \" and plat "
" form ~= \" mixed \" ) \n table.insert(cfgs, entry)\n end \n end \n return cfgs \n end \n function premake.vstudio.bakeimports(sln) \n for _,iprj in ipairs(sln.importedprojects) do \n if string.find(iprj.location, \" .csproj \" ) ~= nil then \n iprj.language = \" C# \" \n else \n iprj.language = \" C++ \" \n end \n local f, err = io.open(iprj.location, \" r \" ) \n if (not f) then \n error(err, 1) \n end \n local projcontents = f:read( \" *all \" ) \n f:close() \n local found, _, uuid = string.find(projcontents, \" <ProjectGuid>{([%w%-]+)}</ProjectGuid> \" ) \n if not found then \n error( \" Could not find ProjectGuid element in project \" .. iprj.location, 1) \n end \n iprj.uuid = uuid \n if iprj.language == \" C++ \" and string.find(projcontents, \" <CLRSupport>true</CLRSupport> \" ) then \n iprj.flags.Managed = true \n end \n iprj.relpath = path.getrelative(sln.location, iprj.location) \n end \n end \n function premake.vstudio.getimportprj(prjpath, sln) \n for _,iprj in ipairs(sln.importedprojects) do \n if prjpath == iprj.relpath then \n return iprj \n end \n end \n error( \" Could not find reference impo "
" rt project \" .. prj path, 1)\n end \n function vstudio.cleansolution(sln) \n premake.clean.file(sln, \" %%.sln \" ) \n premake.clean.file(sln, \" %%.suo \" ) \n premake.clean.file(sln, \" %%.ncb \" ) \n premake.clean.file(sln, \" %%.userprefs \" ) \n premake.clean.file(sln, \" %%.usertasks \" ) \n end \n function vstudio.cleanproject(prj) \n local fname = premake.project.getfilename(prj, \" %% \" ) \n os.remove(fname .. \" .vcproj \" ) \n os.remove(fname .. \" .vcproj.user \" ) \n os.remove(fname .. \" .vcxproj \" ) \n os.remove(fname .. \" .vcxproj.user \" ) \n os.remove(fname .. \" .vcxproj.filters \" ) \n os.remove(fname .. \" .csproj \" ) \n os.remove(fname .. \" .csproj.user \" ) \n os.remove(fname .. \" .pidb \" ) \n os.remove(fname .. \" .sdf \" ) \n end \n function vstudio.cleantarget(name) \n os.remove(name .. \" .pdb \" ) \n os.remove(name .. \" .idb \" ) \n os.remove(name .. \" .ilk \" ) \n os.remove(name .. \" .vshost.exe \" ) \n os.remove(name .. \" .exe.manifest \" ) \n end \n function vstudio.projectfile(prj) \n local pattern \n if prj.language == \" C# \" then \n pattern = \" %%.csproj \" \n else \n pattern = iif(_ACTION "
" > \" vs2008 \" , \" %%. vcxproj\" , \" %%.vcproj \" ) \n end \n local fname = premake.project.getbasename(prj.name, pattern) \n fname = path.join(prj.location, fname) \n return fname \n end \n function vstudio.tool(prj) \n if (prj.language == \" C# \" ) then \n return \" FAE04EC0-301F-11D3-BF4B-00C04F79EFBC \" \n else \n return \" 8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942 \" \n end \n end \n " ,
/* actions/vstudio/vstudio_solution.lua */
" premake.vstudio.sln2005 = { } \n local vstudio = premake.vstudio \n local sln2005 = premake.vstudio.sln2005 \n function sln2005.generate(sln) \n io.eol = ' \\ r \\ n' \n sln.vstudio_configs = premake.vstudio.buildconfigs(sln) \n premake.vstudio.bakeimports(sln) \n _p(' \\ 239 \\ 187 \\ 191') \n sln2005.reorderProjects(sln) \n sln2005.header(sln) \n for grp in premake.solution.eachgroup(sln) do \n sln2005.group(grp) \n end \n for prj in premake.solution.eachproject(sln) do \n sln2005.project(prj) \n end \n \n for _,iprj in ipairs(sln.importedprojects) do \n sln2005.importproject(iprj) \n end \n _p('Global') \n sln2005.platforms(sln) \n sln2005.project_platforms(sln) \n sln2005.properties(sln) \n sln2005.project_groups(sln) \n _p('EndGlobal') \n end \n function sln2005.reorderProjects(sln) \n if sln.startproject then \n for i, prj in ipairs(sln.projects) do \n if sln.startproject == prj.name then \n local cur = prj.group \n while cur ~= nil do \n for j, group in ipairs(sln.groups) do \n if group == cur then \n table.remove(sln.groups, j) \n break \n end \n end \n table.insert(sln.groups, 1 "
" , cur) \n cur = cur.parent \n end \n table.remove(sln.projects, i) \n table.insert(sln.projects, 1, prj) \n break \n end \n end \n end \n end \n function sln2005.header(sln) \n local action = premake.action.current() \n _p('Microsoft Visual Studio Solution File, Format Version %d.00', action.vstudio.solutionVersion) \n if(_ACTION:sub(3) == \" 2015 \" or _ACTION:sub(3) == \" 2017 \" ) then\n _p('# Visual Studio %s', action.vstudio.toolsVersion:sub(1,2)) \n else \n _p('# Visual Studio %s', _ACTION:sub(3)) \n end \n end \n function sln2005.project(prj) \n local projpath = path.translate(path.getrelative(prj.solution.location, vstudio.projectfile(prj)), \" \\ \\ \" ) \n _p('Project( \" {%s} \" ) = \" %s \" , \" %s \" , \" {%s} \" ', vstudio.tool(prj), prj.name, projpath, prj.uuid) \n sln2005.projectdependencies(prj) \n _p('EndProject') \n end \n function sln2005.group(grp) \n _p('Project( \" {2150E333-8FDC-42A3-9474-1A3956D46DE8} \" ) = \" %s \" , \" %s \" , \" {%s} \" ', grp.name, grp.name, grp.uuid) \n _p('EndProject') \n end \n \n function sln2005.importproject(iprj) \n _p('Project( \" {%s} \" ) = \" %s "
" \ ", \" %s \" , \" {%s} \" ', vstudio.tool(iprj), path.getbasename(iprj.location), iprj.relpath, iprj.uuid) \n _p('EndProject') \n end \n function sln2005.projectdependencies(prj) \n local deps = premake.getdependencies(prj) \n if #deps > 0 then \n _p(' \\ tProjectSection(ProjectDependencies) = postProject') \n for _, dep in ipairs(deps) do \n _p(' \\ t \\ t{%s} = {%s}', dep.uuid, dep.uuid) \n end \n _p(' \\ tEndProjectSection') \n end \n end \n function sln2005.platforms(sln) \n _p(' \\ tGlobalSection(SolutionConfigurationPlatforms) = preSolution') \n for _, cfg in ipairs(sln.vstudio_configs) do \n _p(' \\ t \\ t%s = %s', cfg.name, cfg.name) \n end \n _p(' \\ tEndGlobalSection') \n end \n function sln2005.project_platform(prj, sln) \n for _, cfg in ipairs(sln.vstudio_configs) do \n local mapped \n local buildfor \n if premake.isdotnetproject(prj) then \n buildfor = \" x64 \" \n mapped = \" Any CPU \" \n elseif prj.flags and prj.flags.Managed then \n mapped = \" x64 \" \n else \n if cfg.platform == \" Any CPU \" or cfg.platform == \" Mixed Platforms \" then \n mapped = sln. vstudio_configs[3].platform\n e "
" lse\n mapped = cfg.platform \n end \n end \n local build_project = true \n if prj.solution ~= nil then \n build_project = premake.getconfig(prj, cfg.src_buildcfg, cfg.src_platform).build \n end \n _p(' \\ t \\ t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped) \n if build_project then \n if mapped == cfg.platform or cfg.platform == \" Mixed Platforms \" or buildfor == cfg.platform then \n _p(' \\ t \\ t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped) \n end \n if premake.vstudio.iswinrt() and prj.kind == \" WindowedApp \" then \n _p(' \\ t \\ t{%s}.%s.Deploy.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped) \n end \n end \n end \n end \n function sln2005.project_platforms(sln) \n _p(' \\ tGlobalSection(ProjectConfigurationPlatforms) = postSolution') \n for prj in premake.solution.eachproject(sln) do \n sln2005.project_platform(prj, sln) \n end \n for _,iprj in ipairs(sln.importedprojects) do \n sln2005.project_platform(iprj, sln) \n end \n _p(' \\ tEndGlobalSection') \n end \n func tion sln2005.properties(sln)\n "
" _p('\\ tGlobalSection(SolutionProperties) = preSolution') \n _p(' \\ t \\ tHideSolutionNode = FALSE') \n _p(' \\ tEndGlobalSection') \n end \n function sln2005.project_groups(sln) \n _p(' \\ tGlobalSection(NestedProjects) = preSolution') \n for grp in premake.solution.eachgroup(sln) do \n if grp.parent ~= nil then \n _p(' \\ t \\ t{%s} = {%s}', grp.uuid, grp.parent.uuid) \n end \n end \n for prj in premake.solution.eachproject(sln) do \n if prj.group ~= nil then \n _p(' \\ t \\ t{%s} = {%s}', prj.uuid, prj.group.uuid) \n end \n end \n for _,iprj in ipairs(sln.importedprojects) do \n if iprj.group ~= nil then \n _p(' \\ t \\ t{%s} = {%s}', iprj.uuid, iprj.group.uuid) \n end \n end \n \n _p(' \\ tEndGlobalSection') \n end " ,
" , cur) \n cur = cur.parent \n end \n table.remove(sln.projects, i) \n table.insert(sln.projects, 1, prj) \n break \n end \n end \n end \n end \n function sln2005.header(sln) \n local action = premake.action.current() \n _p('Microsoft Visual Studio Solution File, Format Version %d.00', action.vstudio.solutionVersion) \n if(_ACTION:sub(3) == \" 2015 \" or _ACTION:sub(3) == \" 2017 \" or _ACTION:sub(3) == \" llvm \" ) then\n _p('# Visual Studio %s', action.vstudio.toolsVersion:sub(1,2)) \n else \n _p('# Visual Studio %s', _ACTION:sub(3)) \n end \n end \n function sln2005.project(prj) \n local projpath = path.translate(path.getrelative(prj.solution.location, vstudio.projectfile(prj)), \" \\ \\ \" ) \n _p('Project( \" {%s} \" ) = \" %s \" , \" %s \" , \" {%s} \" ', vstudio.tool(prj), prj.name, projpath, prj.uuid) \n sln2005.projectdependencies(prj) \n _p('EndProject') \n end \n function sln2005.group(grp) \n _p('Project( \" {2150E333-8FDC-42A3-9474-1A3956D46DE8} \" ) = \" %s \" , \" %s \" , \" {%s} \" ', grp.name, grp.name, grp.uuid) \n _p('EndProject') \n end \n \n function sln2005.importproject(iprj) "
" \ n_p('Project( \" {%s} \" ) = \" %s \ ", \" %s \" , \" {%s} \" ', vstudio.tool(iprj), path.getbasename(iprj.location), iprj.relpath, iprj.uuid) \n _p('EndProject') \n end \n function sln2005.projectdependencies(prj) \n local deps = premake.getdependencies(prj) \n if #deps > 0 then \n _p(' \\ tProjectSection(ProjectDependencies) = postProject') \n for _, dep in ipairs(deps) do \n _p(' \\ t \\ t{%s} = {%s}', dep.uuid, dep.uuid) \n end \n _p(' \\ tEndProjectSection') \n end \n end \n function sln2005.platforms(sln) \n _p(' \\ tGlobalSection(SolutionConfigurationPlatforms) = preSolution') \n for _, cfg in ipairs(sln.vstudio_configs) do \n _p(' \\ t \\ t%s = %s', cfg.name, cfg.name) \n end \n _p(' \\ tEndGlobalSection') \n end \n function sln2005.project_platform(prj, sln) \n for _, cfg in ipairs(sln.vstudio_configs) do \n local mapped \n local buildfor \n if premake.isdotnetproject(prj) then \n buildfor = \" x64 \" \n mapped = \" Any CPU \" \n elseif prj.flags and prj.flags.Managed then \n mapped = \" x64 \" \n else \n if cfg.platform == \" Any CPU \" or cfg.platform == \" Mixed Platforms \" then \n mapped = sln. "
" vstudio_configs[3].platform\n e lse\n mapped = cfg.platform \n end \n end \n local build_project = true \n if prj.solution ~= nil then \n build_project = premake.getconfig(prj, cfg.src_buildcfg, cfg.src_platform).build \n end \n _p(' \\ t \\ t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped) \n if build_project then \n if mapped == cfg.platform or cfg.platform == \" Mixed Platforms \" or buildfor == cfg.platform then \n _p(' \\ t \\ t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped) \n end \n if premake.vstudio.iswinrt() and prj.kind == \" WindowedApp \" then \n _p(' \\ t \\ t{%s}.%s.Deploy.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped) \n end \n end \n end \n end \n function sln2005.project_platforms(sln) \n _p(' \\ tGlobalSection(ProjectConfigurationPlatforms) = postSolution') \n for prj in premake.solution.eachproject(sln) do \n sln2005.project_platform(prj, sln) \n end \n for _,iprj in ipairs(sln.importedprojects) do \n sln2005.project_platform(iprj, sln) \n end \n _p(' \\ tEndGlobalSection') \n end \n func "
" tion sln2005.properties(sln)\n _p('\\ tGlobalSection(SolutionProperties) = preSolution') \n _p(' \\ t \\ tHideSolutionNode = FALSE') \n _p(' \\ tEndGlobalSection') \n end \n function sln2005.project_groups(sln) \n _p(' \\ tGlobalSection(NestedProjects) = preSolution') \n for grp in premake.solution.eachgroup(sln) do \n if grp.parent ~= nil then \n _p(' \\ t \\ t{%s} = {%s}', grp.uuid, grp.parent.uuid) \n end \n end \n for prj in premake.solution.eachproject(sln) do \n if prj.group ~= nil then \n _p(' \\ t \\ t{%s} = {%s}', prj.uuid, prj.group.uuid) \n end \n end \n for _,iprj in ipairs(sln.importedprojects) do \n if iprj.group ~= nil then \n _p(' \\ t \\ t{%s} = {%s}', iprj.uuid, iprj.group.uuid) \n end \n end \n \n _p(' \\ tEndGlobalSection') \n end " ,
/* actions/vstudio/vstudio_vcxproj.lua */
" premake.vstudio.vc2010 = { } \n local vc2010 = premake.vstudio.vc2010 \n local vstudio = premake.vstudio \n local function vs2010_config(prj) \n _p(1,'<ItemGroup Label= \" ProjectConfigurations \" >') \n for _, cfginfo in ipairs(prj.solution.vstudio_configs) do \n _p(2,'<ProjectConfiguration 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>') \n end \n _p(1,'</ItemGroup>') \n end \n local function vs2010_globals(prj) \n local action = premake.action.current() \n _p(1,'<PropertyGroup Label= \" Globals \" >') \n _p(2, '<ProjectGuid>{%s}</ProjectGuid>',prj.uuid) \n _p(2, '<RootNamespace>%s</RootNamespace>',prj.name) \n if vstudio.storeapp ~= \" durango \" then \n local windowsTargetPlatformVersion = prj.windowstargetplatformversion or action.vstudio.windowsTargetPlatformVersion \n if windowsTargetPlatformVersion ~= nil then \n _p(2,'<WindowsTargetPlatformVersion>%s</WindowsTargetPlatformVersion>',windowsTargetPlatformVersion "
" ) \n if windowsTargetPlatformVersion and string.startswith(windowsTargetPlatformVersion, \" 10. \" ) then \n _p(2,'<WindowsTargetPlatformMinVersion>%s</WindowsTargetPlatformMinVersion>', prj.windowstargetplatformminversion or \" 10.0.10240.0 \" ) \n end \n end \n end \n if prj.flags and prj.flags.Managed then \n local frameworkVersion = prj.framework or \" 4.0 \" \n _p(2, '<TargetFrameworkVersion>v%s</TargetFrameworkVersion>', frameworkVersion) \n _p(2, '<Keyword>ManagedCProj</Keyword>') \n elseif vstudio.iswinrt() then \n _p(2, '<DefaultLanguage>en-US</DefaultLanguage>') \n if vstudio.storeapp == \" durango \" then \n _p(2, '<Keyword>Win32Proj</Keyword>') \n _p(2, '<ApplicationEnvironment>title</ApplicationEnvironment>') \n _p(2, '<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>') \n _p(2, '<TargetRuntime>Native</TargetRuntime>') \n else \n _p(2, '<AppContainerApplication>true</AppContainerApplication>') \n _p(2, '<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>') \n if vstudio.toolset == \" v120_wp81 \" then \n _p(2, '<ApplicationType> "
" Windows Phone</ApplicationType>') \n else \n _p(2, '<ApplicationType>Windows Store</ApplicationType>') \n end \n _p(2, '<ApplicationTypeRevision>%s</ApplicationTypeRevision>', vstudio.storeapp) \n end \n else \n _p(2, '<Keyword>Win32Proj</Keyword>') \n end \n if _ACTION:sub(3) == \" 2015 \" or _ACTION:sub(3) == \" 2017 \" then \n _p(2,'<PreferredToolArchitecture>x64</PreferredToolArchitecture>') \n end \n if _ACTION:sub(3) == \" 2017 \" and os.isdir(path.join(os.getenv( \" VSINSTALLDIR \" ), \" VC/Tools/MSVC/14.14.26428 \" )) then \n _p(2,'<VCToolsVersion>14.14.26428</VCToolsVersion>') \n end \n _p(1,'</PropertyGroup>') \n end \n function vc2010.config_type(config) \n local t = \n { \n SharedLib = \" DynamicLibrary \" , \n StaticLib = \" StaticLibrary \" , \n ConsoleApp = \" Application \" , \n WindowedApp = \" Application \" \n } \n return t[config.kind] \n end \n local function if_config_and_platform() \n return 'Condition= \" \\ '$(Configuration)|$(Platform) \\ '== \\ '%s \\ ' \" ' \n end \n local function optimisation(cfg) \n local result = \" Disabled \" \n for _, value in ipairs(cfg.flags) do \n if (value "
" == \" Optimize \" ) then \n result = \" Full \" \n elseif (value == \" OptimizeSize \" ) then \n result = \" MinSpace \" \n elseif (value == \" OptimizeSpeed \" ) then \n result = \" MaxSpeed \" \n end \n end \n return result \n end \n function vc2010.configurationPropertyGroup(cfg, cfginfo) \n _p(1,'<PropertyGroup '..if_config_and_platform() ..' Label= \" Configuration \" >' \n , premake.esc(cfginfo.name)) \n _p(2,'<ConfigurationType>%s</ConfigurationType>',vc2010.config_type(cfg)) \n _p(2,'<UseDebugLibraries>%s</UseDebugLibraries>', iif(optimisation(cfg) == \" Disabled \" , \" true \" , \" false \" )) \n _p(2,'<PlatformToolset>%s</PlatformToolset>', premake.vstudio.toolset) \n if cfg.flags.MFC then \n _p(2,'<UseOfMfc>%s</UseOfMfc>', iif(cfg.flags.StaticRuntime, \" Static \" , \" Dynamic \" )) \n end \n if cfg.flags.ATL or cfg.flags.StaticATL then \n _p(2,'<UseOfAtl>%s</UseOfAtl>', iif(cfg.flags.StaticATL, \" Static \" , \" Dynamic \" )) \n end \n if cfg.flags.Unicode then \n _p(2,'<CharacterSet>Unicode</CharacterSet>') \n end \n if cfg.flags.Managed then \n _p(2,'<CLRSupport>true</CLRSupport>') \n end "
" \n _p(1,'</PropertyGroup>') \n end \n local function import_props(prj) \n for _, cfginfo in ipairs(prj.solution.vstudio_configs) do \n local 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 if #cfg.propertysheets > 0 then \n local dirs = cfg.propertysheets \n for _, dir in ipairs(dirs) do \n _p(2,'<Import Project= \" %s \" />', path.translate(dir)) \n end \n end \n _p(1,'</ImportGroup>') \n end \n end \n local function add_trailing_backslash(dir) \n if dir:len() > 0 and dir:sub(-1) ~= \" \\ \\ \" then \n return dir.. \" \\ \\ \" \n end \n return dir \n end \n function vc2010.outputProperties(prj) \n for _, cfginfo in ipairs(prj.solution.vstudio_configs) do \n local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platfor "
" m) \n local target = cfg.buildtarget \n local outdir = add_trailing_backslash(target.directory) \n local intdir = add_trailing_backslash(iif(action.vstudio.intDirAbsolute \n , path.translate( \n path.join(prj.solution.location, cfg.objectsdir) \n , ' \\ \\ ') \n , cfg.objectsdir \n )) \n _p(1,'<PropertyGroup '..if_config_and_platform() ..'>', premake.esc(cfginfo.name)) \n _p(2,'<OutDir>%s</OutDir>', iif(outdir:len() > 0, premake.esc(outdir), \" . \\ \\ \" )) \n if cfg.platform == \" Xbox360 \" then \n _p(2,'<OutputFile>$(OutDir)%s</OutputFile>', premake.esc(target.name)) \n end \n _p(2,'<IntDir>%s</IntDir>', premake.esc(intdir)) \n _p(2,'<TargetName>%s</TargetName>', premake.esc(path.getbasename(target.name))) \n _p(2,'<TargetExt>%s</TargetExt>', premake.esc(path.getextension(target.name))) \n if cfg.kind == \" SharedLib \" then \n local ignore = (cfg.flags.NoImportLib ~= nil) \n _p(2,'<IgnoreImportLibrary>%s</IgnoreImportLibrary>', tostring(ignore)) \n end \n if cfg.platform == \" Durango \" then \n _p(2, '<ReferencePath>$(Console_SdkLibPath);$(Console_SdkWindowsM "
" etadataPath)</ReferencePath>') \n _p(2, '<LibraryPath>$(Console_SdkLibPath)</LibraryPath>') \n _p(2, '<LibraryWPath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</LibraryWPath>') \n _p(2, '<IncludePath>$(Console_SdkIncludeRoot)</IncludePath>') \n _p(2, '<ExecutablePath>$(Console_SdkRoot)bin;$(VCInstallDir)bin \\ \\ x86_amd64;$(VCInstallDir)bin;$(WindowsSDK_ExecutablePath_x86);$(VSInstallDir)Common7 \\ \\ Tools \\ \\ bin;$(VSInstallDir)Common7 \\ \\ tools;$(VSInstallDir)Common7 \\ \\ ide;$(ProgramFiles) \\ \\ HTML Help Workshop;$(MSBuildToolsPath32);$(FxCopDir);$(PATH);</ExecutablePath>') \n if cfg.imagepath then \n _p(2, '<LayoutDir>%s</LayoutDir>', cfg.imagepath) \n else \n _p(2, '<LayoutDir>%s</LayoutDir>', prj.name) \n end \n if cfg.pullmappingfile ~= nil then \n _p(2,'<PullMappingFile>%s</PullMappingFile>', premake.esc(cfg.pullmappingfile)) \n end \n _p(2, '<LayoutExtensionFilter>*.pdb;*.ilk;*.exp;*.lib;*.winmd;*.appxrecipe;*.pri;*.idb</LayoutExtensionFilter>') \n _p(2, '<IsolateConfigurationsOnDeploy>true</IsolateConfigurationsOnDeploy>') \n "
" end \n if cfg.kind ~= \" StaticLib \" then \n _p(2,'<LinkIncremental>%s</LinkIncremental>', tostring(premake.config.isincrementallink(cfg))) \n end \n if cfg.flags.NoManifest then \n _p(2,'<GenerateManifest>false</GenerateManifest>') \n end \n _p(1,'</PropertyGroup>') \n end \n end \n local function runtime(cfg) \n local runtime \n local flags = cfg.flags \n if premake.config.isdebugbuild(cfg) then \n runtime = iif(flags.StaticRuntime and not flags.Managed, \" MultiThreadedDebug \" , \" MultiThreadedDebugDLL \" ) \n else \n runtime = iif(flags.StaticRuntime and not flags.Managed, \" MultiThreaded \" , \" MultiThreadedDLL \" ) \n end \n return runtime \n end \n local 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>', cfg.pchheader) \n else \n _p(3,'<PrecompiledHeader></PrecompiledHeader>') \n end \n end \n local function preprocessor(indent,cfg) \n if #cfg.defines > 0 then \n _p(indent,'<PreprocessorDefinitions>%s;%%(PreprocessorDefin "
" itions)</PreprocessorDefinitions>' \n ,premake.esc(table.concat(cfg.defines, \" ; \" ))) \n else \n _p(indent,'<PreprocessorDefinitions></PreprocessorDefinitions>') \n end \n end \n local function include_dirs(indent,cfg) \n local includedirs = table.join(cfg.userincludedirs, cfg.includedirs) \n if #includedirs> 0 then \n _p(indent,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>' \n ,premake.esc(path.translate(table.concat(includedirs, \" ; \" ), ' \\ \\ '))) \n end \n end \n local function using_dirs(indent,cfg) \n if #cfg.usingdirs > 0 then \n _p(indent,'<AdditionalUsingDirectories>%s;%%(AdditionalUsingDirectories)</AdditionalUsingDirectories>' \n ,premake.esc(path.translate(table.concat(cfg.usingdirs, \" ; \" ), ' \\ \\ '))) \n end \n end \n local function resource_compile(cfg) \n _p(2,'<ResourceCompile>') \n preprocessor(3,cfg) \n include_dirs(3,cfg) \n _p(2,'</ResourceCompile>') \n end \n local function exceptions(cfg) \n if cfg.flags.NoExceptions then \n _p(3, '<ExceptionHandling>false</ExceptionHandling>') \n elseif cfg.fla "
" gs.SEH then \n _p(3, '<ExceptionHandling>Async</ExceptionHandling>') \n end \n end \n local function rtti(cfg) \n if cfg.flags.NoRTTI and not cfg.flags.Managed then \n _p(3,'<RuntimeTypeInfo>false</RuntimeTypeInfo>') \n end \n end \n local function calling_convention(cfg) \n if cfg.flags.FastCall then \n _p(3,'<CallingConvention>FastCall</CallingConvention>') \n elseif cfg.flags.StdCall then \n _p(3,'<CallingConvention>StdCall</CallingConvention>') \n end \n end \n local function wchar_t_builtin(cfg) \n if cfg.flags.NativeWChar then \n _p(3,'<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>') \n elseif cfg.flags.NoNativeWChar then \n _p(3,'<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>') \n end \n end \n local function sse(cfg) \n if cfg.flags.EnableSSE then \n _p(3, '<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>') \n elseif cfg.flags.EnableSSE2 then \n _p(3, '<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>') \n elseif cfg.flags.EnableAVX then \n _p(3, '<EnableEnhance "
" dInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>') \n elseif cfg.flags.EnableAVX2 then \n _p(3, '<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>') \n end \n end \n local function floating_point(cfg) \n if cfg.flags.FloatFast then \n _p(3,'<FloatingPointModel>Fast</FloatingPointModel>') \n elseif cfg.flags.FloatStrict and not cfg.flags.Managed then \n _p(3,'<FloatingPointModel>Strict</FloatingPointModel>') \n end \n end \n local function debug_info(cfg) \n local debug_info = '' \n if cfg.flags.Symbols then \n if cfg.flags.C7DebugInfo then \n debug_info = \" OldStyle \" \n elseif (action.vstudio.supports64bitEditContinue == false and cfg.platform == \" x64 \" ) \n or cfg.flags.Managed \n or premake.config.isoptimizedbuild(cfg.flags) \n or cfg.flags.NoEditAndContinue \n then \n debug_info = \" ProgramDatabase \" \n else \n debug_info = \" EditAndContinue \" \n end \n end \n _p(3,'<DebugInformationFormat>%s</DebugInformationFormat>',debug_info) \n end \n local function minimal_build(cfg) \n if premake.config.isdebug "
" build(cfg) and cfg.flags.EnableMinimalRebuild then \n _p(3,'<MinimalRebuild>true</MinimalRebuild>') \n else \n _p(3,'<MinimalRebuild>false</MinimalRebuild>') \n end \n end \n local function compile_language(cfg) \n if cfg.options.ForceCPP then \n _p(3,'<CompileAs>CompileAsCpp</CompileAs>') \n else \n if cfg.language == \" C \" then \n _p(3,'<CompileAs>CompileAsC</CompileAs>') \n end \n end \n end \n local function forcedinclude_files(indent,cfg) \n if #cfg.forcedincludes > 0 then \n _p(indent,'<ForcedIncludeFiles>%s</ForcedIncludeFiles>' \n ,premake.esc(path.translate(table.concat(cfg.forcedincludes, \" ; \" ), ' \\ \\ '))) \n end \n end \n local function vs10_clcompile(cfg) \n _p(2,'<ClCompile>') \n local unsignedChar = \" /J \" \n local buildoptions = cfg.buildoptions \n if cfg.platform == \" Orbis \" then \n unsignedChar = \" -funsigned-char \" ; \n _p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil)) \n end \n if cfg.language == \" C \" and not cfg.options.ForceCPP then \n buildoptions = table.join(buildoptions, cfg.buildoptions_c) \n "
" else \n buildoptions = table.join(buildoptions, cfg.buildoptions_cpp) \n end \n _p(3,'<AdditionalOptions>%s %s%%(AdditionalOptions)</AdditionalOptions>' \n , table.concat(premake.esc(buildoptions), \" \" ) \n , iif(cfg.flags.UnsignedChar, unsignedChar, \" \" ) \n ) \n _p(3,'<Optimization>%s</Optimization>',optimisation(cfg)) \n include_dirs(3, cfg) \n using_dirs(3, cfg) \n preprocessor(3, cfg) \n minimal_build(cfg) \n if not premake.config.isoptimizedbuild(cfg.flags) then \n if not cfg.flags.Managed then \n _p(3, '<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>') \n end \n if cfg.flags.ExtraWarnings then \n end \n else \n _p(3, '<StringPooling>true</StringPooling>') \n end \n if cfg.platform == \" Durango \" or cfg.flags.NoWinRT then \n _p(3, '<CompileAsWinRT>false</CompileAsWinRT>') \n end \n _p(3, '<RuntimeLibrary>%s</RuntimeLibrary>', runtime(cfg)) \n if cfg.flags.NoBufferSecurityCheck then \n _p(3, '<BufferSecurityCheck>false</BufferSecurityCheck>') \n end \n _p(3,'<FunctionLevelLinking>true</FunctionLevelLinking>') \n if not cfg.flags.NoMultiProcessorComp "
" ilation and not cfg.flags.EnableMinimalRebuild then \n _p(3, '<MultiProcessorCompilation>true</MultiProcessorCompilation>') \n else \n _p(3, '<MultiProcessorCompilation>false</MultiProcessorCompilation>') \n end \n precompiled_header(cfg) \n if cfg.flags.PedanticWarnings then \n _p(3, '<WarningLevel>EnableAllWarnings</WarningLevel>') \n elseif cfg.flags.ExtraWarnings then \n _p(3, '<WarningLevel>Level4</WarningLevel>') \n elseif cfg.flags.MinimumWarnings then \n _p(3, '<WarningLevel>Level1</WarningLevel>') \n else \n _p(3 ,'<WarningLevel>Level3</WarningLevel>') \n end \n if cfg.flags.FatalWarnings then \n _p(3, '<TreatWarningAsError>true</TreatWarningAsError>') \n end \n exceptions(cfg) \n rtti(cfg) \n calling_convention(cfg) \n wchar_t_builtin(cfg) \n sse(cfg) \n floating_point(cfg) \n debug_info(cfg) \n if cfg.flags.Symbols \n and _ACTION:sub(3) ~= \" 2017 \" \n then \n _p(3, '<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>' \n , path.getbasename(cfg.buildtarget.name) \n ) \n end \n if cfg.flags.NoFramePointer then \n _p(3, '<OmitFramePointers>true</OmitF "
" ramePointers>') \n end \n if cfg.flags.UseFullPaths then \n _p(3, '<UseFullPaths>true</UseFullPaths>') \n end \n compile_language(cfg) \n forcedinclude_files(3,cfg); \n _p(2,'</ClCompile>') \n end \n local function event_hooks(cfg) \n if #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>') \n end \n if #cfg.prebuildcommands> 0 then \n _p(2,'<PreBuildEvent>') \n _p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prebuildcommands, \" \" , \" \" , \" \\ r \\ n \" ))) \n _p(2,'</PreBuildEvent>') \n end \n if #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>') \n end \n end \n local function additional_options(indent,cfg) \n if #cfg.linkoptions > 0 then \n _p(indent,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>', \n table.concat(premake.esc(cfg.linkoptions), \" \" )) \n end "
" \n end \n local function link_target_machine(index,cfg) \n local platforms = {x32 = 'MachineX86', x64 = 'MachineX64'} \n if platforms[cfg.platform] then \n _p(index,'<TargetMachine>%s</TargetMachine>', platforms[cfg.platform]) \n end \n end \n local function item_def_lib(cfg) \n if cfg.kind == 'StaticLib' and cfg.platform ~= \" Xbox360 \" then \n _p(1,'<Lib>') \n _p(2,'<OutputFile>$(OutDir)%s</OutputFile>',cfg.buildtarget.name) \n additional_options(2,cfg) \n link_target_machine(2,cfg) \n _p(1,'</Lib>') \n end \n end \n local function import_lib(cfg) \n if cfg.kind == \" SharedLib \" then \n local implibname = cfg.linktarget.fullpath \n _p(3,'<ImportLibrary>%s</ImportLibrary>',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \" \\ \\ \" .. path.getname(implibname), implibname)) \n end \n end \n local function hasmasmfiles(prj) \n local files = vc2010.getfilegroup(prj, \" MASM \" ) \n return #files > 0 \n end \n local function vs10_masm(prj, cfg) \n if hasmasmfiles(prj) then \n _p(2, '<MASM>') \n _p(3,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>' \n , table.concat( "
" premake.esc(table.join(cfg.buildoptions, cfg.buildoptions_asm)), \" \" ) \n ) \n local includedirs = table.join(cfg.userincludedirs, cfg.includedirs) \n if #includedirs > 0 then \n _p(3, '<IncludePaths>%s;%%(IncludePaths)</IncludePaths>' \n , premake.esc(path.translate(table.concat(includedirs, \" ; \" ), ' \\ \\ ')) \n ) \n end \n local defines = table.join(cfg.defines) \n table.insertflat(defines, iif(premake.config.isdebugbuild(cfg), \" _DEBUG \" , {})) \n table.insert(defines, iif(cfg.platform == \" x64 \" , \" _WIN64 \" , \" _WIN32 \" )) \n table.insert(defines, iif(prj.kind == \" SharedLib \" , \" _EXPORT=EXPORT \" , \" _EXPORT= \" )) \n _p(3, '<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>' \n , premake.esc(table.concat(defines, \" ; \" )) \n ) \n if cfg.flags.FatalWarnings then \n _p(3,'<TreatWarningsAsErrors>true</TreatWarningsAsErrors>') \n end \n if cfg.flags.MinimumWarnings then \n _p(3,'<WarningLevel>0</WarningLevel>') \n else \n _p(3,'<WarningLevel>3</WarningLevel>') \n end \n _p(2, '</MASM>') \n end \n end \n function vc2010.link(cfg) \n _p(2,' "
" <Link>') \n _p(3,'<SubSystem>%s</SubSystem>', iif(cfg.kind == \" ConsoleApp \" , \" Console \" , \" Windows \" )) \n _p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil)) \n if cfg.flags.Symbols \n and _ACTION:sub(3) == \" 2017 \" \n then \n _p(3, '<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>' \n , path.getbasename(cfg.buildtarget.name) \n ) \n end \n if premake.config.isoptimizedbuild(cfg.flags) then \n _p(3,'<EnableCOMDATFolding>true</EnableCOMDATFolding>') \n _p(3,'<OptimizeReferences>true</OptimizeReferences>') \n end \n if cfg.kind ~= 'StaticLib' then \n vc2010.additionalDependencies(3,cfg) \n _p(3,'<OutputFile>$(OutDir)%s</OutputFile>', cfg.buildtarget.name) \n if #cfg.libdirs > 0 then \n _p(3,'<AdditionalLibraryDirectories>%s;%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>' \n , premake.esc(path.translate(table.concat(cfg.libdirs, ';'), ' \\ \\ ')) \n ) \n end \n if vc2010.config_type(cfg) == 'Application' and not cfg.flags.WinMain and not cfg.flags.Managed then \n if cfg.flags. "
" Unicode then \n _p(3,'<EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>') \n else \n _p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>') \n end \n end \n import_lib(cfg) \n local deffile = premake.findfile(cfg, \" .def \" ) \n if deffile then \n _p(3,'<ModuleDefinitionFile>%s</ModuleDefinitionFile>', deffile) \n end \n link_target_machine(3,cfg) \n additional_options(3,cfg) \n if cfg.flags.NoWinMD and vstudio.iswinrt() and prj.kind == \" WindowedApp \" then \n _p(3,'<GenerateWindowsMetadata>false</GenerateWindowsMetadata>' ) \n end \n end \n _p(2,'</Link>') \n end \n function vc2010.additionalDependencies(tab,cfg) \n local links = premake.getlinks(cfg, \" system \" , \" fullpath \" ) \n if #links > 0 then \n local deps = \" \" \n if cfg.platform == \" Orbis \" then \n for _, v in ipairs(links) do \n deps = deps .. \" -l \" .. v .. \" ; \" \n end \n else \n deps = table.concat(links, \" ; \" ) \n end \n _p(tab, '<AdditionalDependencies>%s;%s</AdditionalDependencies>' \n , deps \n , iif(cfg.platform == \" Durango \" \n , '%(XboxExtensionsDependencies)' \n , '%(AdditionalDependencies)' \n ) \n ) "
" \n elseif cfg.platform == \" Durango \" then \n _p(tab, '<AdditionalDependencies>%%(XboxExtensionsDependencies)</AdditionalDependencies>') \n end \n end \n local function item_definitions(prj) \n for _, cfginfo in ipairs(prj.solution.vstudio_configs) do \n local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) \n _p(1,'<ItemDefinitionGroup ' ..if_config_and_platform() ..'>' \n ,premake.esc(cfginfo.name)) \n vs10_clcompile(cfg) \n resource_compile(cfg) \n item_def_lib(cfg) \n vc2010.link(cfg) \n event_hooks(cfg) \n vs10_masm(prj, cfg) \n _p(1,'</ItemDefinitionGroup>') \n end \n end \n function vc2010.getfilegroup(prj, group) \n local sortedfiles = prj.vc2010sortedfiles \n if not sortedfiles then \n sortedfiles = { \n ClCompile = {}, \n ClInclude = {}, \n MASM = {}, \n None = {}, \n ResourceCompile = {}, \n AppxManifest = {}, \n Natvis = {}, \n Image = {}, \n DeploymentContent = {} \n } \n local foundAppxManifest = false \n for file in premake.project.eachfile(prj, true) do \n if path.issourcefilevs(file.name) then \n table.insert(sortedfiles.ClCompile, file) "
" \n elseif path.iscppheader(file.name) then \n if not table.icontains(prj.removefiles, file) then \n table.insert(sortedfiles.ClInclude, file) \n end \n elseif path.isresourcefile(file.name) then \n table.insert(sortedfiles.ResourceCompile, file) \n elseif path.isimagefile(file.name) then \n table.insert(sortedfiles.Image, file) \n elseif path.isappxmanifest(file.name) then \n foundAppxManifest = true \n table.insert(sortedfiles.AppxManifest, file) \n elseif path.isnatvis(file.name) then \n table.insert(sortedfiles.Natvis, file) \n elseif path.isasmfile(file.name) then \n table.insert(sortedfiles.MASM, file) \n elseif file.flags and table.icontains(file.flags, \" DeploymentContent \" ) then \n table.insert(sortedfiles.DeploymentContent, file) \n else \n table.insert(sortedfiles.None, file) \n end \n end \n if vstudio.iswinrt() and prj.kind == \" WindowedApp \" and not foundAppxManifest then \n vstudio.needAppxManifest = true \n local fcfg = {} \n fcfg.name = prj.name .. \" /Package.appxmanifest \" \n fcfg.vpath = premake.project.getvpath(prj, fcfg.name) \n table.insert( "
" sortedfiles.AppxManifest, fcfg) \n local logo = {} \n logo.name = prj.name .. \" /Logo.png \" \n logo.vpath = logo.name \n table.insert(sortedfiles.Image, logo) \n local smallLogo = {} \n smallLogo.name = prj.name .. \" /SmallLogo.png \" \n smallLogo.vpath = smallLogo.name \n table.insert(sortedfiles.Image, smallLogo) \n local storeLogo = {} \n storeLogo.name = prj.name .. \" /StoreLogo.png \" \n storeLogo.vpath = storeLogo.name \n table.insert(sortedfiles.Image, storeLogo) \n local splashScreen = {} \n splashScreen.name = prj.name .. \" /SplashScreen.png \" \n splashScreen.vpath = splashScreen.name \n table.insert(sortedfiles.Image, splashScreen) \n end \n prj.vc2010sortedfiles = sortedfiles \n end \n return sortedfiles[group] \n end \n function vc2010.files(prj) \n vc2010.simplefilesgroup(prj, \" ClInclude \" ) \n vc2010.compilerfilesgroup(prj) \n vc2010.simplefilesgroup(prj, \" None \" ) \n vc2010.customtaskgroup(prj) \n vc2010.simplefilesgroup(prj, \" ResourceCompile \" ) \n vc2010.simplefilesgroup(prj, \" AppxManifest \" ) \n vc2010.simplefilesgroup(prj, \" Natvis \" ) \n vc2010.dep "
" loymentcontentgroup(prj, \" Image \" ) \n vc2010.deploymentcontentgroup(prj, \" DeploymentContent \" , \" None \" ) \n end \n function vc2010.customtaskgroup(prj) \n local files = { } \n for _, custombuildtask in ipairs(prj.custombuildtask or {}) do \n for _, buildtask in ipairs(custombuildtask or {}) do \n local fcfg = { } \n fcfg.name = path.getrelative(prj.location,buildtask[1]) \n fcfg.vpath = path.trimdots(fcfg.name) \n table.insert(files, fcfg) \n end \n end \n if #files > 0 then \n _p(1,'<ItemGroup>') \n local groupedBuildTasks = {} \n for _, custombuildtask in ipairs(prj.custombuildtask or {}) do \n for _, buildtask in ipairs(custombuildtask or {}) do \n if (groupedBuildTasks[buildtask[1]] == nil) then \n groupedBuildTasks[buildtask[1]] = {} \n end \n table.insert(groupedBuildTasks[buildtask[1]], buildtask) \n end \n end \n for name, custombuildtask in pairs(groupedBuildTasks or {}) do \n _p(2,'<CustomBuild Include= \\ \" %s \\ \" >', path.translate(path.getrelative(prj.location,name), \" \\ \\ \" )) \n _p(3,'<FileType>Text</FileType>') \n local cmd = \" \" \n local outputs = "
" \" \" \n for _, buildtask in ipairs(custombuildtask or {}) do \n for _, cmdline in ipairs(buildtask[4] or {}) do \n cmd = cmd .. cmdline \n local num = 1 \n for _, depdata in ipairs(buildtask[3] or {}) do \n cmd = string.gsub(cmd, \" %$%( \" .. num .. \" %) \" , string.format( \" %s \" ,path.getrelative(prj.location,depdata))) \n num = num + 1 \n end \n cmd = string.gsub(cmd, \" %$%(<%) \" , string.format( \" %s \" ,path.getrelative(prj.location,buildtask[1]))) \n cmd = string.gsub(cmd, \" %$%(@%) \" , string.format( \" %s \" ,path.getrelative(prj.location,buildtask[2]))) \n cmd = cmd .. \" \\ r \\ n \" \n end \n outputs = outputs .. path.getrelative(prj.location,buildtask[2]) .. \" ; \" \n end \n _p(3,'<Command>%s</Command>',cmd) \n _p(3,'<Outputs>%s%%(Outputs)</Outputs>',outputs) \n _p(3,'<SubType>Designer</SubType>') \n _p(3,'<Message></Message>') \n _p(2,'</CustomBuild>') \n end \n _p(1,'</ItemGroup>') \n end \n end \n function vc2010.simplefilesgroup(prj, section, subtype) \n local files = vc2010.getfilegroup(prj, section) \n if #files > 0 then \n _p(1,'<ItemGroup>') \n for _, file in ip "
" airs(files) do \n if subtype then \n _p(2,'<%s Include= \\ \" %s \\ \" >', section, path.translate(file.name, \" \\ \\ \" )) \n _p(3,'<SubType>%s</SubType>', subtype) \n _p(2,'</%s>', section) \n else \n _p(2,'<%s Include= \\ \" %s \\ \" />', section, path.translate(file.name, \" \\ \\ \" )) \n end \n end \n _p(1,'</ItemGroup>') \n end \n end \n function vc2010.deploymentcontentgroup(prj, section, filetype) \n if filetype == nil then \n filetype = section \n end \n local files = vc2010.getfilegroup(prj, section) \n if #files > 0 then \n _p(1,'<ItemGroup>') \n for _, file in ipairs(files) do \n _p(2,'<%s Include= \\ \" %s \\ \" >', filetype, path.translate(file.name, \" \\ \\ \" )) \n _p(3,'<DeploymentContent>true</DeploymentContent>') \n _p(3,'<Link>%s</Link>', path.translate(file.vpath, \" \\ \\ \" )) \n _p(2,'</%s>', filetype) \n end \n _p(1,'</ItemGroup>') \n end \n end \n function vc2010.compilerfilesgroup(prj) \n local configs = prj.solution.vstudio_configs \n local files = vc2010.getfilegroup(prj, \" ClCompile \" ) \n if #files > 0 then \n local config_mappings = {} \n for _, cfginfo in ipairs(configs) "
" do \n local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) \n if cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then \n config_mappings[cfginfo] = path.translate(cfg.pchsource, \" \\ \\ \" ) \n end \n end \n _p(1,'<ItemGroup>') \n for _, file in ipairs(files) do \n local translatedpath = path.translate(file.name, \" \\ \\ \" ) \n _p(2, '<ClCompile Include= \\ \" %s \\ \" >', translatedpath) \n _p(3, '<ObjectFileName>$(IntDir)%s \\ \\ </ObjectFileName>' \n , premake.esc(path.translate(path.trimdots(path.getdirectory(file.name)))) \n ) \n if path.iscxfile(file.name) then \n _p(3, '<CompileAsWinRT>true</CompileAsWinRT>') \n _p(3, '<RuntimeTypeInfo>true</RuntimeTypeInfo>') \n _p(3, '<PrecompiledHeader>NotUsing</PrecompiledHeader>') \n end \n if vstudio.iswinrt() and string.len(file.name) > 2 and string.sub(file.name, -2) == \" .c \" then \n _p(3,'<CompileAsWinRT>FALSE</CompileAsWinRT>') \n end \n for _, cfginfo in ipairs(configs) do \n if config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then \n _p(3,'<PrecompiledHeader "
" '.. if_config_and_platform() .. '>Create</PrecompiledHeader>', premake.esc(cfginfo.name)) \n config_mappings[cfginfo] = nil --only one source file per pch \n end \n end \n local nopch = table.icontains(prj.nopch, file.name) \n for _, vsconfig in ipairs(configs) do \n local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform) \n if nopch or table.icontains(cfg.nopch, file.name) then \n _p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>NotUsing</PrecompiledHeader>', premake.esc(vsconfig.name)) \n end \n end \n local excluded = table.icontains(prj.excludes, file.name) \n for _, vsconfig in ipairs(configs) do \n local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform) \n local fileincfg = table.icontains(cfg.files, file.name) \n local cfgexcluded = table.icontains(cfg.excludes, file.name) \n if excluded or not fileincfg or cfgexcluded then \n _p(3, '<ExcludedFromBuild ' \n .. if_config_and_platform() \n .. '>true</ExcludedFromBuild>' \n , premake.esc(vsconfig.name) \n ) \n end \n end \n if prj.flags and pr "
" j.flags.Managed then \n local prjforcenative = table.icontains(prj.forcenative, file.name) \n for _,vsconfig in ipairs(configs) do \n local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform) \n if prjforcenative or table.icontains(cfg.forcenative, file.name) then \n _p(3, '<CompileAsManaged ' .. if_config_and_platform() .. '>false</CompileAsManaged>', premake.esc(vsconfig.name)) \n end \n end \n end \n _p(2,'</ClCompile>') \n end \n _p(1,'</ItemGroup>') \n end \n end \n function vc2010.masmfiles(prj) \n local configs = prj.solution.vstudio_configs \n local files = vc2010.getfilegroup(prj, \" MASM \" ) \n if #files > 0 then \n _p(1, '<ItemGroup>') \n for _, file in ipairs(files) do \n local translatedpath = path.translate(file.name, \" \\ \\ \" ) \n _p(2, '<MASM Include= \" %s \" >', translatedpath) \n local excluded = table.icontains(prj.excludes, file.name) \n for _, vsconfig in ipairs(configs) do \n local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform) \n local fileincfg = table.icontains(cfg.files, file.name) \n local "
" cfgexcluded = table.icontains(cfg.excludes, file.name) \n if excluded or not fileincfg or cfgexcluded then \n _p(3, '<ExcludedFromBuild ' \n .. if_config_and_platform() \n .. '>true</ExcludedFromBuild>' \n , premake.esc(vsconfig.name) \n ) \n end \n end \n _p(2, '</MASM>') \n end \n _p(1, '</ItemGroup>') \n end \n end \n function vc2010.header(targets) \n io.eol = \" \\ r \\ n \" \n _p('<?xml version= \" 1.0 \" encoding= \" utf-8 \" ?>') \n local t = \" \" \n if targets then \n t = ' DefaultTargets= \" ' .. targets .. ' \" ' \n end \n _p('<Project%s ToolsVersion= \" %s \" xmlns= \" http://schemas.microsoft.com/developer/msbuild/2003 \" >', t, action.vstudio.toolsVersion) \n end \n function premake.vs2010_vcxproj(prj) \n local usemasm = hasmasmfiles(prj) \n io.indent = \" \" \n vc2010.header( \" Build \" ) \n vs2010_config(prj) \n vs2010_globals(prj) \n _p(1,'<Import Project= \" $(VCTargetsPath) \\ \\ Microsoft.Cpp.Default.props \" />') \n for _, cfginfo in ipairs(prj.solution.vstudio_configs) do \n local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) \n vc2010.configurationProper "
" tyGroup(cfg, cfginfo) \n end \n _p(1,'<Import Project= \" $(VCTargetsPath) \\ \\ Microsoft.Cpp.props \" />') \n _p(1,'<ImportGroup Label= \" ExtensionSettings \" >') \n if usemasm then \n _p(2, '<Import Project= \" $(VCTargetsPath) \\ \\ BuildCustomizations \\ \\ masm.props \" />') \n end \n _p(1,'</ImportGroup>') \n import_props(prj) \n _p(1,'<PropertyGroup Label= \" UserMacros \" />') \n vc2010.outputProperties(prj) \n item_definitions(prj) \n if prj.flags.Managed then \n vc2010.clrReferences(prj) \n end \n vc2010.files(prj) \n vc2010.projectReferences(prj) \n vc2010.sdkReferences(prj) \n vc2010.masmfiles(prj) \n _p(1,'<Import Project= \" $(VCTargetsPath) \\ \\ Microsoft.Cpp.targets \" />') \n _p(1,'<ImportGroup Label= \" ExtensionTargets \" >') \n if usemasm then \n _p(2, '<Import Project= \" $(VCTargetsPath) \\ \\ BuildCustomizations \\ \\ masm.targets \" />') \n end \n _p(1,'</ImportGroup>') \n _p('</Project>') \n end \n function vc2010.clrReferences(prj) \n if #prj.clrreferences == 0 then \n return \n end \n _p(1,'<ItemGroup>') \n for _, ref in ipairs(prj.clrreferences) do \n if os.isfile(ref) then \n local ass "
" embly = path.getbasename(ref) \n _p(2,'<Reference Include= \" %s \" >', assembly) \n _p(3,'<HintPath>%s</HintPath>', path.getrelative(prj.location, ref)) \n _p(2,'</Reference>') \n else \n _p(2,'<Reference Include= \" %s \" />', ref) \n end \n end \n _p(1,'</ItemGroup>') \n end \n function vc2010.projectReferences(prj) \n local deps = premake.getdependencies(prj) \n if #deps == 0 and #prj.vsimportreferences == 0 then \n return \n end \n _p(1,'<ItemGroup>') \n for _, dep in ipairs(deps) do \n local deppath = path.getrelative(prj.location, vstudio.projectfile(dep)) \n _p(2,'<ProjectReference Include= \\ \" %s \\ \" >', path.translate(deppath, \" \\ \\ \" )) \n _p(3,'<Project>{%s}</Project>', dep.uuid) \n if vstudio.iswinrt() then \n _p(3,'<ReferenceOutputAssembly>false</ReferenceOutputAssembly>') \n end \n _p(2,'</ProjectReference>') \n end \n for _, ref in ipairs(prj.vsimportreferences) do \n local iprj = premake.vstudio.getimportprj(ref, prj.solution) \n _p(2,'<ProjectReference Include= \\ \" %s \\ \" >', iprj.relpath) \n _p(3,'<Project>{%s}</Project>', iprj.uuid) \n _p(2,'</ProjectReferen "
" ce>') \n end \n _p(1,'</ItemGroup>') \n end \n function vc2010.sdkReferences(prj) \n local refs = prj.sdkreferences \n if #refs > 0 then \n _p(1,'<ItemGroup>') \n for _, ref in ipairs(refs) do \n _p(2,'<SDKReference Include= \\ \" %s \\ \" />', ref) \n end \n _p(1,'</ItemGroup>') \n end \n end \n function vc2010.debugdir(cfg) \n local debuggerFlavor = \n iif(cfg.platform == \" Orbis \" , 'ORBISDebugger' \n , iif(cfg.platform == \" Durango \" , 'XboxOneVCppDebugger' \n , 'WindowsLocalDebugger' \n )) \n _p(2, '<DebuggerFlavor>%s</DebuggerFlavor>', debuggerFlavor) \n if cfg.debugdir and not vstudio.iswinrt() then \n _p(2, '<LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDirectory>' \n , path.translate(cfg.debugdir, ' \\ \\ ') \n ) \n end \n if cfg.debugargs then \n _p(2, '<LocalDebuggerCommandArguments>%s</LocalDebuggerCommandArguments>' \n , table.concat(cfg.debugargs, \" \" ) \n ) \n end \n if cfg.debugenvs and #cfg.debugenvs > 0 then \n _p(2, '<LocalDebuggerEnvironment>%s%s</LocalDebuggerEnvironment>' \n , table.concat(cfg.debugenvs, \" \\ n \" ) \n , ii "
" f(cfg.flags.DebugEnvsInherit,' \\ n$(LocalDebuggerEnvironment)', '') \n ) \n if cfg.flags.DebugEnvsDontMerge then \n _p(2, '<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>') \n end \n end \n if cfg.deploymode then \n _p(' <DeployMode>%s</DeployMode>', cfg.deploymode) \n end \n end \n function premake.vs2010_vcxproj_user(prj) \n io.indent = \" \" \n vc2010.header() \n for _, cfginfo in ipairs(prj.solution.vstudio_configs) do \n local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) \n _p(' <PropertyGroup '.. if_config_and_platform() ..'>', premake.esc(cfginfo.name)) \n vc2010.debugdir(cfg) \n _p(' </PropertyGroup>') \n end \n _p('</Project>') \n end \n local png1x1data = { \n 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, -- .PNG........IHDR \n 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xdb, 0x56, -- .............%.V \n 0xca, 0x00, 0x00, 0x00, 0x03, 0x50, 0x4c, 0x54, 0x45, 0x00, 0x00, 0x00, 0xa7, 0x7a, 0x3d, 0xda, -- ... "
" ..PLTE....z=. \n 0x00, 0x00, 0x00, 0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00, 0x00, -- ....tRNS.@..f... \n 0x0a, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0xe2, -- .IDAT..c`....... \n 0x21, 0xbc, 0x33, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, -- !.3....IEND.B`. \n } \n function png1x1(obj, filename) \n filename = premake.project.getfilename(obj, filename) \n local f, err = io.open(filename, \" wb \" ) \n if f then \n for _, byte in ipairs(png1x1data) do \n f:write(string.char(byte)) \n end \n f:close() \n end \n end \n function premake.vs2010_appxmanifest(prj) \n io.indent = \" \" \n io.eol = \" \\ r \\ n \" \n _p('<?xml version= \" 1.0 \" encoding= \" utf-8 \" ?>') \n if vstudio.toolset == \" v120_wp81 \" then \n _p('<Package xmlns= \" http://schemas.microsoft.com/appx/2010/manifest \" xmlns:m2= \" http://schemas.microsoft.com/appx/2013/manifest \" xmlns:m3= \" http://schemas.microsoft.com/appx/2014/manifest \" xmlns:mp= \" http://schemas.microsoft.com/appx/2014/phone/ "
" manifest \" >') \n elseif vstudio.storeapp == \" 8.1 \" then \n _p('<Package xmlns= \" http://schemas.microsoft.com/appx/2010/manifest \" xmlns:m3= \" http://schemas.microsoft.com/appx/2013/manifest \" >') \n elseif vstudio.storeapp == \" durango \" then \n _p('<Package xmlns= \" http://schemas.microsoft.com/appx/2010/manifest \" xmlns:mx= \" http://schemas.microsoft.com/appx/2013/xbox/manifest \" IgnorableNamespaces= \" mx \" >') \n else \n _p('<Package xmlns= \" http://schemas.microsoft.com/appx/manifest/foundation/windows10 \" xmlns:mp= \" http://schemas.microsoft.com/appx/2014/phone/manifest \" xmlns:m3= \" http://schemas.microsoft.com/appx/manifest/uap/windows10 \" >') \n end \n _p(1,'<Identity Name= \" ' .. prj.uuid .. ' \" ') \n _p(2,'Publisher= \" CN=Publisher \" ') \n _p(2,'Version= \" 1.0.0.0 \" />') \n if vstudio.toolset == \" v120_wp81 \" or vstudio.storeapp == \" 8.2 \" then \n _p(1,'<mp:PhoneIdentity PhoneProductId= \" ' .. prj.uuid .. ' \" PhonePublisherId= \" 00000000-0000-0000-0000-000000000000 \" />') \n end \n _p(1, '<Properties>') \n _p(2, '<DisplayName>' .. prj.name .. '</ "
" DisplayName>') \n _p(2, '<PublisherDisplayName>PublisherDisplayName</PublisherDisplayName>') \n _p(2, '<Logo>' .. prj.name .. ' \\ \\ StoreLogo.png</Logo>') \n png1x1(prj, \" %%/StoreLogo.png \" ) \n _p(2, '<Description>' .. prj.name .. '</Description>') \n _p(1,'</Properties>') \n if vstudio.storeapp == \" 8.2 \" then \n _p(1, '<Dependencies>') \n _p(2, '<TargetDeviceFamily Name= \" Windows.Universal \" MinVersion= \" 10.0.10069.0 \" MaxVersionTested= \" 10.0.10069.0 \" />') \n _p(1, '</Dependencies>') \n elseif vstudio.storeapp == \" durango \" then \n _p(1, '<Prerequisites>') \n _p(2, '<OSMinVersion>6.2</OSMinVersion>') \n _p(2, '<OSMaxVersionTested>6.2</OSMaxVersionTested>') \n _p(1, '</Prerequisites>') \n else \n _p(1, '<Prerequisites>') \n _p(2, '<OSMinVersion>6.3.0</OSMinVersion>') \n _p(2, '<OSMaxVersionTested>6.3.0</OSMaxVersionTested>') \n _p(1, '</Prerequisites>') \n end \n _p(1,'<Resources>') \n _p(2,'<Resource Language= \" en-us \" />') \n _p(1,'</Resources>') \n _p(1,'<Applications>') \n _p(2,'<Application Id= \" App \" ') \n _p(3,'Executable= \" $targetnametoken$.exe \" ') \n _p "
" (3,'EntryPoint= \" ' .. prj.name .. '.App \" >') \n if vstudio.storeapp == \" durango \" then \n _p(3, '<VisualElements') \n _p(4, 'DisplayName= \" ' .. prj.name .. ' \" ') \n _p(4, 'Logo= \" ' .. prj.name .. ' \\ \\ Logo.png \" ') \n png1x1(prj, \" %%/Logo.png \" ) \n _p(4, 'SmallLogo= \" ' .. prj.name .. ' \\ \\ SmallLogo.png \" ') \n png1x1(prj, \" %%/SmallLogo.png \" ) \n _p(4, 'Description= \" ' .. prj.name .. ' \" ') \n _p(4, 'ForegroundText= \" light \" ') \n _p(4, 'BackgroundColor= \" transparent \" >') \n _p(5, '<SplashScreen Image= \" ' .. prj.name .. ' \\ \\ SplashScreen.png \" />') \n png1x1(prj, \" %%/SplashScreen.png \" ) \n _p(3, '</VisualElements>') \n _p(3, '<Extensions>') \n _p(4, '<mx:Extension Category= \" xbox.system.resources \" >') \n _p(4, '<mx:XboxSystemResources />') \n _p(4, '</mx:Extension>') \n _p(3, '</Extensions>') \n else \n _p(3, '<m3:VisualElements') \n _p(4, 'DisplayName= \" ' .. prj.name .. ' \" ') \n _p(4, 'Square150x150Logo= \" ' .. prj.name .. ' \\ \\ Logo.png \" ') \n png1x1(prj, \" %%/Logo.png \" ) \n if vstudio.toolset == \" v120_wp81 \" or vstudio.storeapp == \" 8.2 \" then \n _p(4, 'Squa "
" re44x44Logo= \" ' .. prj.name .. ' \\ \\ SmallLogo.png \" ') \n png1x1(prj, \" %%/SmallLogo.png \" ) \n else \n _p(4, 'Square30x30Logo= \" ' .. prj.name .. ' \\ \\ SmallLogo.png \" ') \n png1x1(prj, \" %%/SmallLogo.png \" ) \n end \n _p(4, 'Description= \" ' .. prj.name .. ' \" ') \n _p(4, 'ForegroundText= \" light \" ') \n _p(4, 'BackgroundColor= \" transparent \" >') \n _p(4, '<m3:SplashScreen Image= \" ' .. prj.name .. ' \\ \\ SplashScreen.png \" />') \n png1x1(prj, \" %%/SplashScreen.png \" ) \n _p(3, '</m3:VisualElements>') \n end \n _p(2,'</Application>') \n _p(1,'</Applications>') \n _p('</Package>') \n end \n " ,
" Windows Phone</ApplicationType>') \n else \n _p(2, '<ApplicationType>Windows Store</ApplicationType>') \n end \n _p(2, '<ApplicationTypeRevision>%s</ApplicationTypeRevision>', vstudio.storeapp) \n end \n else \n _p(2, '<Keyword>Win32Proj</Keyword>') \n end \n if _ACTION:sub(3) == \" 2015 \" or _ACTION:sub(3) == \" 2017 \" or _ACTION:sub(3) == \" llvm \" then \n _p(2,'<PreferredToolArchitecture>x64</PreferredToolArchitecture>') \n end \n if (_ACTION:sub(3) == \" 2017 \" or _ACTION:sub(3) == \" llvm \" ) \n and os.isdir(path.join(os.getenv( \" VSINSTALLDIR \" ), \" VC/Tools/MSVC/14.14.26428 \" )) then \n _p(2,'<VCToolsVersion>14.14.26428</VCToolsVersion>') \n end \n _p(1,'</PropertyGroup>') \n end \n function vc2010.config_type(config) \n local t = \n { \n SharedLib = \" DynamicLibrary \" , \n StaticLib = \" StaticLibrary \" , \n ConsoleApp = \" Application \" , \n WindowedApp = \" Application \" \n } \n return t[config.kind] \n end \n local function if_config_and_platform() \n return 'Condition= \" \\ '$(Configuration)|$(Platform) \\ '== \\ '%s \\ ' \" ' \n end \n local function optimisation(cfg) \n local result "
" = \" Disabled \" \n for _, value in ipairs(cfg.flags) do \n if (value == \" Optimize \" ) then \n result = \" Full \" \n elseif (value == \" OptimizeSize \" ) then \n result = \" MinSpace \" \n elseif (value == \" OptimizeSpeed \" ) then \n result = \" MaxSpeed \" \n end \n end \n return result \n end \n function vc2010.configurationPropertyGroup(cfg, cfginfo) \n _p(1,'<PropertyGroup '..if_config_and_platform() ..' Label= \" Configuration \" >' \n , premake.esc(cfginfo.name)) \n _p(2,'<ConfigurationType>%s</ConfigurationType>',vc2010.config_type(cfg)) \n _p(2,'<UseDebugLibraries>%s</UseDebugLibraries>', iif(optimisation(cfg) == \" Disabled \" , \" true \" , \" false \" )) \n _p(2,'<PlatformToolset>%s</PlatformToolset>', premake.vstudio.toolset) \n if cfg.flags.MFC then \n _p(2,'<UseOfMfc>%s</UseOfMfc>', iif(cfg.flags.StaticRuntime, \" Static \" , \" Dynamic \" )) \n end \n if cfg.flags.ATL or cfg.flags.StaticATL then \n _p(2,'<UseOfAtl>%s</UseOfAtl>', iif(cfg.flags.StaticATL, \" Static \" , \" Dynamic \" )) \n end \n if cfg.flags.Unicode then \n _p(2,'<CharacterSet>Unicode</CharacterSet>') \n end \n if cfg "
" .flags.Managed then \n _p(2,'<CLRSupport>true</CLRSupport>') \n end \n _p(1,'</PropertyGroup>') \n end \n local function import_props(prj) \n for _, cfginfo in ipairs(prj.solution.vstudio_configs) do \n local 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 if #cfg.propertysheets > 0 then \n local dirs = cfg.propertysheets \n for _, dir in ipairs(dirs) do \n _p(2,'<Import Project= \" %s \" />', path.translate(dir)) \n end \n end \n _p(1,'</ImportGroup>') \n end \n end \n local function add_trailing_backslash(dir) \n if dir:len() > 0 and dir:sub(-1) ~= \" \\ \\ \" then \n return dir.. \" \\ \\ \" \n end \n return dir \n end \n function vc2010.outputProperties(prj) \n for _, cfginfo in ipairs(prj.solution.vstudio_configs) do \n local cfg = p "
" remake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) \n local target = cfg.buildtarget \n local outdir = add_trailing_backslash(target.directory) \n local intdir = add_trailing_backslash(iif(action.vstudio.intDirAbsolute \n , path.translate( \n path.join(prj.solution.location, cfg.objectsdir) \n , ' \\ \\ ') \n , cfg.objectsdir \n )) \n _p(1,'<PropertyGroup '..if_config_and_platform() ..'>', premake.esc(cfginfo.name)) \n _p(2,'<OutDir>%s</OutDir>', iif(outdir:len() > 0, premake.esc(outdir), \" . \\ \\ \" )) \n if cfg.platform == \" Xbox360 \" then \n _p(2,'<OutputFile>$(OutDir)%s</OutputFile>', premake.esc(target.name)) \n end \n _p(2,'<IntDir>%s</IntDir>', premake.esc(intdir)) \n _p(2,'<TargetName>%s</TargetName>', premake.esc(path.getbasename(target.name))) \n _p(2,'<TargetExt>%s</TargetExt>', premake.esc(path.getextension(target.name))) \n if cfg.kind == \" SharedLib \" then \n local ignore = (cfg.flags.NoImportLib ~= nil) \n _p(2,'<IgnoreImportLibrary>%s</IgnoreImportLibrary>', tostring(ignore)) \n end \n if cfg.platform == \" Durango \" then \n _p "
" (2, '<ReferencePath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</ReferencePath>') \n _p(2, '<LibraryPath>$(Console_SdkLibPath)</LibraryPath>') \n _p(2, '<LibraryWPath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</LibraryWPath>') \n _p(2, '<IncludePath>$(Console_SdkIncludeRoot)</IncludePath>') \n _p(2, '<ExecutablePath>$(Console_SdkRoot)bin;$(VCInstallDir)bin \\ \\ x86_amd64;$(VCInstallDir)bin;$(WindowsSDK_ExecutablePath_x86);$(VSInstallDir)Common7 \\ \\ Tools \\ \\ bin;$(VSInstallDir)Common7 \\ \\ tools;$(VSInstallDir)Common7 \\ \\ ide;$(ProgramFiles) \\ \\ HTML Help Workshop;$(MSBuildToolsPath32);$(FxCopDir);$(PATH);</ExecutablePath>') \n if cfg.imagepath then \n _p(2, '<LayoutDir>%s</LayoutDir>', cfg.imagepath) \n else \n _p(2, '<LayoutDir>%s</LayoutDir>', prj.name) \n end \n if cfg.pullmappingfile ~= nil then \n _p(2,'<PullMappingFile>%s</PullMappingFile>', premake.esc(cfg.pullmappingfile)) \n end \n _p(2, '<LayoutExtensionFilter>*.pdb;*.ilk;*.exp;*.lib;*.winmd;*.appxrecipe;*.pri;*.idb</LayoutExtensionFilter>') \n _p(2, '<Isolate "
" ConfigurationsOnDeploy>true</IsolateConfigurationsOnDeploy>') \n end \n if cfg.kind ~= \" StaticLib \" then \n _p(2,'<LinkIncremental>%s</LinkIncremental>', tostring(premake.config.isincrementallink(cfg))) \n end \n if cfg.flags.NoManifest then \n _p(2,'<GenerateManifest>false</GenerateManifest>') \n end \n _p(1,'</PropertyGroup>') \n end \n end \n local function runtime(cfg) \n local runtime \n local flags = cfg.flags \n if premake.config.isdebugbuild(cfg) then \n runtime = iif(flags.StaticRuntime and not flags.Managed, \" MultiThreadedDebug \" , \" MultiThreadedDebugDLL \" ) \n else \n runtime = iif(flags.StaticRuntime and not flags.Managed, \" MultiThreaded \" , \" MultiThreadedDLL \" ) \n end \n return runtime \n end \n local 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>', cfg.pchheader) \n else \n _p(3,'<PrecompiledHeader></PrecompiledHeader>') \n end \n end \n local function preprocessor(indent,cfg) \n if #cfg.defines > 0 th "
" en \n _p(indent,'<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>' \n ,premake.esc(table.concat(cfg.defines, \" ; \" ))) \n else \n _p(indent,'<PreprocessorDefinitions></PreprocessorDefinitions>') \n end \n end \n local function include_dirs(indent,cfg) \n local includedirs = table.join(cfg.userincludedirs, cfg.includedirs) \n if #includedirs> 0 then \n _p(indent,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>' \n ,premake.esc(path.translate(table.concat(includedirs, \" ; \" ), ' \\ \\ '))) \n end \n end \n local function using_dirs(indent,cfg) \n if #cfg.usingdirs > 0 then \n _p(indent,'<AdditionalUsingDirectories>%s;%%(AdditionalUsingDirectories)</AdditionalUsingDirectories>' \n ,premake.esc(path.translate(table.concat(cfg.usingdirs, \" ; \" ), ' \\ \\ '))) \n end \n end \n local function resource_compile(cfg) \n _p(2,'<ResourceCompile>') \n preprocessor(3,cfg) \n include_dirs(3,cfg) \n _p(2,'</ResourceCompile>') \n end \n local function exceptions(cfg) \n if cfg.flags.NoExceptions then \n _p(3, "
" '<ExceptionHandling>false</ExceptionHandling>') \n elseif cfg.flags.SEH then \n _p(3, '<ExceptionHandling>Async</ExceptionHandling>') \n end \n end \n local function rtti(cfg) \n if cfg.flags.NoRTTI and not cfg.flags.Managed then \n _p(3,'<RuntimeTypeInfo>false</RuntimeTypeInfo>') \n end \n end \n local function calling_convention(cfg) \n if cfg.flags.FastCall then \n _p(3,'<CallingConvention>FastCall</CallingConvention>') \n elseif cfg.flags.StdCall then \n _p(3,'<CallingConvention>StdCall</CallingConvention>') \n end \n end \n local function wchar_t_builtin(cfg) \n if cfg.flags.NativeWChar then \n _p(3,'<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>') \n elseif cfg.flags.NoNativeWChar then \n _p(3,'<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>') \n end \n end \n local function sse(cfg) \n if cfg.flags.EnableSSE then \n _p(3, '<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>') \n elseif cfg.flags.EnableSSE2 then \n _p(3, '<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructio "
" nSet>') \n elseif cfg.flags.EnableAVX then \n _p(3, '<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>') \n elseif cfg.flags.EnableAVX2 then \n _p(3, '<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>') \n end \n end \n local function floating_point(cfg) \n if cfg.flags.FloatFast then \n _p(3,'<FloatingPointModel>Fast</FloatingPointModel>') \n elseif cfg.flags.FloatStrict and not cfg.flags.Managed then \n _p(3,'<FloatingPointModel>Strict</FloatingPointModel>') \n end \n end \n local function debug_info(cfg) \n local debug_info = '' \n if cfg.flags.Symbols then \n if cfg.flags.C7DebugInfo then \n debug_info = \" OldStyle \" \n elseif (action.vstudio.supports64bitEditContinue == false and cfg.platform == \" x64 \" ) \n or cfg.flags.Managed \n or premake.config.isoptimizedbuild(cfg.flags) \n or cfg.flags.NoEditAndContinue \n then \n debug_info = \" ProgramDatabase \" \n else \n debug_info = \" EditAndContinue \" \n end \n end \n _p(3,'<DebugInformationFormat>%s</DebugInformationFormat>',debug_info) \n en "
" d \n local function minimal_build(cfg) \n if premake.config.isdebugbuild(cfg) and cfg.flags.EnableMinimalRebuild then \n _p(3,'<MinimalRebuild>true</MinimalRebuild>') \n else \n _p(3,'<MinimalRebuild>false</MinimalRebuild>') \n end \n end \n local function compile_language(cfg) \n if cfg.options.ForceCPP then \n _p(3,'<CompileAs>CompileAsCpp</CompileAs>') \n else \n if cfg.language == \" C \" then \n _p(3,'<CompileAs>CompileAsC</CompileAs>') \n end \n end \n end \n local function forcedinclude_files(indent,cfg) \n if #cfg.forcedincludes > 0 then \n _p(indent,'<ForcedIncludeFiles>%s</ForcedIncludeFiles>' \n ,premake.esc(path.translate(table.concat(cfg.forcedincludes, \" ; \" ), ' \\ \\ '))) \n end \n end \n local function vs10_clcompile(cfg) \n _p(2,'<ClCompile>') \n local unsignedChar = \" /J \" \n local buildoptions = cfg.buildoptions \n if cfg.platform == \" Orbis \" then \n unsignedChar = \" -funsigned-char \" ; \n _p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil)) \n end \n if cfg.language == \" C \" and not cfg.options.ForceCPP then "
" \n buildoptions = table.join(buildoptions, cfg.buildoptions_c) \n else \n buildoptions = table.join(buildoptions, cfg.buildoptions_cpp) \n end \n _p(3,'<AdditionalOptions>%s %s%%(AdditionalOptions)</AdditionalOptions>' \n , table.concat(premake.esc(buildoptions), \" \" ) \n , iif(cfg.flags.UnsignedChar, unsignedChar, \" \" ) \n ) \n _p(3,'<Optimization>%s</Optimization>',optimisation(cfg)) \n include_dirs(3, cfg) \n using_dirs(3, cfg) \n preprocessor(3, cfg) \n minimal_build(cfg) \n if not premake.config.isoptimizedbuild(cfg.flags) then \n if not cfg.flags.Managed then \n _p(3, '<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>') \n end \n if cfg.flags.ExtraWarnings then \n end \n else \n _p(3, '<StringPooling>true</StringPooling>') \n end \n if cfg.platform == \" Durango \" or cfg.flags.NoWinRT then \n _p(3, '<CompileAsWinRT>false</CompileAsWinRT>') \n end \n _p(3, '<RuntimeLibrary>%s</RuntimeLibrary>', runtime(cfg)) \n if cfg.flags.NoBufferSecurityCheck then \n _p(3, '<BufferSecurityCheck>false</BufferSecurityCheck>') \n end \n _p(3,'<FunctionLevelLinking>true< "
" /FunctionLevelLinking>') \n if not cfg.flags.NoMultiProcessorCompilation and not cfg.flags.EnableMinimalRebuild then \n _p(3, '<MultiProcessorCompilation>true</MultiProcessorCompilation>') \n else \n _p(3, '<MultiProcessorCompilation>false</MultiProcessorCompilation>') \n end \n precompiled_header(cfg) \n if cfg.flags.PedanticWarnings then \n _p(3, '<WarningLevel>EnableAllWarnings</WarningLevel>') \n elseif cfg.flags.ExtraWarnings then \n _p(3, '<WarningLevel>Level4</WarningLevel>') \n elseif cfg.flags.MinimumWarnings then \n _p(3, '<WarningLevel>Level1</WarningLevel>') \n else \n _p(3 ,'<WarningLevel>Level3</WarningLevel>') \n end \n if cfg.flags.FatalWarnings then \n _p(3, '<TreatWarningAsError>true</TreatWarningAsError>') \n end \n exceptions(cfg) \n rtti(cfg) \n calling_convention(cfg) \n wchar_t_builtin(cfg) \n sse(cfg) \n floating_point(cfg) \n debug_info(cfg) \n if _ACTION:sub(3) == \" llvm \" then \n _p(3,'<SupportJustMyCode>false</SupportJustMyCode>') \n end \n if cfg.flags.Symbols \n and _ACTION:sub(3) ~= \" 2017 \" and _ACTION:sub(3) ~= \" llvm \" \n then \n _p(3, '< "
" ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>' \n , path.getbasename(cfg.buildtarget.name) \n ) \n end \n if cfg.flags.NoFramePointer then \n _p(3, '<OmitFramePointers>true</OmitFramePointers>') \n end \n if cfg.flags.UseFullPaths then \n _p(3, '<UseFullPaths>true</UseFullPaths>') \n end \n compile_language(cfg) \n forcedinclude_files(3,cfg); \n _p(2,'</ClCompile>') \n end \n local function event_hooks(cfg) \n if #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>') \n end \n if #cfg.prebuildcommands> 0 then \n _p(2,'<PreBuildEvent>') \n _p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prebuildcommands, \" \" , \" \" , \" \\ r \\ n \" ))) \n _p(2,'</PreBuildEvent>') \n end \n if #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>') \n end \n end \n local function additio "
" nal_options(indent,cfg) \n if #cfg.linkoptions > 0 then \n _p(indent,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>', \n table.concat(premake.esc(cfg.linkoptions), \" \" )) \n end \n end \n local function link_target_machine(index,cfg) \n local platforms = {x32 = 'MachineX86', x64 = 'MachineX64'} \n if platforms[cfg.platform] then \n _p(index,'<TargetMachine>%s</TargetMachine>', platforms[cfg.platform]) \n end \n end \n local function item_def_lib(prj, cfg) \n if cfg.kind == 'StaticLib' and cfg.platform ~= \" Xbox360 \" then \n _p(1,'<Lib>') \n _p(2,'<OutputFile>$(OutDir)%s</OutputFile>',cfg.buildtarget.name) \n additional_options(2,cfg) \n link_target_machine(2,cfg) \n if _ACTION:sub(3) == \" llvm \" and prj.name == \" portaudio \" then -- MSVC-LLVM needs special help \n _p(3,'<AdditionalDependencies>ksuser.lib;%%(AdditionalDependencies)</AdditionalDependencies>') \n end \n _p(1,'</Lib>') \n end \n end \n local function import_lib(cfg) \n if cfg.kind == \" SharedLib \" then \n local implibname = cfg.linktarget.fullpath \n _p(3,'<ImportLibrary>%s</Import "
" Library>',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \" \\ \\ \" .. path.getname(implibname), implibname)) \n end \n end \n local function hasmasmfiles(prj) \n local files = vc2010.getfilegroup(prj, \" MASM \" ) \n return #files > 0 \n end \n local function vs10_masm(prj, cfg) \n if hasmasmfiles(prj) then \n _p(2, '<MASM>') \n _p(3,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>' \n , table.concat(premake.esc(table.join(cfg.buildoptions, cfg.buildoptions_asm)), \" \" ) \n ) \n local includedirs = table.join(cfg.userincludedirs, cfg.includedirs) \n if #includedirs > 0 then \n _p(3, '<IncludePaths>%s;%%(IncludePaths)</IncludePaths>' \n , premake.esc(path.translate(table.concat(includedirs, \" ; \" ), ' \\ \\ ')) \n ) \n end \n local defines = table.join(cfg.defines) \n table.insertflat(defines, iif(premake.config.isdebugbuild(cfg), \" _DEBUG \" , {})) \n table.insert(defines, iif(cfg.platform == \" x64 \" , \" _WIN64 \" , \" _WIN32 \" )) \n table.insert(defines, iif(prj.kind == \" SharedLib \" , \" _EXPORT=EXPORT \" , \" _EXPORT= \" )) \n _p(3, '<PreprocessorDefinitions>% "
" s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>' \n , premake.esc(table.concat(defines, \" ; \" )) \n ) \n if cfg.flags.FatalWarnings then \n _p(3,'<TreatWarningsAsErrors>true</TreatWarningsAsErrors>') \n end \n if cfg.flags.MinimumWarnings then \n _p(3,'<WarningLevel>0</WarningLevel>') \n else \n _p(3,'<WarningLevel>3</WarningLevel>') \n end \n _p(2, '</MASM>') \n end \n end \n function vc2010.link(cfg) \n _p(2,'<Link>') \n _p(3,'<SubSystem>%s</SubSystem>', iif(cfg.kind == \" ConsoleApp \" , \" Console \" , \" Windows \" )) \n _p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', \n iif(cfg.flags.Symbols ~= nil, iif(_ACTION:sub(3) ~= \" llvm \" , \" true \" , \" DebugFull \" ), \" false \" ) \n ) \n if cfg.flags.Symbols \n and (_ACTION:sub(3) == \" 2017 \" or _ACTION:sub(3) == \" llvm \" ) \n then \n _p(3, '<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>' \n , path.getbasename(cfg.buildtarget.name) \n ) \n end \n if premake.config.isoptimizedbuild(cfg.flags) then \n _p(3,'<EnableCOMDATFolding>true</EnableCOMDATFolding>') \n _p(3,'<OptimizeReferences>true</O "
" ptimizeReferences>') \n end \n if cfg.kind ~= 'StaticLib' then \n vc2010.additionalDependencies(3,cfg) \n _p(3,'<OutputFile>$(OutDir)%s</OutputFile>', cfg.buildtarget.name) \n if #cfg.libdirs > 0 then \n _p(3,'<AdditionalLibraryDirectories>%s;%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>' \n , premake.esc(path.translate(table.concat(cfg.libdirs, ';'), ' \\ \\ ')) \n ) \n end \n if vc2010.config_type(cfg) == 'Application' and not cfg.flags.WinMain and not cfg.flags.Managed then \n if cfg.flags.Unicode then \n _p(3,'<EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>') \n else \n _p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>') \n end \n end \n import_lib(cfg) \n local deffile = premake.findfile(cfg, \" .def \" ) \n if deffile then \n _p(3,'<ModuleDefinitionFile>%s</ModuleDefinitionFile>', deffile) \n end \n link_target_machine(3,cfg) \n additional_options(3,cfg) \n if cfg.flags.NoWinMD and vstudio.iswinrt() and prj.kind == \" WindowedApp \" then \n _p(3,'<GenerateWindowsMetadata>false</GenerateWindowsMetadata>' ) \n end \n end \n _p(2,'</Link>' "
" ) \n end \n function vc2010.additionalDependencies(tab,cfg) \n local links = premake.getlinks(cfg, \" system \" , \" fullpath \" ) \n if #links > 0 then \n local deps = \" \" \n if cfg.platform == \" Orbis \" then \n for _, v in ipairs(links) do \n deps = deps .. \" -l \" .. v .. \" ; \" \n end \n else \n deps = table.concat(links, \" ; \" ) \n end \n _p(tab, '<AdditionalDependencies>%s;%s</AdditionalDependencies>' \n , deps \n , iif(cfg.platform == \" Durango \" \n , '%(XboxExtensionsDependencies)' \n , '%(AdditionalDependencies)' \n ) \n ) \n elseif cfg.platform == \" Durango \" then \n _p(tab, '<AdditionalDependencies>%%(XboxExtensionsDependencies)</AdditionalDependencies>') \n end \n end \n local function item_definitions(prj) \n for _, cfginfo in ipairs(prj.solution.vstudio_configs) do \n local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) \n _p(1,'<ItemDefinitionGroup ' ..if_config_and_platform() ..'>' \n ,premake.esc(cfginfo.name)) \n vs10_clcompile(cfg) \n resource_compile(cfg) \n item_def_lib(prj, cfg) \n vc2010.link(cfg) \n event_hooks(cfg) \n vs10_masm(prj, c "
" fg) \n _p(1,'</ItemDefinitionGroup>') \n end \n end \n function vc2010.getfilegroup(prj, group) \n local sortedfiles = prj.vc2010sortedfiles \n if not sortedfiles then \n sortedfiles = { \n ClCompile = {}, \n ClInclude = {}, \n MASM = {}, \n None = {}, \n ResourceCompile = {}, \n AppxManifest = {}, \n Natvis = {}, \n Image = {}, \n DeploymentContent = {} \n } \n local foundAppxManifest = false \n for file in premake.project.eachfile(prj, true) do \n if path.issourcefilevs(file.name) then \n table.insert(sortedfiles.ClCompile, file) \n elseif path.iscppheader(file.name) then \n if not table.icontains(prj.removefiles, file) then \n table.insert(sortedfiles.ClInclude, file) \n end \n elseif path.isresourcefile(file.name) then \n table.insert(sortedfiles.ResourceCompile, file) \n elseif path.isimagefile(file.name) then \n table.insert(sortedfiles.Image, file) \n elseif path.isappxmanifest(file.name) then \n foundAppxManifest = true \n table.insert(sortedfiles.AppxManifest, file) \n elseif path.isnatvis(file.name) then \n table.insert(sortedfiles.Natvis, file) \n elseif path.isasmfil "
" e(file.name) then \n table.insert(sortedfiles.MASM, file) \n elseif file.flags and table.icontains(file.flags, \" DeploymentContent \" ) then \n table.insert(sortedfiles.DeploymentContent, file) \n else \n table.insert(sortedfiles.None, file) \n end \n end \n if vstudio.iswinrt() and prj.kind == \" WindowedApp \" and not foundAppxManifest then \n vstudio.needAppxManifest = true \n local fcfg = {} \n fcfg.name = prj.name .. \" /Package.appxmanifest \" \n fcfg.vpath = premake.project.getvpath(prj, fcfg.name) \n table.insert(sortedfiles.AppxManifest, fcfg) \n local logo = {} \n logo.name = prj.name .. \" /Logo.png \" \n logo.vpath = logo.name \n table.insert(sortedfiles.Image, logo) \n local smallLogo = {} \n smallLogo.name = prj.name .. \" /SmallLogo.png \" \n smallLogo.vpath = smallLogo.name \n table.insert(sortedfiles.Image, smallLogo) \n local storeLogo = {} \n storeLogo.name = prj.name .. \" /StoreLogo.png \" \n storeLogo.vpath = storeLogo.name \n table.insert(sortedfiles.Image, storeLogo) \n local splashScreen = {} \n splashScreen.name = prj.name .. \" /SplashScreen.png "
" \" \n splashScreen.vpath = splashScreen.name \n table.insert(sortedfiles.Image, splashScreen) \n end \n prj.vc2010sortedfiles = sortedfiles \n end \n return sortedfiles[group] \n end \n function vc2010.files(prj) \n vc2010.simplefilesgroup(prj, \" ClInclude \" ) \n vc2010.compilerfilesgroup(prj) \n vc2010.simplefilesgroup(prj, \" None \" ) \n vc2010.customtaskgroup(prj) \n vc2010.simplefilesgroup(prj, \" ResourceCompile \" ) \n vc2010.simplefilesgroup(prj, \" AppxManifest \" ) \n vc2010.simplefilesgroup(prj, \" Natvis \" ) \n vc2010.deploymentcontentgroup(prj, \" Image \" ) \n vc2010.deploymentcontentgroup(prj, \" DeploymentContent \" , \" None \" ) \n end \n function vc2010.customtaskgroup(prj) \n local files = { } \n for _, custombuildtask in ipairs(prj.custombuildtask or {}) do \n for _, buildtask in ipairs(custombuildtask or {}) do \n local fcfg = { } \n fcfg.name = path.getrelative(prj.location,buildtask[1]) \n fcfg.vpath = path.trimdots(fcfg.name) \n table.insert(files, fcfg) \n end \n end \n if #files > 0 then \n _p(1,'<ItemGroup>') \n local groupedBuildTasks = {} \n for _, custombuildtas "
" k in ipairs(prj.custombuildtask or {}) do \n for _, buildtask in ipairs(custombuildtask or {}) do \n if (groupedBuildTasks[buildtask[1]] == nil) then \n groupedBuildTasks[buildtask[1]] = {} \n end \n table.insert(groupedBuildTasks[buildtask[1]], buildtask) \n end \n end \n for name, custombuildtask in pairs(groupedBuildTasks or {}) do \n _p(2,'<CustomBuild Include= \\ \" %s \\ \" >', path.translate(path.getrelative(prj.location,name), \" \\ \\ \" )) \n _p(3,'<FileType>Text</FileType>') \n local cmd = \" \" \n local outputs = \" \" \n for _, buildtask in ipairs(custombuildtask or {}) do \n for _, cmdline in ipairs(buildtask[4] or {}) do \n cmd = cmd .. cmdline \n local num = 1 \n for _, depdata in ipairs(buildtask[3] or {}) do \n cmd = string.gsub(cmd, \" %$%( \" .. num .. \" %) \" , string.format( \" %s \" ,path.getrelative(prj.location,depdata))) \n num = num + 1 \n end \n cmd = string.gsub(cmd, \" %$%(<%) \" , string.format( \" %s \" ,path.getrelative(prj.location,buildtask[1]))) \n cmd = string.gsub(cmd, \" %$%(@%) \" , string.format( \" %s \" ,path.getrelative(prj.location,buildtask "
" [2]))) \n cmd = cmd .. \" \\ r \\ n \" \n end \n outputs = outputs .. path.getrelative(prj.location,buildtask[2]) .. \" ; \" \n end \n _p(3,'<Command>%s</Command>',cmd) \n _p(3,'<Outputs>%s%%(Outputs)</Outputs>',outputs) \n _p(3,'<SubType>Designer</SubType>') \n _p(3,'<Message></Message>') \n _p(2,'</CustomBuild>') \n end \n _p(1,'</ItemGroup>') \n end \n end \n function vc2010.simplefilesgroup(prj, section, subtype) \n local files = vc2010.getfilegroup(prj, section) \n if #files > 0 then \n _p(1,'<ItemGroup>') \n for _, file in ipairs(files) do \n if subtype then \n _p(2,'<%s Include= \\ \" %s \\ \" >', section, path.translate(file.name, \" \\ \\ \" )) \n _p(3,'<SubType>%s</SubType>', subtype) \n _p(2,'</%s>', section) \n else \n _p(2,'<%s Include= \\ \" %s \\ \" />', section, path.translate(file.name, \" \\ \\ \" )) \n end \n end \n _p(1,'</ItemGroup>') \n end \n end \n function vc2010.deploymentcontentgroup(prj, section, filetype) \n if filetype == nil then \n filetype = section \n end \n local files = vc2010.getfilegroup(prj, section) \n if #files > 0 then \n _p(1,'<ItemGroup>') \n for _, file in ipair "
" s(files) do \n _p(2,'<%s Include= \\ \" %s \\ \" >', filetype, path.translate(file.name, \" \\ \\ \" )) \n _p(3,'<DeploymentContent>true</DeploymentContent>') \n _p(3,'<Link>%s</Link>', path.translate(file.vpath, \" \\ \\ \" )) \n _p(2,'</%s>', filetype) \n end \n _p(1,'</ItemGroup>') \n end \n end \n function vc2010.compilerfilesgroup(prj) \n local configs = prj.solution.vstudio_configs \n local files = vc2010.getfilegroup(prj, \" ClCompile \" ) \n if #files > 0 then \n local config_mappings = {} \n for _, cfginfo in ipairs(configs) do \n local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) \n if cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then \n config_mappings[cfginfo] = path.translate(cfg.pchsource, \" \\ \\ \" ) \n end \n end \n _p(1,'<ItemGroup>') \n for _, file in ipairs(files) do \n local translatedpath = path.translate(file.name, \" \\ \\ \" ) \n _p(2, '<ClCompile Include= \\ \" %s \\ \" >', translatedpath) \n _p(3, '<ObjectFileName>$(IntDir)%s \\ \\ </ObjectFileName>' \n , premake.esc(path.translate(path.trimdots(path.getdirectory(file.name))) "
" ) \n ) \n if path.iscxfile(file.name) then \n _p(3, '<CompileAsWinRT>true</CompileAsWinRT>') \n _p(3, '<RuntimeTypeInfo>true</RuntimeTypeInfo>') \n _p(3, '<PrecompiledHeader>NotUsing</PrecompiledHeader>') \n end \n if vstudio.iswinrt() and string.len(file.name) > 2 and string.sub(file.name, -2) == \" .c \" then \n _p(3,'<CompileAsWinRT>FALSE</CompileAsWinRT>') \n end \n for _, cfginfo in ipairs(configs) do \n if config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then \n _p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>', premake.esc(cfginfo.name)) \n config_mappings[cfginfo] = nil --only one source file per pch \n end \n end \n local nopch = table.icontains(prj.nopch, file.name) \n for _, vsconfig in ipairs(configs) do \n local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform) \n if nopch or table.icontains(cfg.nopch, file.name) then \n _p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>NotUsing</PrecompiledHeader>', premake.esc(vsconfig.name)) \n end \n end \n local "
" excluded = table.icontains(prj.excludes, file.name) \n for _, vsconfig in ipairs(configs) do \n local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform) \n local fileincfg = table.icontains(cfg.files, file.name) \n local cfgexcluded = table.icontains(cfg.excludes, file.name) \n if excluded or not fileincfg or cfgexcluded then \n _p(3, '<ExcludedFromBuild ' \n .. if_config_and_platform() \n .. '>true</ExcludedFromBuild>' \n , premake.esc(vsconfig.name) \n ) \n end \n end \n if prj.flags and prj.flags.Managed then \n local prjforcenative = table.icontains(prj.forcenative, file.name) \n for _,vsconfig in ipairs(configs) do \n local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform) \n if prjforcenative or table.icontains(cfg.forcenative, file.name) then \n _p(3, '<CompileAsManaged ' .. if_config_and_platform() .. '>false</CompileAsManaged>', premake.esc(vsconfig.name)) \n end \n end \n end \n _p(2,'</ClCompile>') \n end \n _p(1,'</ItemGroup>') \n end \n end \n function vc2010.masmfiles(prj) \n local configs = prj.solutio "
" n.vstudio_configs \n local files = vc2010.getfilegroup(prj, \" MASM \" ) \n if #files > 0 then \n _p(1, '<ItemGroup>') \n for _, file in ipairs(files) do \n local translatedpath = path.translate(file.name, \" \\ \\ \" ) \n _p(2, '<MASM Include= \" %s \" >', translatedpath) \n local excluded = table.icontains(prj.excludes, file.name) \n for _, vsconfig in ipairs(configs) do \n local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform) \n local fileincfg = table.icontains(cfg.files, file.name) \n local cfgexcluded = table.icontains(cfg.excludes, file.name) \n if excluded or not fileincfg or cfgexcluded then \n _p(3, '<ExcludedFromBuild ' \n .. if_config_and_platform() \n .. '>true</ExcludedFromBuild>' \n , premake.esc(vsconfig.name) \n ) \n end \n end \n _p(2, '</MASM>') \n end \n _p(1, '</ItemGroup>') \n end \n end \n function vc2010.header(targets) \n io.eol = \" \\ r \\ n \" \n _p('<?xml version= \" 1.0 \" encoding= \" utf-8 \" ?>') \n local t = \" \" \n if targets then \n t = ' DefaultTargets= \" ' .. targets .. ' \" ' \n end \n _p('<Project%s ToolsVersion= \" %s \" xmlns= \" http: "
" //schemas.microsoft.com/developer/msbuild/2003 \" >', t, action.vstudio.toolsVersion) \n end \n function premake.vs2010_vcxproj(prj) \n local usemasm = hasmasmfiles(prj) \n io.indent = \" \" \n vc2010.header( \" Build \" ) \n vs2010_config(prj) \n vs2010_globals(prj) \n _p(1,'<Import Project= \" $(VCTargetsPath) \\ \\ Microsoft.Cpp.Default.props \" />') \n for _, cfginfo in ipairs(prj.solution.vstudio_configs) do \n local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) \n vc2010.configurationPropertyGroup(cfg, cfginfo) \n end \n _p(1,'<Import Project= \" $(VCTargetsPath) \\ \\ Microsoft.Cpp.props \" />') \n _p(1,'<ImportGroup Label= \" ExtensionSettings \" >') \n if usemasm then \n _p(2, '<Import Project= \" $(VCTargetsPath) \\ \\ BuildCustomizations \\ \\ masm.props \" />') \n end \n _p(1,'</ImportGroup>') \n import_props(prj) \n _p(1,'<PropertyGroup Label= \" UserMacros \" />') \n vc2010.outputProperties(prj) \n item_definitions(prj) \n if prj.flags.Managed then \n vc2010.clrReferences(prj) \n end \n vc2010.files(prj) \n vc2010.projectReferences(prj) \n vc2010.sdkReferen "
" ces(prj) \n vc2010.masmfiles(prj) \n _p(1,'<Import Project= \" $(VCTargetsPath) \\ \\ Microsoft.Cpp.targets \" />') \n _p(1,'<ImportGroup Label= \" ExtensionTargets \" >') \n if usemasm then \n _p(2, '<Import Project= \" $(VCTargetsPath) \\ \\ BuildCustomizations \\ \\ masm.targets \" />') \n end \n _p(1,'</ImportGroup>') \n _p('</Project>') \n end \n function vc2010.clrReferences(prj) \n if #prj.clrreferences == 0 then \n return \n end \n _p(1,'<ItemGroup>') \n for _, ref in ipairs(prj.clrreferences) do \n if os.isfile(ref) then \n local assembly = path.getbasename(ref) \n _p(2,'<Reference Include= \" %s \" >', assembly) \n _p(3,'<HintPath>%s</HintPath>', path.getrelative(prj.location, ref)) \n _p(2,'</Reference>') \n else \n _p(2,'<Reference Include= \" %s \" />', ref) \n end \n end \n _p(1,'</ItemGroup>') \n end \n function vc2010.projectReferences(prj) \n local deps = premake.getdependencies(prj) \n if #deps == 0 and #prj.vsimportreferences == 0 then \n return \n end \n _p(1,'<ItemGroup>') \n for _, dep in ipairs(deps) do \n local deppath = path.getrelative(prj.location, vstudio.projectfile(dep)) \n "
" _p(2,'<ProjectReference Include= \\ \" %s \\ \" >', path.translate(deppath, \" \\ \\ \" )) \n _p(3,'<Project>{%s}</Project>', dep.uuid) \n if vstudio.iswinrt() then \n _p(3,'<ReferenceOutputAssembly>false</ReferenceOutputAssembly>') \n end \n _p(2,'</ProjectReference>') \n end \n for _, ref in ipairs(prj.vsimportreferences) do \n local iprj = premake.vstudio.getimportprj(ref, prj.solution) \n _p(2,'<ProjectReference Include= \\ \" %s \\ \" >', iprj.relpath) \n _p(3,'<Project>{%s}</Project>', iprj.uuid) \n _p(2,'</ProjectReference>') \n end \n _p(1,'</ItemGroup>') \n end \n function vc2010.sdkReferences(prj) \n local refs = prj.sdkreferences \n if #refs > 0 then \n _p(1,'<ItemGroup>') \n for _, ref in ipairs(refs) do \n _p(2,'<SDKReference Include= \\ \" %s \\ \" />', ref) \n end \n _p(1,'</ItemGroup>') \n end \n end \n function vc2010.debugdir(cfg) \n local debuggerFlavor = \n iif(cfg.platform == \" Orbis \" , 'ORBISDebugger' \n , iif(cfg.platform == \" Durango \" , 'XboxOneVCppDebugger' \n , 'WindowsLocalDebugger' \n )) \n _p(2, '<DebuggerFlavor>%s</DebuggerFlav "
" or>', debuggerFlavor) \n if cfg.debugdir and not vstudio.iswinrt() then \n _p(2, '<LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDirectory>' \n , path.translate(cfg.debugdir, ' \\ \\ ') \n ) \n end \n if cfg.debugargs then \n _p(2, '<LocalDebuggerCommandArguments>%s</LocalDebuggerCommandArguments>' \n , table.concat(cfg.debugargs, \" \" ) \n ) \n end \n if cfg.debugenvs and #cfg.debugenvs > 0 then \n _p(2, '<LocalDebuggerEnvironment>%s%s</LocalDebuggerEnvironment>' \n , table.concat(cfg.debugenvs, \" \\ n \" ) \n , iif(cfg.flags.DebugEnvsInherit,' \\ n$(LocalDebuggerEnvironment)', '') \n ) \n if cfg.flags.DebugEnvsDontMerge then \n _p(2, '<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>') \n end \n end \n if cfg.deploymode then \n _p(' <DeployMode>%s</DeployMode>', cfg.deploymode) \n end \n end \n function premake.vs2010_vcxproj_user(prj) \n io.indent = \" \" \n vc2010.header() \n for _, cfginfo in ipairs(prj.solution.vstudio_configs) do \n local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) \n _p(' <PropertyGroup '.. "
" if_config_and_platform() ..'>', premake.esc(cfginfo.name)) \n vc2010.debugdir(cfg) \n _p(' </PropertyGroup>') \n end \n _p('</Project>') \n end \n local png1x1data = { \n 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, -- .PNG........IHDR \n 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xdb, 0x56, -- .............%.V \n 0xca, 0x00, 0x00, 0x00, 0x03, 0x50, 0x4c, 0x54, 0x45, 0x00, 0x00, 0x00, 0xa7, 0x7a, 0x3d, 0xda, -- .....PLTE....z=. \n 0x00, 0x00, 0x00, 0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00, 0x00, -- ....tRNS.@..f... \n 0x0a, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0xe2, -- .IDAT..c`....... \n 0x21, 0xbc, 0x33, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, -- !.3....IEND.B`. \n } \n function png1x1(obj, filename) \n filename = premake.project.getfilename(obj, filename) \n local f, err = io.open(filename, \" wb \" ) \n if f then \n for _, byte in ipairs( "
" png1x1data) do \n f:write(string.char(byte)) \n end \n f:close() \n end \n end \n function premake.vs2010_appxmanifest(prj) \n io.indent = \" \" \n io.eol = \" \\ r \\ n \" \n _p('<?xml version= \" 1.0 \" encoding= \" utf-8 \" ?>') \n if vstudio.toolset == \" v120_wp81 \" then \n _p('<Package xmlns= \" http://schemas.microsoft.com/appx/2010/manifest \" xmlns:m2= \" http://schemas.microsoft.com/appx/2013/manifest \" xmlns:m3= \" http://schemas.microsoft.com/appx/2014/manifest \" xmlns:mp= \" http://schemas.microsoft.com/appx/2014/phone/manifest \" >') \n elseif vstudio.storeapp == \" 8.1 \" then \n _p('<Package xmlns= \" http://schemas.microsoft.com/appx/2010/manifest \" xmlns:m3= \" http://schemas.microsoft.com/appx/2013/manifest \" >') \n elseif vstudio.storeapp == \" durango \" then \n _p('<Package xmlns= \" http://schemas.microsoft.com/appx/2010/manifest \" xmlns:mx= \" http://schemas.microsoft.com/appx/2013/xbox/manifest \" IgnorableNamespaces= \" mx \" >') \n else \n _p('<Package xmlns= \" http://schemas.microsoft.com/appx/manifest/foundation/windows10 \" xmlns:mp= \" http://schemas.micros "
" oft.com/appx/2014/phone/manifest \" xmlns:m3= \" http://schemas.microsoft.com/appx/manifest/uap/windows10 \" >') \n end \n _p(1,'<Identity Name= \" ' .. prj.uuid .. ' \" ') \n _p(2,'Publisher= \" CN=Publisher \" ') \n _p(2,'Version= \" 1.0.0.0 \" />') \n if vstudio.toolset == \" v120_wp81 \" or vstudio.storeapp == \" 8.2 \" then \n _p(1,'<mp:PhoneIdentity PhoneProductId= \" ' .. prj.uuid .. ' \" PhonePublisherId= \" 00000000-0000-0000-0000-000000000000 \" />') \n end \n _p(1, '<Properties>') \n _p(2, '<DisplayName>' .. prj.name .. '</DisplayName>') \n _p(2, '<PublisherDisplayName>PublisherDisplayName</PublisherDisplayName>') \n _p(2, '<Logo>' .. prj.name .. ' \\ \\ StoreLogo.png</Logo>') \n png1x1(prj, \" %%/StoreLogo.png \" ) \n _p(2, '<Description>' .. prj.name .. '</Description>') \n _p(1,'</Properties>') \n if vstudio.storeapp == \" 8.2 \" then \n _p(1, '<Dependencies>') \n _p(2, '<TargetDeviceFamily Name= \" Windows.Universal \" MinVersion= \" 10.0.10069.0 \" MaxVersionTested= \" 10.0.10069.0 \" />') \n _p(1, '</Dependencies>') \n elseif vstudio.storeapp == \" durango \" then \n _p(1, '<Pr "
" erequisites>') \n _p(2, '<OSMinVersion>6.2</OSMinVersion>') \n _p(2, '<OSMaxVersionTested>6.2</OSMaxVersionTested>') \n _p(1, '</Prerequisites>') \n else \n _p(1, '<Prerequisites>') \n _p(2, '<OSMinVersion>6.3.0</OSMinVersion>') \n _p(2, '<OSMaxVersionTested>6.3.0</OSMaxVersionTested>') \n _p(1, '</Prerequisites>') \n end \n _p(1,'<Resources>') \n _p(2,'<Resource Language= \" en-us \" />') \n _p(1,'</Resources>') \n _p(1,'<Applications>') \n _p(2,'<Application Id= \" App \" ') \n _p(3,'Executable= \" $targetnametoken$.exe \" ') \n _p(3,'EntryPoint= \" ' .. prj.name .. '.App \" >') \n if vstudio.storeapp == \" durango \" then \n _p(3, '<VisualElements') \n _p(4, 'DisplayName= \" ' .. prj.name .. ' \" ') \n _p(4, 'Logo= \" ' .. prj.name .. ' \\ \\ Logo.png \" ') \n png1x1(prj, \" %%/Logo.png \" ) \n _p(4, 'SmallLogo= \" ' .. prj.name .. ' \\ \\ SmallLogo.png \" ') \n png1x1(prj, \" %%/SmallLogo.png \" ) \n _p(4, 'Description= \" ' .. prj.name .. ' \" ') \n _p(4, 'ForegroundText= \" light \" ') \n _p(4, 'BackgroundColor= \" transparent \" >') \n _p(5, '<SplashScreen Image= \" ' .. prj.name .. ' \\ \\ SplashScreen.png \" />') "
" \n png1x1(prj, \" %%/SplashScreen.png \" ) \n _p(3, '</VisualElements>') \n _p(3, '<Extensions>') \n _p(4, '<mx:Extension Category= \" xbox.system.resources \" >') \n _p(4, '<mx:XboxSystemResources />') \n _p(4, '</mx:Extension>') \n _p(3, '</Extensions>') \n else \n _p(3, '<m3:VisualElements') \n _p(4, 'DisplayName= \" ' .. prj.name .. ' \" ') \n _p(4, 'Square150x150Logo= \" ' .. prj.name .. ' \\ \\ Logo.png \" ') \n png1x1(prj, \" %%/Logo.png \" ) \n if vstudio.toolset == \" v120_wp81 \" or vstudio.storeapp == \" 8.2 \" then \n _p(4, 'Square44x44Logo= \" ' .. prj.name .. ' \\ \\ SmallLogo.png \" ') \n png1x1(prj, \" %%/SmallLogo.png \" ) \n else \n _p(4, 'Square30x30Logo= \" ' .. prj.name .. ' \\ \\ SmallLogo.png \" ') \n png1x1(prj, \" %%/SmallLogo.png \" ) \n end \n _p(4, 'Description= \" ' .. prj.name .. ' \" ') \n _p(4, 'ForegroundText= \" light \" ') \n _p(4, 'BackgroundColor= \" transparent \" >') \n _p(4, '<m3:SplashScreen Image= \" ' .. prj.name .. ' \\ \\ SplashScreen.png \" />') \n png1x1(prj, \" %%/SplashScreen.png \" ) \n _p(3, '</m3:VisualElements>') \n end \n _p(2,'</Application>') \n _p(1,'</Applications>') \n _p( "
" '</Package>') \n end \n " ,
/* actions/vstudio/vstudio_vcxproj_filters.lua */
" local vc2010 = premake.vstudio.vc2010 \n local project = premake.project \n function vc2010.filteridgroup(prj) \n local filters = { } \n local filterfound = false \n for file in premake.project.eachfile(prj, true) do \n local folders = string.explode(file.vpath, \" / \" , true) \n local path = \" \" \n for i = 1, #folders - 1 do \n if not filterfound then \n filterfound = true \n _p(1,'<ItemGroup>') \n end \n path = path .. folders[i] \n if not filters[path] then \n filters[path] = true \n _p(2, '<Filter Include= \" %s \" >', path) \n _p(3, '<UniqueIdentifier>{%s}</UniqueIdentifier>', os.uuid(path)) \n _p(2, '</Filter>') \n end \n path = path .. \" \\ \\ \" \n end \n end \n for _, custombuildtask in ipairs(prj.custombuildtask or {}) do \n for _, buildtask in ipairs(custombuildtask or {}) do \n local folders = string.explode(path.trimdots(path.getrelative(prj.location,buildtask[1])), \" / \" , true) \n local path = \" \" \n for i = 1, #folders - 1 do \n if not filterfound then \n filterfound = true \n _p(1,'<ItemGroup>') \n end \n path = path .. folders[i] \n if not filters[path] then \n filt "
@ -337,6 +338,10 @@ const char* builtin_scripts[] = {
" premake.vstudio.vc2017 = {} \n local vc2017 = premake.vstudio.vc2017 \n local vstudio = premake.vstudio \n newaction \n { \n trigger = \" vs2017 \" , \n shortname = \" Visual Studio 2017 \" , \n description = \" Generate Microsoft Visual Studio 2017 project files \" , \n os = \" windows \" , \n valid_kinds = { \" ConsoleApp \" , \" WindowedApp \" , \" StaticLib \" , \" SharedLib \" , \" Bundle \" }, \n valid_languages = { \" C \" , \" C++ \" , \" C# \" }, \n valid_tools = { \n cc = { \" msc \" }, \n dotnet = { \" msnet \" }, \n }, \n onsolution = function(sln) \n premake.generate(sln, \" %%.sln \" , vstudio.sln2005.generate) \n end, \n onproject = function(prj) \n if premake.isdotnetproject(prj) then \n premake.generate(prj, \" %%.csproj \" , vstudio.cs2005.generate) \n premake.generate(prj, \" %%.csproj.user \" , vstudio.cs2005.generate_user) \n else \n premake.vstudio.needAppxManifest = false \n premake.generate(prj, \" %%.vcxproj \" , premake.vs2010_vcxproj) \n premake.generate(prj, \" %%.vcxproj.user \" , premake.vs2010_vcxproj_user) \n premake.generate(prj, \" %%.v "
" cxproj.filters \" , vstudio.vc2010.generate_filters) \n if premake.vstudio.needAppxManifest then \n premake.generate(prj, \" %%/Package.appxmanifest \" , premake.vs2010_appxmanifest) \n end \n end \n end, \n oncleansolution = premake.vstudio.cleansolution, \n oncleanproject = premake.vstudio.cleanproject, \n oncleantarget = premake.vstudio.cleantarget, \n vstudio = { \n solutionVersion = \" 12 \" , \n targetFramework = \" 4.5.2 \" , \n toolsVersion = \" 15.0 \" , \n windowsTargetPlatformVersion = \" 8.1 \" , \n supports64bitEditContinue = true, \n intDirAbsolute = true, \n } \n } \n " ,
/* actions/vstudio/vsllvm.lua */
" premake.vstudio.vcllvm = {} \n local vcllvm = premake.vstudio.vcllvm \n local vstudio = premake.vstudio \n newaction \n { \n trigger = \" vsllvm \" , \n shortname = \" Visual Studio LLVM \" , \n description = \" Generate Microsoft Visual Studio LLVM project files \" , \n os = \" windows \" , \n valid_kinds = { \" ConsoleApp \" , \" WindowedApp \" , \" StaticLib \" , \" SharedLib \" , \" Bundle \" }, \n valid_languages = { \" C \" , \" C++ \" , \" C# \" }, \n valid_tools = { \n cc = { \" msc \" }, \n dotnet = { \" msnet \" }, \n }, \n onsolution = function(sln) \n premake.generate(sln, \" %%.sln \" , vstudio.sln2005.generate) \n end, \n onproject = function(prj) \n if premake.isdotnetproject(prj) then \n premake.generate(prj, \" %%.csproj \" , vstudio.cs2005.generate) \n premake.generate(prj, \" %%.csproj.user \" , vstudio.cs2005.generate_user) \n else \n premake.vstudio.needAppxManifest = false \n premake.generate(prj, \" %%.vcxproj \" , premake.vs2010_vcxproj) \n premake.generate(prj, \" %%.vcxproj.user \" , premake.vs2010_vcxproj_user) \n premake.generate(prj, \" %%.v "
" cxproj.filters \" , vstudio.vc2010.generate_filters) \n if premake.vstudio.needAppxManifest then \n premake.generate(prj, \" %%/Package.appxmanifest \" , premake.vs2010_appxmanifest) \n end \n end \n end, \n oncleansolution = premake.vstudio.cleansolution, \n oncleanproject = premake.vstudio.cleanproject, \n oncleantarget = premake.vstudio.cleantarget, \n vstudio = { \n solutionVersion = \" 12 \" , \n targetFramework = \" 4.5.2 \" , \n toolsVersion = \" 15.0 \" , \n windowsTargetPlatformVersion = \" 8.1 \" , \n supports64bitEditContinue = true, \n intDirAbsolute = true, \n } \n } \n " ,
/* actions/xcode/_xcode.lua */
" premake.xcode = { } \n premake.xcode.xcode6 = { } \n local function checkproject(prj) \n local last \n for cfg in premake.eachconfig(prj) do \n if last and last ~= cfg.kind then \n error( \" Project ' \" .. prj.name .. \" ' uses more than one target kind; not supported by Xcode \" , 0) \n end \n last = cfg.kind \n end \n end \n premake.xcode.toolset = \" macosx \" \n newaction \n { \n trigger = \" xcode3 \" , \n shortname = \" Xcode 3 \" , \n description = \" Generate Apple Xcode 3 project files (experimental) \" , \n os = \" macosx \" , \n valid_kinds = { \" ConsoleApp \" , \" WindowedApp \" , \" StaticLib \" , \" SharedLib \" , \" Bundle \" }, \n valid_languages = { \" C \" , \" C++ \" }, \n valid_tools = { \n cc = { \" gcc \" }, \n }, \n valid_platforms = { \n Native = \" Native \" , \n x32 = \" Native 32-bit \" , \n x64 = \" Native 64-bit \" , \n Universal32 = \" 32-bit Universal \" , \n Universal64 = \" 64-bit Universal \" , \n Universal = \" Universal \" , \n }, \n default_platform = \" Universal \" , \n onsolution = function(sln) \n premake.xcode.preparesolution(sln) \n end, \n onproject = "
" function(prj) \n premake.generate(prj, \" %%.xcodeproj/project.pbxproj \" , premake.xcode.project) \n end, \n oncleanproject = function(prj) \n premake.clean.directory(prj, \" %%.xcodeproj \" ) \n end, \n oncheckproject = checkproject, \n } \n newaction \n { \n trigger = \" xcode4 \" , \n shortname = \" Xcode 4 \" , \n description = \" Generate Apple Xcode 4 project files (experimental) \" , \n os = \" macosx \" , \n valid_kinds = { \" ConsoleApp \" , \" WindowedApp \" , \" StaticLib \" , \" SharedLib \" , \" Bundle \" }, \n valid_languages = { \" C \" , \" C++ \" }, \n valid_tools = { \n cc = { \" gcc \" }, \n }, \n valid_platforms = { \n Native = \" Native \" , \n x32 = \" Native 32-bit \" , \n x64 = \" Native 64-bit \" , \n Universal32 = \" 32-bit Universal \" , \n Universal64 = \" 64-bit Universal \" , \n Universal = \" Universal \" , \n }, \n default_platform = \" Universal \" , \n onsolution = function(sln) \n premake.generate(sln, \" %%.xcworkspace/contents.xcworkspacedata \" , premake.xcode4.workspace_generate) \n end, \n onproject = function(prj) \n premake.generate(prj, \" %%.xcodepr "