/* 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 */ const char* builtin_scripts[] = { /* base/os.lua */ "function os.executef(n,...)n=string.format(n,unpack(arg))return os.execute(n)end\nlocal function i(n)local e,t\nlocal o={}local n=io.open(n)if n==nil then\nreturn o\nend\nfor n in n:lines()do\ne=n:find(\"#\",1,true)if e~=nil then\nn=n:sub(1,e-1)end\nif n~=\"\"then\ne,t=n:find(\"include%s+\")if e~=nil then\nlocal n=n:sub(t+1)local n=os.matchfiles(n)for e,n in ipairs(n)do\no=table.join(o,i(n))end\nelse\ntable.insert(o,n)end\nend\nend\nreturn o\nend\nfunction os.findlib(e)local n,o\nif os.is(\"windows\")then\no={\"%s.dll\",\"%s\"}n=os.getenv(\"PATH\")elseif os.is(\"haiku\")then\no={\"lib%s.so\",\"%s.so\"}n=os.getenv(\"LIBRARY_PATH\")else\nif os.is(\"macosx\")then\no={\"lib%s.dylib\",\"%s.dylib\"}n=os.getenv(\"DYLD_LIBRARY_PATH\")else\no={\"lib%s.so\",\"%s.so\"}n=os.getenv(\"LD_LIBRARY_PATH\")or\"\"for e,o in ipairs(i(\"/etc/ld.so.conf\"))do\nn=n..\":\"..o\nend\nend\ntable.insert(o,\"%s\")n=n or\"\"if os.is64bit()then\nn=n..\":/lib64:/usr/lib64/:usr/local/lib64\"end\nn=n..\":/lib:/usr/lib:/usr/local/lib\"end\nfor " "i,o in ipairs(o)do\nlocal o=string.format(o,e)local n=os.pathsearch(o,n)if n then return n end\nend\nend\nfunction os.get()return _OPTIONS.os or _OS\nend\nfunction os.is(n)return(os.get():lower()==n:lower())end\nlocal o={\"x86_64\",\"ia64\",\"amd64\",\"ppc64\",\"powerpc64\",\"sparc64\"}function os.is64bit()if(os._is64bit())then\nreturn true\nend\nlocal n\nif _OS==\"windows\"then\nn=os.getenv(\"PROCESSOR_ARCHITECTURE\")elseif _OS==\"macosx\"then\nn=os.outputof(\"echo $HOSTTYPE\")else\nn=os.outputof(\"uname -m\")end\nn=n:lower()for e,o in ipairs(o)do\nif n:find(o)then\nreturn true\nend\nend\nreturn false\nend\nlocal function l(l,n,i)if n:startswith(\"./\")then\nn=n:sub(3)end\nlocal e=n\nlocal o=n:find(\"%*\")if o then\ne=e:sub(1,o-1)end\ne=path.getdirectory(e)if(e==\".\")then e=\"\"end\nlocal a=n:find(\"**\",nil,true)n=path.wildcards(n)local function t(e)local s=path.join(e,\"*\")local o=os.matchstart(s)while(os.matchnext(o))do\nlocal t=os.matchisfile(o)if((i and t)or(not i and not t))then\nlocal i=os.matchname(" "o)local o=path.join(e,i)if i~=\"..\"and o:match(n)==o then\ntable.insert(l,o)end\nend\nend\nos.matchdone(o)if a then\no=os.matchstart(s)while(os.matchnext(o))do\nif not os.matchisfile(o)then\nlocal n=os.matchname(o)if(not n:startswith(\".\"))then\nt(path.join(e,n))end\nend\nend\nos.matchdone(o)end\nend\nt(e)end\nfunction os.matchdirs(...)local n={}for e,o in ipairs(arg)do\nl(n,o,false)end\nreturn n\nend\nfunction os.matchfiles(...)local n={}for e,o in ipairs(arg)do\nl(n,o,true)end\nreturn n\nend\nlocal e=os.mkdir\nfunction os.mkdir(o)local n=iif(o:startswith(\"/\"),\"/\",\"\")for o in o:gmatch(\"[^/]+\")do\nn=n..o\nif(o~=\"\"and not path.isabsolute(o)and not os.isdir(n))then\nlocal n,o=e(n)if(not n)then\nreturn nil,o\nend\nend\nn=n..\"/\"end\nreturn true\nend\nfunction os.outputof(n)local n=io.popen(n)local o=n:read('*a')n:close()return o\nend\nlocal e=os.rmdir\nfunction os.rmdir(n)local o=os.matchdirs(n..\"/*\")for o,n in ipairs(o)do\nos.rmdir(n)end\nlocal o=os.matchfiles(n..\"/*\")for o,n in ipairs(o)do\nos." "remove(n)end\ne(n)end", /* base/path.lua */ "function path.getbasename(e)local e=path.getname(e)local n=e:findlast(\".\",true)if(n)then\nreturn e:sub(1,n-1)else\nreturn e\nend\nend\nfunction path.getdirectory(n)local e=n:findlast(\"/\",true)if(e)then\nif e>1 then e=e-1 end\nreturn n:sub(1,e)else\nreturn\".\"end\nend\nfunction path.getdrive(e)local n=e:sub(1,1)local e=e:sub(2,2)if e==\":\"then\nreturn n\nend\nend\nfunction path.getextension(e)local n=e:findlast(\".\",true)if(n)then\nreturn e:sub(n)else\nreturn\"\"end\nend\nfunction path.getname(e)local n=e:findlast(\"[/\\\\]\")if(n)then\nreturn e:sub(n+1)else\nreturn e\nend\nend\nfunction path.iscfile(e)local n={\".c\",\".s\",\".m\"}local e=path.getextension(e):lower()return table.contains(n,e)end\nfunction path.iscppfile(e)local n={\".cc\",\".cpp\",\".cxx\",\".c\",\".s\",\".m\",\".mm\"}local e=path.getextension(e):lower()return table.contains(n,e)end\nfunction path.iscppheader(e)local n={\".h\",\".hh\",\".hpp\",\".hxx\"}local e=path.getextension(e):lower()return table.contains(n,e)end\nfunction path.isre" "sourcefile(e)local n={\".rc\"}local e=path.getextension(e):lower()return table.contains(n,e)end\nfunction path.rebase(e,t,n)e=path.getabsolute(path.join(t,e))e=path.getrelative(n,e)return e\nend\nlocal n=path.translate\nfunction path.translate(t,e)if not e then\nif os.is(\"windows\")then\ne=\"\\\\\"else\ne=\"/\"end\nend\nreturn n(t,e)end\nfunction path.wildcards(e)e=e:gsub(\"([%+%.%-%^%$%(%)%%])\",\"%%%1\")e=e:gsub(\"%*%*\",\"\\1\")e=e:gsub(\"%*\",\"\\2\")e=e:gsub(\"\\1\",\".*\")e=e:gsub(\"\\2\",\"[^/]*\")return e\nend", /* base/string.lua */ "function string.explode(e,i,r)if(i=='')then return false end\nlocal n=0\nlocal t={}for r,i in function()return e:find(i,n,r)end do\ntable.insert(t,e:sub(n,r-1))n=i+1\nend\ntable.insert(t,e:sub(n))return t\nend\nfunction string.findlast(i,e,t)local n=0\nrepeat\nlocal t=i:find(e,n+1,t)if(t)then n=t end\nuntil(not t)if(n>0)then\nreturn n\nend\nend\nfunction string.startswith(n,t)return(n:find(t,1,true)==1)end", /* base/table.lua */ "function table.contains(n,e)for t,n in pairs(n)do\nif(n==e)then\nreturn true\nend\nend\nreturn false\nend\nfunction table.extract(n,t)local e={}for i,n in ipairs(n)do\ntable.insert(e,n[t])end\nreturn e\nend\nfunction table.flatten(i)local n={}local function t(e)for i,e in ipairs(e)do\nif type(e)==\"table\"then\nt(e)else\ntable.insert(n,e)end\nend\nend\nt(i)return n\nend\nfunction table.implode(r,t,i,n)local e=\"\"for a,r in ipairs(r)do\nif(e~=\"\"and n)then\ne=e..n\nend\ne=e..t..r..i\nend\nreturn e\nend\nfunction table.insertflat(n,e)if type(e)==\"table\"then\nfor t,e in ipairs(e)do\ntable.insertflat(n,e)end\nelse\ntable.insert(n,e)end\nend\nfunction table.isempty(e)return next(e)==nil\nend\nfunction table.join(...)local e={}for t,n in ipairs(arg)do\nif type(n)==\"table\"then\nfor t,n in ipairs(n)do\ntable.insert(e,n)end\nelse\ntable.insert(e,n)end\nend\nreturn e\nend\nfunction table.keys(n)local e={}for n,t in pairs(n)do\ntable.insert(e,n)end\nreturn e\nend\nfunction table.merge(...)local n={}for t,e in ipair" "s(arg)do\nif type(e)==\"table\"then\nfor e,t in pairs(e)do\nn[e]=t\nend\nelse\nerror(\"invalid value\")end\nend\nreturn n\nend\nfunction table.translate(e,n)local i={}for e,t in ipairs(e)do\nlocal e\nif type(n)==\"function\"then\ne=n(t)else\ne=n[t]end\nif(e)then\ntable.insert(i,e)end\nend\nreturn i\nend", /* base/io.lua */ "function io.capture()io.captured=''end\nfunction io.endcapture()local e=io.captured\nio.captured=nil\nreturn e\nend\nlocal i=io.open\nfunction io.open(n,e)if(e)then\nif(e:find(\"w\"))then\nlocal e=path.getdirectory(n)ok,err=os.mkdir(e)if(not ok)then\nerror(err,0)end\nend\nend\nreturn i(n,e)end\nfunction io.printf(e,...)if not io.eol then\nio.eol=\"\\n\"end\nif not io.indent then\nio.indent=\"\\t\"end\nif type(e)==\"number\"then\ns=string.rep(io.indent,e)..string.format(unpack(arg))else\ns=string.format(e,unpack(arg))end\nif io.captured then\nio.captured=io.captured..s..io.eol\nelse\nio.write(s)io.write(io.eol)end\nend\n_p=io.printf", /* base/globals.lua */ "premake={}premake.platforms={Native={cfgsuffix=\"\",},x32={cfgsuffix=\"32\",},x64={cfgsuffix=\"64\",},Universal={cfgsuffix=\"univ\",},Universal32={cfgsuffix=\"univ32\",},Universal64={cfgsuffix=\"univ64\",},PS3={cfgsuffix=\"ps3\",iscrosscompiler=true,nosharedlibs=true,namestyle=\"PS3\",},WiiDev={cfgsuffix=\"wii\",iscrosscompiler=true,namestyle=\"PS3\",},Xbox360={cfgsuffix=\"xbox360\",iscrosscompiler=true,namestyle=\"windows\",},}local n=dofile\nfunction dofile(e)local f=os.getcwd()local t=_SCRIPT\nif(not os.isfile(e))then\nlocal i=os.pathsearch(e,_OPTIONS[\"scripts\"],os.getenv(\"PREMAKE_PATH\"))if(i)then\ne=i..\"/\"..e\nend\nend\n_SCRIPT=path.getabsolute(e)local e=path.getdirectory(_SCRIPT)os.chdir(e)local o,r,n,i,s,e=n(_SCRIPT)_SCRIPT=t\nos.chdir(f)return o,r,n,i,s,e\nend\nfunction iif(i,e,n)if(i)then\nreturn e\nelse\nreturn n\nend\nend\nfunction include(e)return dofile(e..\"/premake4.lua\")end\nfunction printf(e,...)print(string.format(e,unpack(arg)))end\nlocal n=type\nfunction type(i)local e=getmetatable(i)" "if(e)then\nif(e.__type)then\nreturn e.__type\nend\nend\nreturn n(i)end", /* base/action.lua */ "premake.action={}premake.action.list={}function premake.action.add(e)local n\nfor i,t in ipairs({\"description\",\"trigger\"})do\nif(not e[t])then\nn=t\nend\nend\nif(n)then\nerror(\"action needs a \"..n,3)end\npremake.action.list[e.trigger]=e\nend\nfunction premake.action.call(e)local e=premake.action.list[e]for n in premake.solution.each()do\nif e.onsolution then\ne.onsolution(n)end\nfor n in premake.solution.eachproject(n)do\nif e.onproject then\ne.onproject(n)end\nend\nend\nif e.execute then\ne.execute()end\nend\nfunction premake.action.current()return premake.action.get(_ACTION)end\nfunction premake.action.get(e)return premake.action.list[e]end\nfunction premake.action.each()local n={}for t,e in pairs(premake.action.list)do\ntable.insert(n,e.trigger)end\ntable.sort(n)local e=0\nreturn function()e=e+1\nreturn premake.action.list[n[e]]end\nend\nfunction premake.action.set(e)_ACTION=e\nlocal e=premake.action.get(e)if e then\n_OS=e.os or _OS\nend\nend\nfunction premake.action.supports(e,n)if not e then\nreturn" " false\nend\nif e.valid_languages then\nif table.contains(e.valid_languages,n)then\nreturn true\nend\nend\nif e.valid_kinds then\nif table.contains(e.valid_kinds,n)then\nreturn true\nend\nend\nreturn false\nend", /* base/option.lua */ "premake.option={}premake.option.list={}function premake.option.add(e)local n\nfor t,o in ipairs({\"description\",\"trigger\"})do\nif(not e[o])then\nn=o\nend\nend\nif(n)then\nerror(\"option needs a \"..n,3)end\npremake.option.list[e.trigger]=e\nend\nfunction premake.option.get(e)return premake.option.list[e]end\nfunction premake.option.each()local e={}for o,n in pairs(premake.option.list)do\ntable.insert(e,n.trigger)end\ntable.sort(e)local n=0\nreturn function()n=n+1\nreturn premake.option.list[e[n]]end\nend\nfunction premake.option.validate(e)for n,o in pairs(e)do\nlocal e=premake.option.get(n)if(not e)then\nreturn false,\"invalid option '\"..n..\"'\"end\nif(e.value and o==\"\")then\nreturn false,\"no value specified for option '\"..n..\"'\"end\nif e.allowed then\nlocal t=false\nfor n,e in ipairs(e.allowed)do\nif e[1]==o then\nt=true\nbreak\nend\nend\nif not t then\nreturn false,string.format(\"invalid value '%s' for option '%s'\",o,n)end\nend\nend\nreturn true\nend", /* base/tree.lua */ "premake.tree={}local t=premake.tree\nfunction premake.tree.new(e)local e={name=e,children={}}return e\nend\nfunction premake.tree.add(e,n,a)if n==\".\"then\nreturn e\nend\nlocal d=t.add(e,path.getdirectory(n),a)local r=path.getname(n)if r==\"..\"then\nreturn d\nend\nlocal e=d.children[r]if not e or e.path~=n then\ne=t.insert(d,t.new(r))e.path=n\nif a then\na(e)end\nend\nreturn e\nend\nfunction premake.tree.insert(n,e)table.insert(n.children,e)if e.name then\nn.children[e.name]=e\nend\ne.parent=n\nreturn e\nend\nfunction premake.tree.getlocalpath(e)if e.parent.path then\nreturn e.name\nelseif e.cfg then\nreturn e.cfg.name\nelse\nreturn e.path\nend\nend\nfunction premake.tree.remove(n)local e=n.parent.children\nfor t=1,#e do\nif e[t]==n then\ntable.remove(e,t)end\nend\nn.children={}end\nfunction premake.tree.sort(e)t.traverse(e,{onnode=function(e)table.sort(e.children,function(e,n)return e.name0 then\nif e.onbranchenter then\ne.onbranchenter(n,t)end\nif e.onbranch then\ne.onbranch(n,t)end\na(n,e,t+1)if e.onbranchexit then\ne.onbranchexit(n,t)end\nelse\nif e.onleaf then\ne.onleaf(n,t)end\nend\nend\na=function(n,a,r)local e=1\nwhile e<=#n.children do\nlocal t=n.children[e]d(t,a,r)if t==n.children[e]then\ne=e+1\nend\nend\nend\nif not r then\nr=0\nend\nif h then\nd(o,i,r)else\na(o,i,r)end\nend", /* base/solution.lua */ "premake.solution={}premake.solution.list={}function premake.solution.new(n)local e={}table.insert(premake.solution.list,e)premake.solution.list[n]=e\nsetmetatable(e,{__type=\"solution\"})e.name=n\ne.basedir=os.getcwd()e.projects={}e.blocks={}e.configurations={}return e\nend\nfunction premake.solution.each()local e=0\nreturn function()e=e+1\nif e<=#premake.solution.list then\nreturn premake.solution.list[e]end\nend\nend\nfunction premake.solution.eachproject(n)local e=0\nreturn function()e=e+1\nif(e<=#n.projects)then\nreturn premake.solution.getproject(n,e)end\nend\nend\nfunction premake.solution.get(e)return premake.solution.list[e]end\nfunction premake.solution.getproject(n,e)local e=n.projects[e]local n=premake.getconfig(e)n.name=e.name\nreturn n\nend", /* base/project.lua */ "premake.project={}function premake.project.buildsourcetree(e)local n=premake.tree.new(e.name)n.project=e\nlocal t\nlocal function a(e)e.isvpath=t\nend\nfor e in premake.project.eachfile(e)do\nt=(e.name~=e.vpath)local n=premake.tree.add(n,e.vpath,a)n.cfg=e\nend\npremake.tree.sort(n)return n\nend\nfunction premake.eachconfig(e,a)if e.project then e=e.project end\nlocal t=e.solution.configurations\nlocal n=0\nreturn function()n=n+1\nif n<=#t then\nreturn premake.getconfig(e,t[n],a)end\nend\nend\nfunction premake.project.eachfile(e)if not e.project then e=premake.getconfig(e)end\nlocal n=0\nlocal t=e.files\nreturn function()n=n+1\nif(n<=#t)then\nlocal n=e.__fileconfigs[t[n]]n.vpath=premake.project.getvpath(e,n.name)return n\nend\nend\nend\nfunction premake.esc(e)if(type(e)==\"table\")then\nlocal n={}for t,e in ipairs(e)do\ntable.insert(n,premake.esc(e))end\nreturn n\nelse\ne=e:gsub('&',\"&\")e=e:gsub('\"',\""\")e=e:gsub(\"'\",\"'\")e=e:gsub('<',\"<\")e=e:gsub('>',\">\")e=e:gsub('\\r',\" \"" ")e=e:gsub('\\n',\" \")return e\nend\nend\nfunction premake.filterplatforms(n,t,r)local e={}local a={}if n.platforms then\nfor r,n in ipairs(n.platforms)do\nif t[n]and not table.contains(a,t[n])then\ntable.insert(e,n)table.insert(a,t[n])end\nend\nend\nif#e==0 and r then\ntable.insert(e,r)end\nreturn e\nend\nfunction premake.findproject(n)for e in premake.solution.each()do\nfor e in premake.solution.eachproject(e)do\nif(e.name==n)then\nreturn e\nend\nend\nend\nend\nfunction premake.findfile(e,n)for t,e in ipairs(e.files)do\nif e:endswith(n)then return e end\nend\nend\nfunction premake.getconfig(e,t,n)e=e.project or e\nif n==\"Native\"or not table.contains(e.solution.platforms or{},n)then\nn=nil\nend\nlocal t=(t or\"\")if n then t=t..n end\nreturn e.__configs[t]end\nfunction premake.getconfigname(e,n,t)if e then\nlocal e=e\nif n and n~=\"Native\"then\nif t then\ne=e..premake.platforms[n].cfgsuffix\nelse\ne=e..\"|\"..n\nend\nend\nreturn iif(t,e:lower(),e)end\nend\nfunction premake.getdependencies(e)e=e.projec" "t or e\nlocal n={}for t,e in pairs(e.__configs)do\nfor t,e in ipairs(e.links)do\nlocal e=premake.findproject(e)if e and not table.contains(n,e)then\ntable.insert(n,e)end\nend\nend\nreturn n\nend\nfunction premake.project.getbasename(e,n)return n:gsub(\"%%%%\",e)end\nfunction premake.project.getfilename(n,e)local e=premake.project.getbasename(n.name,e)e=path.join(n.location,e)return path.getrelative(os.getcwd(),e)end\nfunction premake.getlinks(n,i,t)local l=iif(t==\"directory\"and i==\"all\",n.libdirs,{})local a=iif(n.name==n.project.name,\"\",n.name)local p=premake.getpathstyle(n)local d=premake.getnamestyle(n)local function c(n,e)if(e.kind~=\"SharedLib\"and e.kind~=\"StaticLib\")then\nreturn false\nend\nif premake.iscppproject(n)then\nreturn premake.iscppproject(e)elseif premake.isdotnetproject(n)then\nreturn premake.isdotnetproject(e)end\nend\nfor e,r in ipairs(n.links)do\nlocal e\nlocal o=premake.findproject(r)if o and i~=\"system\"then\nlocal a=premake.getconfig(o,a,n.platform)if i==\"dependencies\"or c(n," "a)then\nif(t==\"directory\")then\ne=path.rebase(a.linktarget.directory,a.location,n.location)elseif(t==\"basename\")then\ne=a.linktarget.basename\nelseif(t==\"fullpath\")then\ne=path.rebase(a.linktarget.fullpath,a.location,n.location)elseif(t==\"object\")then\ne=a\nend\nend\nelseif not o and(i==\"system\"or i==\"all\")then\nif(t==\"directory\")then\ne=path.getdirectory(r)elseif(t==\"fullpath\")then\ne=r\nif d==\"windows\"then\nif premake.iscppproject(n)then\ne=e..\".lib\"elseif premake.isdotnetproject(n)then\ne=e..\".dll\"end\nend\nelseif t==\"name\"then\ne=path.getname(r)elseif t==\"basename\"then\ne=path.getbasename(r)else\ne=r\nend\nif e:find(\"/\",nil,true)then\ne=path.getrelative(n.project.location,e)end\nend\nif e then\nif p==\"windows\"and t~=\"object\"then\ne=path.translate(e,\"\\\\\")end\nif not table.contains(l,e)then\ntable.insert(l,e)end\nend\nend\nreturn l\nend\nfunction premake.getnamestyle(e)return premake.platforms[e.platform].namestyle or premake.gettool(e).namestyle or\"posix\"end\nfunction p" "remake.getpathstyle(e)if premake.action.current().os==\"windows\"then\nreturn\"windows\"else\nreturn\"posix\"end\nend\nfunction premake.gettarget(e,t,f,i,r)if r==\"bsd\"or r==\"solaris\"then\nr=\"linux\"end\nlocal n=e.kind\nif premake.iscppproject(e)then\nif(i==\"windows\"or r==\"windows\")and n==\"SharedLib\"and t==\"link\"and not e.flags.NoImportLib\nthen\nn=\"StaticLib\"end\nif i==\"posix\"and r==\"windows\"and n~=\"StaticLib\"then\ni=\"windows\"end\nend\nlocal o=\"build\"if t==\"link\"and e.kind==\"SharedLib\"then\no=\"implib\"end\nlocal c=e[o..\"name\"]or e.targetname or e.project.name\nlocal d=e[o..\"dir\"]or e.targetdir or path.getrelative(e.location,e.basedir)local a=\"\"local l=\"\"local t=\"\"local p,s\nif i==\"windows\"then\nif n==\"ConsoleApp\"or n==\"WindowedApp\"then\nt=\".exe\"elseif n==\"SharedLib\"then\nt=\".dll\"elseif n==\"StaticLib\"then\nt=\".lib\"end\nelseif i==\"posix\"then\nif n==\"WindowedApp\"and r==\"macosx\"then\ns=c..\".app\"p=path.join(d,s)d=path.join(p,\"Contents/MacOS\")elseif n" "==\"SharedLib\"then\na=\"lib\"t=iif(r==\"macosx\",\".dylib\",\".so\")elseif n==\"StaticLib\"then\na=\"lib\"t=\".a\"end\nelseif i==\"PS3\"then\nif n==\"ConsoleApp\"or n==\"WindowedApp\"then\nt=\".elf\"elseif n==\"StaticLib\"then\na=\"lib\"t=\".a\"end\nend\na=e[o..\"prefix\"]or e.targetprefix or a\nl=e[o..\"suffix\"]or e.targetsuffix or l\nt=e[o..\"extension\"]or e.targetextension or t\nlocal e={}e.basename=c..l\ne.name=a..c..l..t\ne.directory=d\ne.prefix=a\ne.suffix=l\ne.fullpath=path.join(e.directory,e.name)e.bundlepath=p or e.fullpath\nif f==\"windows\"then\ne.directory=path.translate(e.directory,\"\\\\\")e.fullpath=path.translate(e.fullpath,\"\\\\\")end\nreturn e\nend\nfunction premake.gettool(e)if premake.iscppproject(e)then\nif _OPTIONS.cc then\nreturn premake[_OPTIONS.cc]end\nlocal e=premake.action.current()if e.valid_tools then\nreturn premake[e.valid_tools.cc[1]]end\nreturn premake.gcc\nelse\nreturn premake.dotnet\nend\nend\nfunction premake.project.getvpath(e,t)local n=t\nlocal i=path.getname(t)local o" "=t:len()-i:len()for r,e in pairs(e.vpaths or{})do\nfor a,e in ipairs(e)do\nlocal a=t:find(path.wildcards(e))if a==1 then\na=e:find(\"*\",1,true)or(e:len()+1)local e\nif a0 then\nt,stars=r:gsub(\"%*\",\"\")if stars==0 then\ne=path.getname(e)end\nelse\ne=path.getname(e)end\nn=path.join(t,e)end\nend\nend\nlocal e\nrepeat\ne=true\nif n:startswith(\"./\")then\nn=n:sub(3)elseif n:startswith(\"../\")then\nn=n:sub(4)else\ne=false\nend\nuntil not e\nreturn n\nend\nfunction premake.hascppproject(e)for e in premake.solution.eachproject(e)do\nif premake.iscppproject(e)then\nreturn true\nend\nend\nend\nfunction premake.hasdotnetproject(e)for e in premake.solution.eachproject(e)do\nif premake.isdotnetproject(e)then\nreturn true\nend\nend\nend\nfunction premake.project.iscproject(e)return e.language==\"C\"end\nfunction premake.iscppproject(e)return(e.language==\"C\"or e.language==\"C++\")end\nfunction premake.isdotnetproject(" "e)return(e.language==\"C#\")end", /* base/config.lua */ "premake.config={}local i=premake.config\nfunction premake.config.isdebugbuild(e)if e.flags.Optimize or e.flags.OptimizeSize or e.flags.OptimizeSpeed then\nreturn false\nend\nif not e.flags.Symbols then\nreturn false\nend\nreturn true\nend\nfunction premake.config.isincrementallink(e)if e.kind==\"StaticLib\"or i.isoptimizedbuild(e.flags)or e.flags.NoIncrementalLink then\nreturn false\nend\nreturn true\nend\nfunction premake.config.isoptimizedbuild(e)return e.Optimize or e.OptimizeSize or e.OptimizeSpeed\nend", /* base/bake.lua */ "premake.bake={}local p=premake.bake\nlocal l={blocks=true,keywords=true,projects=true,__configs=true,}local e={makesettings=true,}local a={basedir=true,location=true,}function premake.getactiveterms()local e={_action=_ACTION:lower(),os=os.get()}for o,n in pairs(_OPTIONS)do\nif n~=\"\"then\ntable.insert(e,n:lower())else\ntable.insert(e,o:lower())end\nend\nreturn e\nend\nfunction premake.iskeywordmatch(e,n)if e:startswith(\"not \")then\nreturn not premake.iskeywordmatch(e:sub(5),n)end\nfor e,o in ipairs(e:explode(\" or \"))do\nfor n,e in pairs(n)do\nif e:match(o)==e then\nreturn n\nend\nend\nend\nend\nfunction premake.iskeywordsmatch(o,e)local n=false\nfor i,o in ipairs(o)do\nlocal e=premake.iskeywordmatch(o,e)if not e then\nreturn false\nend\nif e==\"required\"then\nn=true\nend\nend\nif e.required and not n then\nreturn false\nelse\nreturn true\nend\nend\nlocal function d(r,i)function adjustpathlist(e)for n,o in ipairs(e)do\ne[n]=path.getrelative(r,o)end\nend\nfor o,n in pairs(i)do\nlocal e=premake.fields[o]if " "e and n and not a[o]then\nif e.kind==\"path\"then\ni[o]=path.getrelative(r,n)elseif e.kind==\"dirlist\"or e.kind==\"filelist\"then\nadjustpathlist(n)elseif e.kind==\"keypath\"then\nfor n,e in pairs(n)do\nadjustpathlist(e)end\nend\nend\nend\nend\nlocal function t(o,e,n)local e=e or{}if o==\"keyvalue\"or o==\"keypath\"then\nfor n,o in pairs(n)do\ne[n]=t(\"list\",e[n],o)end\nelse\nfor o,n in ipairs(n)do\nif not e[n]then\ntable.insert(e,n)e[n]=n\nend\nend\nend\nreturn e\nend\nlocal function r(o,e)if not e then\nreturn\nend\nfor e,n in pairs(e)do\nif not l[e]then\nlocal i=premake.fields[e]if i then\nif type(n)==\"table\"then\no[e]=t(i.kind,o[e],n)else\no[e]=n\nend\nelse\no[e]=n\nend\nend\nend\nend\nlocal function l(s,t,l,n,a,o)local i=a or\"\"o=o or\"Native\"if o~=\"Native\"then\ni=i..o\nend\nn.config=(a or\"\"):lower()n.platform=o:lower()local e={}r(e,l[i])d(t.location,e)r(e,t)if(e.kind)then\nn['kind']=e.kind:lower()end\nfor i,o in ipairs(t.blocks)do\nif(premake.iskeywordsmatch(o.keywords,n))then\nr(e,o)if(e.kind " "and not e.terms.kind)then\ne.terms['kind']=e.kind:lower()n['kind']=e.kind:lower()end\nend\nend\ne.name=a\ne.platform=o\nfor o,n in pairs(n)do\ne.terms[o]=n\nend\ns[i]=e\nend\nlocal function c(n,e)local o={}e=e or{}local r=n.solution or n\nlocal t=premake.getactiveterms()l(o,n,e,t)for i,a in ipairs(r.configurations)do\nlocal i={}for n,e in pairs(t)do i[n]=e end\nl(o,n,e,i,a,\"Native\")for t,r in ipairs(r.platforms or{})do\nif r~=\"Native\"then\nl(o,n,e,i,a,r)end\nend\nend\nreturn o\nend\nlocal function k()local r=4\nlocal i={}local o={}for e in premake.solution.each()do\nfor n,e in ipairs(e.projects)do\nfor n,e in pairs(e.__configs)do\nlocal n={}n[1]=path.getabsolute(path.join(e.location,e.objdir or e.project.objdir or\"obj\"))n[2]=path.join(n[1],iif(e.platform==\"Native\",\"\",e.platform))n[3]=path.join(n[2],e.name)n[4]=path.join(n[3],e.project.name)i[e]=n\nlocal e=iif(e.name,2,1)for e=e,r do\nlocal e=n[e]o[e]=(o[e]or 0)+1\nend\nend\nend\nend\nfor e in premake.solution.each()do\nfor n,e in ipairs(e.projects)do" "\nfor n,e in pairs(e.__configs)do\nlocal n\nlocal t=iif(e.name,2,1)for r=t,r do\nn=i[e][r]if o[n]==1 then break end\nend\ne.objectsdir=path.getrelative(e.location,n)end\nend\nend\nend\nlocal function h()for e in premake.solution.each()do\nfor n,e in ipairs(e.projects)do\nfor n,e in pairs(e.__configs)do\nlocal n=premake.getpathstyle(e)local o=premake.getnamestyle(e)e.buildtarget=premake.gettarget(e,\"build\",n,o,e.system)e.linktarget=premake.gettarget(e,\"link\",n,o,e.system)if n==\"windows\"then\ne.objectsdir=path.translate(e.objectsdir,\"\\\\\")end\nend\nend\nend\nend\nlocal function s(e)if(e.kind)then\nreturn e.kind;end\nif(e.project.__configs[\"\"]and e.project.__configs[\"\"].kind)then\nreturn e.project.__configs[\"\"].kind;end\nreturn nil\nend\nlocal function t(d,r,n,a,i,l)if(not n)then return end\nlocal f={};for o,e in ipairs(n[i])do\nlocal e=e:lower();if((not r[e]))then\nlocal i=nil;local o=nil;for r,n in ipairs(n.project.solution.projects)do\nif(n.name:lower()==e)then\nif(n.usage)then\no=n;else\ni=n;en" "d\nend\nend\nif(o)then\nr[e]=true;local n={name=e,proj=i,usageProj=o,bLinkageOnly=l,};d[e]=n;table.insert(f,o);end\nend\nend\nfor n,e in ipairs(f)do\nif((i~=\"links\")or(s(e.__configs[a])==\"StaticLib\"))then\nt(d,r,e.__configs[a],a,i,l);end\nend\nend\nlocal function f(i,o)local e={};local n={};n[i.project.name:lower()]=true;t(e,n,i,o,\"uses\",false);local i={};for r,e in pairs(e)do\nt(i,n,e.usageProj.__configs[o],o,\"links\",true);end\nfor o,n in pairs(i)do\ne[o]=n;end\nreturn e;end\nlocal function l(n,e)local o=n.project.solution;local n=e:lower();for o,e in ipairs(o.projects)do\nif(e.name:lower()==n)then\nreturn true;end\nend\nreturn false;end\nlocal function t(n,o,e)local r=premake.fields[e];local i=e;if type(n[e])==\"table\"then\nif(r.kind==\"dirlist\"or r.kind==\"filelist\")and(not a[e])then\nfor r,e in ipairs(n[e])do\ntable.insert(o[i],path.rebase(e,n.project.location,o.project.location))end\nelse\nif(e==\"links\")then\nfor r,e in ipairs(n[e])do\nif(not l(o,e))then\ntable.insert(o[i],e)else\nprintf(\"Fa" "iled to copy '%s' from proj '%s'.\",e,n.project.name);end\nend\nelse\nfor n,e in ipairs(n[e])do\ntable.insert(o[i],e)end\nend\nend\nelse\nif(r.kind==\"path\"and(not a[e]))then\no[i]=path.rebase(n[e],prj.location,o.project.location);else\no[i]=n[e];end\nend\nend\nlocal function l(n,i,e)local o=n.project;local r=(s(n)==\"StaticLib\");for o,e in pairs(e)do\nlocal o=e.usageProj;local i=o.__configs[i];for o,a in pairs(premake.fields)do\nif(i[o])then\nif(a.usagecopy)then\nif(not e.bLinkageOnly)then\nt(i,n,o)end\nelseif(a.linkagecopy)then\nif((not r)and(not e.proj))then\nt(i,n,o)end\nend\nend\nend\nif((not r)and e.proj)then\ntable.insert(n.links,e.proj.name);end\nend\nend\nfunction premake.bake.buildconfigs()for n in premake.solution.each()do\nfor o,e in ipairs(n.projects)do\ne.location=e.location or n.location or e.basedir\nd(e.location,e)for o,n in ipairs(e.blocks)do\nd(e.location,n)end\nend\nn.location=n.location or n.basedir\nend\nfor e in premake.solution.each()do\nlocal n=c(e)for o,e in ipairs(e.projects)do\ne." "__configs=c(e,n)for o,n in pairs(e.__configs)do\np.postprocess(e,n)end\nend\nend\nfor e in premake.solution.each()do\nfor n,e in ipairs(e.projects)do\nif(not e.usage)then\nfor n,e in pairs(e.__configs)do\nlocal o=f(e,n);l(e,n,o)end\nend\nend\nend\nfor n in premake.solution.each()do\nlocal e={};for n,o in ipairs(n.projects)do\nif(o.usage)then\ntable.insert(e,1,n);end\nend\nfor o,e in ipairs(e)do\ntable.remove(n.projects,e);end\nend\nk()h(cfg)end\nfunction premake.bake.postprocess(n,e)e.project=n\ne.shortname=premake.getconfigname(e.name,e.platform,true)e.longname=premake.getconfigname(e.name,e.platform)e.location=e.location or e.basedir\nlocal n=premake.platforms[e.platform]if n.iscrosscompiler then\ne.system=e.platform\nelse\ne.system=os.get()end\nif e.kind==\"SharedLib\"and n.nosharedlibs then\ne.kind=\"StaticLib\"end\nlocal o={}for n,i in ipairs(e.files)do\nlocal n=false\nfor o,e in ipairs(e.excludes)do\nn=(i==e)if(n)then break end\nend\nif(not n)then\ntable.insert(o,i)end\nend\ne.files=o\nfor n,o in pairs(p" "remake.fields)do\nif o.isflags then\nlocal e=e[n]for o,n in ipairs(e)do e[n]=true end\nend\nend\ne.__fileconfigs={}for n,o in ipairs(e.files)do\ne.terms.required=o:lower()local n={}for i,o in ipairs(e.project.blocks)do\nif(premake.iskeywordsmatch(o.keywords,e.terms))then\nr(n,o)end\nend\nn.name=o\ne.__fileconfigs[o]=n\ntable.insert(e.__fileconfigs,n)end\nend", /* base/api.lua */ "premake.fields={basedir={kind=\"path\",scope=\"container\",},buildaction={kind=\"string\",scope=\"config\",allowed={\"Compile\",\"Copy\",\"Embed\",\"None\"}},buildoptions={kind=\"list\",scope=\"config\",},configurations={kind=\"list\",scope=\"solution\",},debugargs={kind=\"list\",scope=\"config\",},debugdir={kind=\"path\",scope=\"config\",},debugenvs={kind=\"list\",scope=\"config\",},defines={kind=\"list\",scope=\"config\",},deploymentoptions={kind=\"list\",scope=\"config\",usagecopy=true,},excludes={kind=\"filelist\",scope=\"config\",},files={kind=\"filelist\",scope=\"config\",},flags={kind=\"list\",scope=\"config\",isflags=true,usagecopy=true,allowed=function(e)local n={ATL=1,DebugEnvsDontMerge=1,DebugEnvsInherit=1,EnableSSE=1,EnableSSE2=1,ExtraWarnings=1,FatalWarnings=1,FloatFast=1,FloatStrict=1,Managed=1,MFC=1,NativeWChar=1,No64BitChecks=1,NoEditAndContinue=1,NoExceptions=1,NoFramePointer=1,NoImportLib=1,NoIncrementalLink=1,NoManifest=1,NoMinimalRebuild=1,NoNativeWChar=1,NoPCH=1,NoRTTI=1,Optimize=1,Optimiz" "eSize=1,OptimizeSpeed=1,SEH=1,StaticATL=1,StaticRuntime=1,Symbols=1,Unicode=1,Unsafe=1,WinMain=1}local t={optimise='optimize',optimisesize='optimizesize',optimisespeed='optimizespeed',}local e=e:lower()e=t[e]or e\nfor n,t in pairs(n)do\nif n:lower()==e then\nreturn n\nend\nend\nreturn nil,\"invalid flag\"end,},framework={kind=\"string\",scope=\"container\",allowed={\"1.0\",\"1.1\",\"2.0\",\"3.0\",\"3.5\",\"4.0\",\"4.5\",}},imagepath={kind=\"path\",scope=\"config\",},imageoptions={kind=\"list\",scope=\"config\",},implibdir={kind=\"path\",scope=\"config\",},implibextension={kind=\"string\",scope=\"config\",},implibname={kind=\"string\",scope=\"config\",},implibprefix={kind=\"string\",scope=\"config\",},implibsuffix={kind=\"string\",scope=\"config\",},includedirs={kind=\"dirlist\",scope=\"config\",usagecopy=true,},kind={kind=\"string\",scope=\"config\",allowed={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"}},language={kind=\"string\",scope=\"container\",allowed={\"C\",\"C++\",\"C#\"}},libdirs={kind=" "\"dirlist\",scope=\"config\",linkagecopy=true,},linkoptions={kind=\"list\",scope=\"config\",},links={kind=\"list\",scope=\"config\",allowed=function(e)if e:find('/',nil,true)then\ne=path.getabsolute(e)end\nreturn e\nend,linkagecopy=true,},location={kind=\"path\",scope=\"container\",},makesettings={kind=\"list\",scope=\"config\",},objdir={kind=\"path\",scope=\"config\",},pchheader={kind=\"string\",scope=\"config\",},pchsource={kind=\"path\",scope=\"config\",},platforms={kind=\"list\",scope=\"solution\",allowed=table.keys(premake.platforms),},postbuildcommands={kind=\"list\",scope=\"config\",},prebuildcommands={kind=\"list\",scope=\"config\",},prelinkcommands={kind=\"list\",scope=\"config\",},resdefines={kind=\"list\",scope=\"config\",},resincludedirs={kind=\"dirlist\",scope=\"config\",},resoptions={kind=\"list\",scope=\"config\",},targetdir={kind=\"path\",scope=\"config\",},targetextension={kind=\"string\",scope=\"config\",},targetname={kind=\"string\",scope=\"config\",},targetprefix={kind=\"string\",scope=\"co" "nfig\",},targetsuffix={kind=\"string\",scope=\"config\",},trimpaths={kind=\"dirlist\",scope=\"config\",},uuid={kind=\"string\",scope=\"container\",allowed=function(e)local n=true\nif(#e~=36)then n=false end\nfor t=1,36 do\nlocal e=e:sub(t,t)if(not e:find(\"[ABCDEFabcdef0123456789-]\"))then n=false end\nend\nif(e:sub(9,9)~=\"-\")then n=false end\nif(e:sub(14,14)~=\"-\")then n=false end\nif(e:sub(19,19)~=\"-\")then n=false end\nif(e:sub(24,24)~=\"-\")then n=false end\nif(not n)then\nreturn nil,\"invalid UUID\"end\nreturn e:upper()end},uses={kind=\"list\",scope=\"config\",},vpaths={kind=\"keypath\",scope=\"container\",},}function premake.checkvalue(e,n)if(n)then\nif(type(n)==\"function\")then\nreturn n(e)else\nfor t,n in ipairs(n)do\nif(e:lower()==n:lower())then\nreturn n\nend\nend\nreturn nil,\"invalid value '\"..e..\"'\"end\nelse\nreturn e\nend\nend\nfunction premake.getobject(n)local e\nif(n==\"container\"or n==\"solution\")then\ne=premake.CurrentContainer\nelse\ne=premake.CurrentConfiguration\nend\nif n==\"so" "lution\"then\nif type(e)==\"project\"then\ne=e.solution\nend\nif type(e)~=\"solution\"then\ne=nil\nend\nend\nlocal t\nif(not e)then\nif(n==\"container\")then\nt=\"no active solution or project\"elseif(n==\"solution\")then\nt=\"no active solution\"else\nt=\"no active solution, project, or configuration\"end\nend\nreturn e,t\nend\nfunction premake.setarray(e,t,a,s)local n,i=premake.getobject(e)if(not n)then\nerror(i,4)end\nif(not n[t])then\nn[t]={}end\nlocal function r(e,o)if(type(e)==\"table\")then\nfor n,e in ipairs(e)do\nr(e,o+1)end\nelse\ne,i=premake.checkvalue(e,s)if(not e)then\nerror(i,o)end\ntable.insert(n[t],e)end\nend\nif(a)then\nr(a,5)end\nreturn n[t]end\nlocal function i(i,r,o,a)local t={}function makeabsolute(e,n)if(type(e)==\"table\")then\nfor t,e in ipairs(e)do\nmakeabsolute(e,n+1)end\nelseif type(e)==\"string\"then\nif e:find(\"*\")then\nmakeabsolute(a(e),n+1)else\ntable.insert(t,path.getabsolute(e))end\nelse\nerror(\"Invalid value in list: expected string, got \"..type(e),n)end\nend\nmakeabsolute" "(o,3)return premake.setarray(i,r,t)end\nfunction premake.setdirarray(n,e,t)return i(n,e,t,os.matchdirs)end\nfunction premake.setfilearray(t,e,n)return i(t,e,n,os.matchfiles)end\nfunction premake.setkeyvalue(e,n,t)local e,i=premake.getobject(e)if not e then\nerror(i,4)end\nif not e[n]then\ne[n]={}end\nif type(t)~=\"table\"then\nerror(\"invalid value; table expected\",4)end\nlocal e=e[n]for n,t in pairs(t)do\nif not e[n]then\ne[n]={}end\ntable.insertflat(e[n],t)end\nreturn e\nend\nfunction premake.setstring(n,i,e,r)local n,t=premake.getobject(n)if(not n)then\nerror(t,4)end\nif(e)then\ne,t=premake.checkvalue(e,r)if(not e)then\nerror(t,4)end\nn[i]=e\nend\nreturn n[i]end\nlocal function o(n,e)local t=premake.fields[n].kind\nlocal i=premake.fields[n].scope\nlocal r=premake.fields[n].allowed\nif(t==\"string\"or t==\"path\")and e then\nif type(e)~=\"string\"then\nerror(\"string value expected\",3)end\nend\nif t==\"string\"then\nreturn premake.setstring(i,n,e,r)elseif t==\"path\"then\nif e then e=path.getabsolute(e)end" "\nreturn premake.setstring(i,n,e)elseif t==\"list\"then\nreturn premake.setarray(i,n,e,r)elseif t==\"dirlist\"then\nreturn premake.setdirarray(i,n,e)elseif t==\"filelist\"then\nreturn premake.setfilearray(i,n,e)elseif t==\"keyvalue\"or t==\"keypath\"then\nreturn premake.setkeyvalue(i,n,e)end\nend\nfor e,n in pairs(premake.fields)do\n_G[e]=function(n)return o(e,n)end\nend\nfunction configuration(t)if not t then\nreturn premake.CurrentConfiguration\nend\nlocal n,e=premake.getobject(\"container\")if(not n)then\nerror(e,2)end\nlocal e={}e.terms=table.flatten({t})table.insert(n.blocks,e)premake.CurrentConfiguration=e\ne.keywords={}for t,n in ipairs(e.terms)do\ntable.insert(e.keywords,path.wildcards(n):lower())end\nfor t,n in pairs(premake.fields)do\nif(n.kind~=\"string\"and n.kind~=\"path\")then\ne[t]={}end\nend\nreturn e\nend\nlocal function r(t,n,i)local e={}setmetatable(e,{__type=\"project\",})table.insert(n.projects,e)if(i)then\nif(n.projects[t])then\nn.projects[t].usageProj=e;else\nn.projects[t]=e\nend\nelse\n" "if(n.projects[t])then\ne.usageProj=n.projects[t];end\nn.projects[t]=e\nend\ne.solution=n\ne.name=t\ne.basedir=os.getcwd()e.uuid=os.uuid()e.blocks={}e.usage=i;return e;end\nfunction usage(n)if(not n)then\nif(type(premake.CurrentContainer)~=\"project\")then return nil end\nif(not premake.CurrentContainer.usage)then return nil end\nreturn premake.CurrentContainer\nend\nlocal e\nif(type(premake.CurrentContainer)==\"project\")then\ne=premake.CurrentContainer.solution\nelse\ne=premake.CurrentContainer\nend\nif(type(e)~=\"solution\")then\nerror(\"no active solution\",2)end\nif((not e.projects[n])or((not e.projects[n].usage)and(not e.projects[n].usageProj)))then\npremake.CurrentContainer=r(n,e,true)else\npremake.CurrentContainer=iff(e.projects[n].usage,e.projects[n],e.projects[n].usageProj)end\nconfiguration{}return premake.CurrentContainer\nend\nfunction project(n)if(not n)then\nif(type(premake.CurrentContainer)~=\"project\")then return nil end\nif(premake.CurrentContainer.usage)then return nil end\nreturn premake.Cu" "rrentContainer\nend\nlocal e\nif(type(premake.CurrentContainer)==\"project\")then\ne=premake.CurrentContainer.solution\nelse\ne=premake.CurrentContainer\nend\nif(type(e)~=\"solution\")then\nerror(\"no active solution\",2)end\nif((not e.projects[n])or e.projects[n].usage)then\npremake.CurrentContainer=r(n,e)else\npremake.CurrentContainer=e.projects[n];end\nconfiguration{}return premake.CurrentContainer\nend\nfunction solution(e)if not e then\nif type(premake.CurrentContainer)==\"project\"then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\npremake.CurrentContainer=premake.solution.get(e)if(not premake.CurrentContainer)then\npremake.CurrentContainer=premake.solution.new(e)end\nconfiguration{}return premake.CurrentContainer\nend\nfunction newaction(e)premake.action.add(e)end\nfunction newoption(e)premake.option.add(e)end", /* base/cmdline.lua */ "newoption{trigger=\"cc\",value=\"VALUE\",description=\"Choose a C/C++ compiler set\",allowed={{\"gcc\",\"GNU GCC (gcc/g++)\"},{\"ow\",\"OpenWatcom\"},}}newoption{trigger=\"dotnet\",value=\"VALUE\",description=\"Choose a .NET compiler set\",allowed={{\"msnet\",\"Microsoft .NET (csc)\"},{\"mono\",\"Novell Mono (mcs)\"},{\"pnet\",\"Portable.NET (cscc)\"},}}newoption{trigger=\"file\",value=\"FILE\",description=\"Read FILE as a Premake script; default is 'premake4.lua'\"}newoption{trigger=\"help\",description=\"Display this information\"}newoption{trigger=\"os\",value=\"VALUE\",description=\"Generate files for a different operating system\",allowed={{\"bsd\",\"OpenBSD, NetBSD, or FreeBSD\"},{\"haiku\",\"Haiku\"},{\"linux\",\"Linux\"},{\"macosx\",\"Apple Mac OS X\"},{\"solaris\",\"Solaris\"},{\"windows\",\"Microsoft Windows\"},}}newoption{trigger=\"platform\",value=\"VALUE\",description=\"Add target architecture (if supported by action)\",allowed={{\"x32\",\"32-bit\"},{\"x64\",\"64-bit\"},{\"universal\",\"Mac OS X U" "niversal, 32- and 64-bit\"},{\"universal32\",\"Mac OS X Universal, 32-bit only\"},{\"universal64\",\"Mac OS X Universal, 64-bit only\"},{\"ps3\",\"Playstation 3 (experimental)\"},{\"xbox360\",\"Xbox 360 (experimental)\"},}}newoption{trigger=\"scripts\",value=\"path\",description=\"Search for additional scripts on the given path\"}newoption{trigger=\"version\",description=\"Display version information\"}newoption{trigger=\"generate_user\",description=\"Generate (and remove when cleaning) .user VStudio files\"}", /* tools/dotnet.lua */ "premake.dotnet={}premake.dotnet.namestyle=\"windows\"local t={FatalWarning=\"/warnaserror\",Optimize=\"/optimize\",OptimizeSize=\"/optimize\",OptimizeSpeed=\"/optimize\",Symbols=\"/debug\",Unsafe=\"/unsafe\"}function premake.dotnet.getbuildaction(e)local n=path.getextension(e.name):lower()if e.buildaction==\"Compile\"or n==\".cs\"then\nreturn\"Compile\"elseif e.buildaction==\"Embed\"or n==\".resx\"then\nreturn\"EmbeddedResource\"elseif e.buildaction==\"Copy\"or n==\".asax\"or n==\".aspx\"then\nreturn\"Content\"elseif e.buildaction==\"Page\"or n==\".xaml\"then\nif(path.getname(e.name)==\"App.xaml\")then\nreturn\"ApplicationDefinition\"else\nreturn\"Page\"end\nelse\nreturn\"None\"end\nend\nfunction premake.dotnet.getcompilervar(e)if(_OPTIONS.dotnet==\"msnet\")then\nreturn\"csc\"elseif(_OPTIONS.dotnet==\"mono\")then\nif(e.framework<=\"1.1\")then\nreturn\"mcs\"elseif(e.framework>=\"4.0\")then\nreturn\"dmcs\"else\nreturn\"gmcs\"end\nelse\nreturn\"cscc\"end\nend\nfunction premake.dotnet.getflags(e)local e=table.tran" "slate(e.flags,t)return e\nend\nfunction premake.dotnet.getkind(e)if(e.kind==\"ConsoleApp\")then\nreturn\"Exe\"elseif(e.kind==\"WindowedApp\")then\nreturn\"WinExe\"elseif(e.kind==\"SharedLib\")then\nreturn\"Library\"end\nend", /* tools/gcc.lua */ "premake.gcc={}premake.gcc.cc=\"gcc\"premake.gcc.cxx=\"g++\"premake.gcc.ar=\"ar\"local n={EnableSSE=\"-msse\",EnableSSE2=\"-msse2\",ExtraWarnings=\"-Wall -Wextra\",FatalWarnings=\"-Werror\",FloatFast=\"-ffast-math\",FloatStrict=\"-ffloat-store\",NoFramePointer=\"-fomit-frame-pointer\",Optimize=\"-O2\",OptimizeSize=\"-Os\",OptimizeSpeed=\"-O3\",Symbols=\"-g\",}local l={NoExceptions=\"-fno-exceptions\",NoRTTI=\"-fno-rtti\",}premake.gcc.platforms={Native={cppflags=\"-MMD\",},x32={cppflags=\"-MMD\",flags=\"-m32\",ldflags=\"-L/usr/lib32\",},x64={cppflags=\"-MMD\",flags=\"-m64\",ldflags=\"-L/usr/lib64\",},Universal={cppflags=\"\",flags=\"-arch i386 -arch x86_64 -arch ppc -arch ppc64\",},Universal32={cppflags=\"\",flags=\"-arch i386 -arch ppc\",},Universal64={cppflags=\"\",flags=\"-arch x86_64 -arch ppc64\",},PS3={cc=\"ppu-lv2-g++\",cxx=\"ppu-lv2-g++\",ar=\"ppu-lv2-ar\",cppflags=\"-MMD\",},WiiDev={cppflags=\"-MMD -MP -I$(LIBOGC_INC) $(MACHDEP)\",ldflags=\"-L$(LIBOGC_LIB) $(MACHDEP)\",cfgsettings=[[\n ifeq ($(strip $(" "DEVKITPPC)),)\n $(error \"DEVKITPPC environment variable is not set\")'\n endif\n include $(DEVKITPPC)/wii_rules']],},}local t=premake.gcc.platforms\nfunction premake.gcc.getcppflags(a)local e={}table.insert(e,t[a.platform].cppflags)if e[1]:startswith(\"-MMD\")and a.system~=\"haiku\"then\ntable.insert(e,\"-MP\")end\nreturn e\nend\nfunction premake.gcc.getcflags(e)local a=table.translate(e.flags,n)table.insert(a,t[e.platform].flags)if e.system~=\"windows\"and e.kind==\"SharedLib\"then\ntable.insert(a,\"-fPIC\")end\nreturn a\nend\nfunction premake.gcc.getcxxflags(e)local e=table.translate(e.flags,l)return e\nend\nfunction premake.gcc.getldflags(e)local a={}if not e.flags.Symbols then\nif e.system==\"macosx\"then\ntable.insert(a,\"-Wl,-x\")else\ntable.insert(a,\"-s\")end\nend\nif e.kind==\"SharedLib\"then\nif e.system==\"macosx\"then\ntable.insert(a,\"-dynamiclib\")else\ntable.insert(a,\"-shared\")end\nif e.system==\"windows\"and not e.flags.NoImportLib then\ntable.insert(a,'-Wl,--out-implib=\"'..e.linktarge" "t.fullpath..'\"')end\nend\nif e.kind==\"WindowedApp\"and e.system==\"windows\"then\ntable.insert(a,\"-mwindows\")end\nlocal e=t[e.platform]table.insert(a,e.flags)table.insert(a,e.ldflags)return a\nend\nfunction premake.gcc.getlibdirflags(a)local e={}for t,a in ipairs(premake.getlinks(a,\"all\",\"directory\"))do\ntable.insert(e,'-L'.._MAKE.esc(a))end\nreturn e\nend\nfunction premake.gcc.getlinkflags(a)local e={}for t,a in ipairs(premake.getlinks(a,\"system\",\"name\"))do\nif path.getextension(a)==\".framework\"then\ntable.insert(e,'-framework '.._MAKE.esc(path.getbasename(a)))else\ntable.insert(e,'-l'.._MAKE.esc(a))end\nend\nreturn e\nend\nfunction premake.gcc.getdefines(a)local e={}for t,a in ipairs(a)do\ntable.insert(e,'-D'..a)end\nreturn e\nend\nfunction premake.gcc.getincludedirs(a)local e={}for t,a in ipairs(a)do\ntable.insert(e,\"-I\".._MAKE.esc(a))end\nreturn e\nend\nfunction premake.gcc.getcfgsettings(e)return t[e.platform].cfgsettings\nend", /* tools/msc.lua */ "premake.msc={}premake.msc.namestyle=\"windows\"", /* tools/ow.lua */ "premake.ow={}premake.ow.namestyle=\"windows\"premake.ow.cc=\"WCL386\"premake.ow.cxx=\"WCL386\"premake.ow.ar=\"ar\"local e={ExtraWarnings=\"-wx\",FatalWarning=\"-we\",FloatFast=\"-omn\",FloatStrict=\"-op\",Optimize=\"-ox\",OptimizeSize=\"-os\",OptimizeSpeed=\"-ot\",Symbols=\"-d2\",}local n={NoExceptions=\"-xd\",NoRTTI=\"-xr\",}premake.ow.platforms={Native={flags=\"\"},}function premake.ow.getcppflags(e)return{}end\nfunction premake.ow.getcflags(a)local e=table.translate(a.flags,e)if(a.flags.Symbols)then\ntable.insert(e,\"-hw\")end\nreturn e\nend\nfunction premake.ow.getcxxflags(e)local e=table.translate(e.flags,n)return e\nend\nfunction premake.ow.getldflags(a)local e={}if(a.flags.Symbols)then\ntable.insert(e,\"op symf\")end\nreturn e\nend\nfunction premake.ow.getlinkflags(e)local e={}return e\nend\nfunction premake.ow.getdefines(a)local e={}for n,a in ipairs(a)do\ntable.insert(e,'-D'..a)end\nreturn e\nend\nfunction premake.ow.getincludedirs(a)local e={}for n,a in ipairs(a)do\ntable.insert(e,'-I \"'..a..'\"')en" "d\nreturn e\nend", /* tools/snc.lua */ "premake.snc={}premake.snc.cc=\"snc\"premake.snc.cxx=\"g++\"premake.snc.ar=\"ar\"local n={ExtraWarnings=\"-Xdiag=2\",FatalWarnings=\"-Xquit=2\",}local t={NoExceptions=\"\",NoRTTI=\"-Xc-=rtti\",}premake.snc.platforms={PS3={cc=\"ppu-lv2-g++\",cxx=\"ppu-lv2-g++\",ar=\"ppu-lv2-ar\",cppflags=\"-MMD -MP\",}}local a=premake.snc.platforms\nfunction premake.snc.getcppflags(n)local e={}table.insert(e,a[n.platform].cppflags)return e\nend\nfunction premake.snc.getcflags(e)local n=table.translate(e.flags,n)table.insert(n,a[e.platform].flags)if e.kind==\"SharedLib\"then\ntable.insert(n,\"-fPIC\")end\nreturn n\nend\nfunction premake.snc.getcxxflags(e)local e=table.translate(e.flags,t)return e\nend\nfunction premake.snc.getldflags(n)local e={}if not n.flags.Symbols then\ntable.insert(e,\"-s\")end\nif n.kind==\"SharedLib\"then\ntable.insert(e,\"-shared\")if not n.flags.NoImportLib then\ntable.insert(e,'-Wl,--out-implib=\"'..n.linktarget.fullpath..'\"')end\nend\nlocal n=a[n.platform]table.insert(e,n.flags)table.insert(e,n.ldflag" "s)return e\nend\nfunction premake.snc.getlibdirflags(n)local e={}for a,n in ipairs(premake.getlinks(n,\"all\",\"directory\"))do\ntable.insert(e,'-L'.._MAKE.esc(n))end\nreturn e\nend\nfunction premake.snc.getlinkflags(n)local e={}for a,n in ipairs(premake.getlinks(n,\"system\",\"name\"))do\ntable.insert(e,'-l'.._MAKE.esc(n))end\nreturn e\nend\nfunction premake.snc.getdefines(n)local e={}for a,n in ipairs(n)do\ntable.insert(e,'-D'..n)end\nreturn e\nend\nfunction premake.snc.getincludedirs(n)local e={}for a,n in ipairs(n)do\ntable.insert(e,\"-I\".._MAKE.esc(n))end\nreturn e\nend", /* base/validate.lua */ "function premake.checkprojects()local n=premake.action.current()for e in premake.solution.each()do\nif(#e.projects==0)then\nreturn nil,\"solution '\"..e.name..\"' needs at least one project\"end\nif(#e.configurations==0)then\nreturn nil,\"solution '\"..e.name..\"' needs configurations\"end\nfor e in premake.solution.eachproject(e)do\nif(not e.language)then\nreturn nil,\"project '\"..e.name..\"' needs a language\"end\nif(n.valid_languages)then\nif(not table.contains(n.valid_languages,e.language))then\nreturn nil,\"the \"..n.shortname..\" action does not support \"..e.language..\" projects\"end\nend\nfor t in premake.eachconfig(e)do\nif(not t.kind)then\nreturn nil,\"project '\"..e.name..\"' needs a kind in configuration '\"..t.name..\"'\"end\nif(n.valid_kinds)then\nif(not table.contains(n.valid_kinds,t.kind))then\nreturn nil,\"the \"..n.shortname..\" action does not support \"..t.kind..\" projects\"end\nend\nend\nif n.oncheckproject then\nn.oncheckproject(e)end\nend\nend\nreturn true\nend\nfunction premake.check" "tools()local e=premake.action.current()if(not e.valid_tools)then\nreturn true\nend\nfor n,t in pairs(e.valid_tools)do\nif(_OPTIONS[n])then\nif(not table.contains(t,_OPTIONS[n]))then\nreturn nil,\"the \"..e.shortname..\" action does not support /\"..n..\"=\".._OPTIONS[n]..\" (yet)\"end\nelse\n_OPTIONS[n]=t[1]end\nend\nreturn true\nend", /* base/help.lua */ "function premake.showhelp()printf(\"Premake %s, a build script generator\",_PREMAKE_VERSION)printf(_PREMAKE_COPYRIGHT)printf(\"%s %s\",_VERSION,_COPYRIGHT)printf(\"\")printf(\"Usage: premake4 [options] action [arguments]\")printf(\"\")printf(\"OPTIONS\")printf(\"\")for n in premake.option.each()do\nlocal i=n.trigger\nlocal e=n.description\nif(n.value)then i=i..\"=\"..n.value end\nif(n.allowed)then e=e..\"; one of:\"end\nprintf(\" --%-15s %s\",i,e)if(n.allowed)then\nfor i,n in ipairs(n.allowed)do\nprintf(\" %-14s %s\",n[1],n[2])end\nend\nprintf(\"\")end\nprintf(\"ACTIONS\")printf(\"\")for n in premake.action.each()do\nprintf(\" %-17s %s\",n.trigger,n.description)end\nprintf(\"\")printf(\"For additional information, see http://industriousone.com/premake\")end", /* base/premake.lua */ "function premake.generate(n,e,t)e=premake.project.getfilename(n,e)printf(\"Generating %s...\",e)local e,o=io.open(e,\"wb\")if(not e)then\nerror(o,0)end\nio.output(e)t(n)e:close()end", /* actions/codeblocks/_codeblocks.lua */ "premake.codeblocks={}newaction{trigger=\"codeblocks\",shortname=\"Code::Blocks\",description=\"Generate Code::Blocks project files\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\"},valid_tools={cc={\"gcc\",\"ow\"},},onsolution=function(e)premake.generate(e,\"%%.workspace\",premake.codeblocks.workspace)end,onproject=function(e)premake.generate(e,\"%%.cbp\",premake.codeblocks.cbp)end,oncleansolution=function(e)premake.clean.file(e,\"%%.workspace\")end,oncleanproject=function(e)premake.clean.file(e,\"%%.cbp\")premake.clean.file(e,\"%%.depend\")premake.clean.file(e,\"%%.layout\")end}", /* actions/codeblocks/codeblocks_workspace.lua */ "function premake.codeblocks.workspace(e)_p('')_p('')_p(1,'',e.name)for o in premake.solution.eachproject(e)do\nlocal p=path.join(path.getrelative(e.location,o.location),o.name)local a=iif(o.project==e.projects[1],' active=\"1\"','')_p(2,'',p,a)for a,o in ipairs(premake.getdependencies(o))do\n_p(3,'',path.join(path.getrelative(e.location,o.location),o.name))end\n_p(2,'')end\n_p(1,'')_p('')end", /* actions/codeblocks/codeblocks_cbp.lua */ "local p=premake.codeblocks\nfunction p.files(e)local o\nif(e.pchheader)then\no=path.getrelative(e.location,e.pchheader)end\nfor i in premake.project.eachfile(e)do\n_p(2,'',premake.esc(i.name))if i.name~=i.vpath then\n_p(3,'')end\nend\nfunction premake.codeblocks.debugenvs(i)if premake.gettool(i)==premake.gcc then\n_p(3,'')_p(4,'',premake.esc(i.longname))local e=''local n=#i.debugenvs\nfor o,i in ipairs(i.debugenvs)do\ne=e..'set env '..i\nif n~=o then e=e..' 'end\nend\n_p(5," "'',e)_p(4,'')_p(3,'')else\nerror('Sorry at this moment there is no support for debug environment variables with this debugger and codeblocks')end\nend\nfunction premake.codeblocks.cbp(i)local o=premake.gettool(i)_p('')_p('')_p(1,'')_p(1,'')_p(2,'')_p('')_p('')end", /* actions/codelite/_codelite.lua */ "premake.codelite={}newaction{trigger=\"codelite\",shortname=\"CodeLite\",description=\"Generate CodeLite project files\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\"},valid_tools={cc={\"gcc\"},},onsolution=function(e)premake.generate(e,\"%%.workspace\",premake.codelite.workspace)end,onproject=function(e)premake.generate(e,\"%%.project\",premake.codelite.project)end,oncleansolution=function(e)premake.clean.file(e,\"%%.workspace\")premake.clean.file(e,\"%%_wsp.mk\")premake.clean.file(e,\"%%.tags\")end,oncleanproject=function(e)premake.clean.file(e,\"%%.project\")premake.clean.file(e,\"%%.mk\")premake.clean.file(e,\"%%.list\")premake.clean.file(e,\"%%.out\")end}", /* actions/codelite/codelite_workspace.lua */ "function premake.codelite.workspace(e)_p('')_p('',premake.esc(e.name),premake.esc(e.name))for o,a in ipairs(e.projects)do\nlocal i=premake.esc(a.name)local a=path.join(path.getrelative(e.location,a.location),a.name)local e=iif(o==1,\"Yes\",\"No\")_p(' ',i,a,e)end\nlocal a=premake.filterplatforms(e,premake[_OPTIONS.cc].platforms,\"Native\")for e=#a,1,-1 do\nif premake.platforms[a[e]].iscrosscompiler then\ntable.remove(a,e)end\nend\n_p(' ')for a,o in ipairs(a)do\nfor i,a in ipairs(e.configurations)do\nlocal a=premake.getconfigname(a,o):gsub(\"|\",\"_\")_p(' ',a)for o,e in ipairs(e.projects)do\n_p(' ',e.name,a)end\n_p(' ')end\nend\n_p(' ')_p('')end", /* actions/codelite/codelite_project.lua */ "local e=premake.codelite\nlocal i=premake.tree\nfunction e.files(e)local e=premake.project.buildsourcetree(e)i.traverse(e,{onbranchenter=function(i,e)_p(e,'',i.name)end,onbranchexit=function(i,e)_p(e,'')end,onleaf=function(i,e)_p(e,'',i.cfg.name)end,},true,1)end\nfunction premake.codelite.project(i)io.indent=\" \"_p('')_p('',premake.esc(i.name))e.files(i)local n={ConsoleApp=\"Executable\",WindowedApp=\"Executable\",StaticLib=\"Static Library\",SharedLib=\"Dynamic Library\",}_p(' ',n[i.kind])local o=premake.filterplatforms(i.solution,premake[_OPTIONS.cc].platforms,\"Native\")for e=#o,1,-1 do\nif premake.platforms[o[e]].iscrosscompiler then\ntable.remove(o,e)end\nend\nfor o,e in ipairs(o)do\nfor e in premake.eachconfig(i,e)do\nlocal o=premake.esc(e.longname):gsub(\"|\",\"_\")local i=iif(e.language==\"C\",\"gcc\",\"g++\")_p(' ',o,i,n[e.kind])local r=premake.esc(e.buildtarget.fullpath)local l=premake.esc(e.objectsdir)local n=e.buildtarget.name\nlocal o=e.debugdir or e.buildtarget.directory\nlocal i=table.concat(e.debugargs,\" \")local a=iif(e.kind==\"WindowedApp\",\"no\",\"yes\")_p(' ',r,l,n,i,o,a)local i=premake.esc(table.join(premake.gcc.getcflags(e),premake.gcc.getcxxflags(e),e.buildoptions))_p(' ',table.concat(i,\";\"))for i,e in ipairs(e.includedirs)do\n_p(' ',premake.esc(e))end\nfor i,e in ipairs(e.defines)do\n_p(' ',premake.esc(e))end\n_p(' ')i=premake.esc(table.join(premake.gcc.getldflags(e),e.linkoptions))_p(' ',table." "concat(i,\";\"))for i,e in ipairs(premake.getlinks(e,\"all\",\"directory\"))do\n_p(' ',premake.esc(e))end\nfor i,e in ipairs(premake.getlinks(e,\"siblings\",\"basename\"))do\n_p(' ',premake.esc(e))end\nfor i,e in ipairs(premake.getlinks(e,\"system\",\"name\"))do\n_p(' ',premake.esc(e))end\n_p(' ')if premake.findfile(e,\".rc\")then\nlocal i=table.implode(table.join(e.defines,e.resdefines),\"-D\",\";\",\"\")local o=table.concat(e.resoptions,\";\")_p(' ',i,o)for i,e in ipairs(table.join(e.includedirs,e.resincludedirs))do\n_p(' ',premake.esc(e))end\n_p(' ')else\n_p(' ')end\nif#e.prebuildcommands>0 then\n_p(' ')for i,e in ipairs(e.prebuildcommands)do\n_p(' %s',premake.esc(e))end\n_p(' " " ')end\nif#e.postbuildcommands>0 then\n_p(' ')for i,e in ipairs(e.postbuildcommands)do\n_p(' %s',premake.esc(e))end\n_p(' ')end\n_p(' ')_p(' ')_p(' ')_p(' ')_p(' ')_p(' None')_p(' ')_p(' ')_p(' ')_p(' ')_p(' ')_p(' ')_p(' ')end\nend\n_p(' ')for o,e in ipairs(o)do\nfor e in premake.eachconfig(i,e)do\n_p(' ',e.longname:gsub(\"|\",\"_\"))for i,e in ipairs(premake.getdependencies(i))do\n_p(' ',e.name)e" "nd\n_p(' ')end\nend\n_p('')end", /* actions/make/_make.lua */ "_MAKE={}premake.make={}local t=premake.make\nfunction _MAKE.esc(n)local e\nif(type(n)==\"table\")then\ne={}for t,n in ipairs(n)do\ntable.insert(e,_MAKE.esc(n))end\nreturn e\nelse\ne=n:gsub(\"\\\\\",\"\\\\\\\\\")e=e:gsub(\" \",\"\\\\ \")e=e:gsub(\"%(\",\"\\\\%(\")e=e:gsub(\"%)\",\"\\\\%)\")e=e:gsub(\"$\\\\%((.-)\\\\%)\",\"$%(%1%)\")return e\nend\nend\nfunction premake.make_copyrule(n,e)_p('%s: %s',e,n)_p('\\t@echo Copying $(notdir %s)',e)_p('ifeq (posix,$(SHELLTYPE))')_p('\\t$(SILENT) cp -fR %s %s',n,e)_p('else')_p('\\t$(SILENT) copy /Y $(subst /,\\\\\\\\,%s) $(subst /,\\\\\\\\,%s)',n,e)_p('endif')end\nfunction premake.make_mkdirrule(e)_p('\\t@echo Creating %s',e)_p('ifeq (posix,$(SHELLTYPE))')_p('\\t$(SILENT) mkdir -p %s',e)_p('else')_p('\\t$(SILENT) mkdir $(subst /,\\\\\\\\,%s)',e)_p('endif')_p('')end\nfunction t.list(e)if#e>0 then\nreturn\" \"..table.concat(e,\" \")else\nreturn\"\"end\nend\nfunction _MAKE.getmakefilename(n,a)local e=0\nfor t in premake.solution.each()do\nif(t.location==n.location)then e=e+1 " "end\nif(a)then\nfor a,t in ipairs(t.projects)do\nif(t.location==n.location)then e=e+1 end\nend\nend\nend\nif(e==1)then\nreturn\"Makefile\"else\nreturn n.name..\".make\"end\nend\nfunction _MAKE.getnames(e)local e=table.extract(e,\"name\")for t,n in pairs(e)do\ne[t]=_MAKE.esc(n)end\nreturn e\nend\nfunction t.settings(e,n)if#e.makesettings>0 then\nfor n,e in ipairs(e.makesettings)do\n_p(e)end\nend\nlocal e=n.platforms[e.platform].cfgsettings\nif e then\n_p(e)end\nend\nnewaction{trigger=\"gmake\",shortname=\"GNU Make\",description=\"Generate GNU makefiles for POSIX, MinGW, and Cygwin\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\",\"C#\"},valid_tools={cc={\"gcc\"},dotnet={\"mono\",\"msnet\",\"pnet\"},},onsolution=function(e)premake.generate(e,_MAKE.getmakefilename(e,false),premake.make_solution)end,onproject=function(e)local n=_MAKE.getmakefilename(e,true)if premake.isdotnetproject(e)then\npremake.generate(e,n,premake.make_csharp)else\npremake.generate(e,n," "premake.make_cpp)end\nend,oncleansolution=function(e)premake.clean.file(e,_MAKE.getmakefilename(e,false))end,oncleanproject=function(e)premake.clean.file(e,_MAKE.getmakefilename(e,true))end}", /* actions/make/make_solution.lua */ "function premake.make_solution(e)local o=premake[_OPTIONS.cc]local a=premake.filterplatforms(e,o.platforms,\"Native\")_p('# %s solution makefile autogenerated by Premake',premake.action.current().shortname)_p('# Type \"make help\" for usage help')_p('')_p('ifndef config')_p(' config=%s',_MAKE.esc(premake.getconfigname(e.configurations[1],a[1],true)))_p('endif')_p('export config')_p('')_p('PROJECTS := %s',table.concat(_MAKE.esc(table.extract(e.projects,\"name\")),\" \"))_p('')_p('.PHONY: all clean help $(PROJECTS)')_p('')_p('all: $(PROJECTS)')_p('')for a,o in ipairs(e.projects)do\n_p('%s: %s',_MAKE.esc(o.name),table.concat(_MAKE.esc(table.extract(premake.getdependencies(o),\"name\")),\" \"))_p('\\t@echo \"==== Building %s ($(config)) ====\"',o.name)_p('\\t@${MAKE} --no-print-directory -C %s -f %s',_MAKE.esc(path.getrelative(e.location,o.location)),_MAKE.esc(_MAKE.getmakefilename(o,true)))_p('')end\n_p('clean:')for a,o in ipairs(e.projects)do\n_p('\\t@${MAKE} --no-print-directory -C %s -f %s clean',_MAKE.esc(pa" "th.getrelative(e.location,o.location)),_MAKE.esc(_MAKE.getmakefilename(o,true)))end\n_p('')_p('help:')_p(1,'@echo \"Usage: make [config=name] [target]\"')_p(1,'@echo \"\"')_p(1,'@echo \"CONFIGURATIONS:\"')local o={}for a,o in ipairs(a)do\nfor a,e in ipairs(e.configurations)do\n_p(1,'@echo \" %s\"',premake.getconfigname(e,o,true))end\nend\n_p(1,'@echo \"\"')_p(1,'@echo \"TARGETS:\"')_p(1,'@echo \" all (default)\"')_p(1,'@echo \" clean\"')for o,e in ipairs(e.projects)do\n_p(1,'@echo \" %s\"',e.name)end\n_p(1,'@echo \"\"')_p(1,'@echo \"For more information, see http://industriousone.com/premake/quick-start\"')end", /* actions/make/make_cpp.lua */ "premake.make.cpp={}local p=premake.make.cpp\nlocal i=premake.make\nfunction premake.make_cpp(e)local i=premake.gettool(e)local n=premake.filterplatforms(e.solution,i.platforms,\"Native\")premake.gmake_cpp_header(e,i,n)for n,p in ipairs(n)do\nfor e in premake.eachconfig(e,p)do\npremake.gmake_cpp_config(e,i)end\nend\n_p('OBJECTS := \\\\')for p,e in ipairs(e.files)do\nif path.iscppfile(e)then\n_p('\\t$(OBJDIR)/%s.o \\\\',_MAKE.esc(path.getbasename(e)))end\nend\n_p('')_p('RESOURCES := \\\\')for p,e in ipairs(e.files)do\nif path.isresourcefile(e)then\n_p('\\t$(OBJDIR)/%s.res \\\\',_MAKE.esc(path.getbasename(e)))end\nend\n_p('')_p('SHELLTYPE := msdos')_p('ifeq (,$(ComSpec)$(COMSPEC))')_p(' SHELLTYPE := posix')_p('endif')_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')_p(' SHELLTYPE := posix')_p('endif')_p('')_p('.PHONY: clean prebuild prelink')_p('')if os.is(\"MacOSX\")and e.kind==\"WindowedApp\"then\n_p('all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')" "else\n_p('all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)')end\n_p('\\t@:')_p('')_p('$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)')_p('\\t@echo Linking %s',e.name)_p('\\t$(SILENT) $(LINKCMD)')_p('\\t$(POSTBUILDCMDS)')_p('')_p('$(TARGETDIR):')premake.make_mkdirrule(\"$(TARGETDIR)\")_p('$(OBJDIR):')premake.make_mkdirrule(\"$(OBJDIR)\")if os.is(\"MacOSX\")and e.kind==\"WindowedApp\"then\n_p('$(dir $(TARGETDIR))PkgInfo:')_p('$(dir $(TARGETDIR))Info.plist:')_p('')end\n_p('clean:')_p('\\t@echo Cleaning %s',e.name)_p('ifeq (posix,$(SHELLTYPE))')_p('\\t$(SILENT) rm -f $(TARGET)')_p('\\t$(SILENT) rm -rf $(OBJDIR)')_p('else')_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')_p('endif')_p('')_p('prebuild:')_p('\\t$(PREBUILDCMDS)')_p('')_p('prelink:')_p('\\t$(PRELINKCMDS)')_p('')p.pchrules(e)p.fileRules(e)_p('-include $(OBJECTS:%%.o=%%.d)')_p('ifneq (,$(PCH))')_p(' -in" "clude $(OBJDIR)/$(notdir $(PCH)).d')_p('endif')end\nfunction premake.gmake_cpp_header(p,e,i)_p('# %s project makefile autogenerated by Premake',premake.action.current().shortname)_p('ifndef config')_p(' config=%s',_MAKE.esc(premake.getconfigname(p.solution.configurations[1],i[1],true)))_p('endif')_p('')_p('ifndef verbose')_p(' SILENT = @')_p('endif')_p('')_p('CC = %s',e.cc)_p('CXX = %s',e.cxx)_p('AR = %s',e.ar)_p('')_p('ifndef RESCOMP')_p(' ifdef WINDRES')_p(' RESCOMP = $(WINDRES)')_p(' else')_p(' RESCOMP = windres')_p(' endif')_p('endif')_p('')end\nfunction premake.gmake_cpp_config(e,n)_p('ifeq ($(config),%s)',_MAKE.esc(e.shortname))p.platformtools(e,n)_p(' OBJDIR = %s',_MAKE.esc(e.objectsdir))_p(' TARGETDIR = %s',_MAKE.esc(e.buildtarget.directory))_p(' TARGET = $(TARGETDIR)/%s',_MAKE.esc(e.buildtarget.name))_p(' DEFINES +=%s',i.list(n.getdefines(e.defines)))_p(' INCLUDES +=%s',i.list(n.getincludedirs(e.includedirs)))p.pchconfig(e)p.flags(e,n)p.linker(e,n)_p(' define PREBUILDCMDS'" ")if#e.prebuildcommands>0 then\n_p('\\t@echo Running pre-build commands')_p('\\t%s',table.implode(e.prebuildcommands,\"\",\"\",\"\\n\\t\"))end\n_p(' endef')_p(' define PRELINKCMDS')if#e.prelinkcommands>0 then\n_p('\\t@echo Running pre-link commands')_p('\\t%s',table.implode(e.prelinkcommands,\"\",\"\",\"\\n\\t\"))end\n_p(' endef')_p(' define POSTBUILDCMDS')if#e.postbuildcommands>0 then\n_p('\\t@echo Running post-build commands')_p('\\t%s',table.implode(e.postbuildcommands,\"\",\"\",\"\\n\\t\"))end\n_p(' endef')i.settings(e,n)_p('endif')_p('')end\nfunction p.platformtools(e,p)local e=p.platforms[e.platform]if e.cc then\n_p(' CC = %s',e.cc)end\nif e.cxx then\n_p(' CXX = %s',e.cxx)end\nif e.ar then\n_p(' AR = %s',e.ar)end\nend\nfunction p.flags(e,p)if e.pchheader and not e.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')end\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)',table.concat(p.getcppflags(e),\" \"))_p(' ALL_CFLAGS += $(CFLAGS)" " $(ALL_CPPFLAGS)%s',i.list(table.join(p.getcflags(e),e.buildoptions)))_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)%s',i.list(p.getcxxflags(e)))_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',i.list(table.join(p.getdefines(e.resdefines),p.getincludedirs(e.resincludedirs),e.resoptions)))end\nfunction p.linker(e,p)_p(' ALL_LDFLAGS += $(LDFLAGS)%s',i.list(table.join(p.getlibdirflags(e),p.getldflags(e),e.linkoptions)))_p(' LDDEPS +=%s',i.list(_MAKE.esc(premake.getlinks(e,\"siblings\",\"fullpath\"))))_p(' LIBS += $(LDDEPS)%s',i.list(p.getlinkflags(e)))if e.kind==\"StaticLib\"then\nif e.platform:startswith(\"Universal\")then\n_p(' LINKCMD = libtool -o $(TARGET) $(OBJECTS)')else\n_p(' LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)')end\nelse\nlocal e=iif(e.language==\"C\",\"CC\",\"CXX\")_p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)',e)end\nend\nfunction p.pchconfig(e)if not e.pchheader or e.flags.NoPCH then\nreturn\nend\nlocal p=e.pchheader\nfor n" ",i in ipairs(e.includedirs)do\nlocal i=path.getabsolute(path.join(e.project.location,i))local i=path.join(i,p)if os.isfile(i)then\np=path.getrelative(e.location,i)break\nend\nend\n_p(' PCH = %s',_MAKE.esc(p))_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')end\nfunction p.pchrules(e)_p('ifneq (,$(PCH))')_p('.NOTPARALLEL: $(GCH) $(PCH)')_p('$(GCH): $(PCH)')_p('\\t@echo $(notdir $<)')local e=iif(e.language==\"C\",\"$(CC) -x c-header $(ALL_CFLAGS)\",\"$(CXX) -x c++-header $(ALL_CXXFLAGS)\")_p('\\t$(SILENT) %s -MMD -MP $(DEFINES) $(INCLUDES) -o \"$@\" -MF \"$(@:%%.gch=%%.d)\" -c \"$<\"',e)_p('endif')_p('')end\nfunction p.fileRules(e)for i,e in ipairs(e.files or{})do\nif path.iscppfile(e)then\n_p('$(OBJDIR)/%s.o: %s',_MAKE.esc(path.getbasename(e)),_MAKE.esc(e))_p('\\t@echo $(notdir $<)')p.buildcommand(path.iscfile(e),\"o\")_p('')elseif(path.getextension(e)==\".rc\")then\n_p('$(OBJDIR)/%s.res: %s',_MAKE.esc(path.getbasename(e)),_MAKE.esc(e))_p('\\t@echo $(notdir $<)')_p('\\t$(SILENT) $(RESCOMP) $< -O coff " "-o \"$@\" $(ALL_RESFLAGS)')_p('')end\nend\nend\nfunction p.buildcommand(e,p)local e=iif(e,'$(CC) $(ALL_CFLAGS)','$(CXX) $(ALL_CXXFLAGS)')_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -MF \"$(@:%%.%s=%%.d)\" -c \"$<\"',e,p)end", /* actions/make/make_csharp.lua */ "local function o(n,e)if path.getextension(e)==\".resx\"then\nlocal n=n.buildtarget.basename..\".\"local i=path.getdirectory(e)if i~=\".\"then\nn=n..path.translate(i,\".\")..\".\"end\nreturn\"$(OBJDIR)/\".._MAKE.esc(n..path.getbasename(e))..\".resources\"else\nreturn e\nend\nend\nfunction premake.make_csharp(e)local p=premake.dotnet\nlocal s={}local i={}local l\nfor e in premake.eachconfig(e)do\nl=e\ns[e]=premake.getlinks(e,\"siblings\",\"fullpath\")i[e]={}for p,n in ipairs(s[e])do\nif path.getdirectory(n)~=e.buildtarget.directory then\ni[e][\"$(TARGETDIR)/\".._MAKE.esc(path.getname(n))]=_MAKE.esc(n)end\nend\nend\nlocal r={}local a={}local n={}for e in premake.project.eachfile(e)do\nlocal i=p.getbuildaction(e)if i==\"Compile\"then\ntable.insert(r,e.name)elseif i==\"EmbeddedResource\"then\ntable.insert(a,e.name)elseif i==\"Content\"then\nn[\"$(TARGETDIR)/\".._MAKE.esc(path.getname(e.name))]=_MAKE.esc(e.name)elseif path.getname(e.name):lower()==\"app.config\"then\nn[\"$(TARGET).config\"]=_MAKE.esc(e.name)end\nend" "\nlocal t=table.translate(e.libdirs,function(n)return path.join(e.basedir,n)end)t=table.join({e.basedir},t)for p,i in ipairs(premake.getlinks(e,\"system\",\"fullpath\"))do\nlocal p=os.pathsearch(i..\".dll\",unpack(t))if(p)then\nlocal t=\"$(TARGETDIR)/\".._MAKE.esc(path.getname(i))local e=path.getrelative(e.basedir,path.join(p,i))..\".dll\"n[t]=_MAKE.esc(e)end\nend\n_p('# %s project makefile autogenerated by Premake',premake.action.current().shortname)_p('')_p('ifndef config')_p(' config=%s',_MAKE.esc(e.configurations[1]:lower()))_p('endif')_p('')_p('ifndef verbose')_p(' SILENT = @')_p('endif')_p('')_p('ifndef CSC')_p(' CSC=%s',p.getcompilervar(e))_p('endif')_p('')_p('ifndef RESGEN')_p(' RESGEN=resgen')_p('endif')_p('')local t=premake.filterplatforms(e.solution,premake[_OPTIONS.cc].platforms)table.insert(t,1,\"\")for e in premake.eachconfig(e)do\npremake.gmake_cs_config(e,p,s)end\n_p('# To maintain compatibility with VS.NET, these values must be set at the project level')_p('TARGET := $(TARGETDIR)/%s',_" "MAKE.esc(e.buildtarget.name))_p('FLAGS += /t:%s %s',p.getkind(e):lower(),table.implode(_MAKE.esc(e.libdirs),\"/lib:\",\"\",\" \"))_p('REFERENCES += %s',table.implode(_MAKE.esc(premake.getlinks(e,\"system\",\"basename\")),\"/r:\",\".dll\",\" \"))_p('')_p('SOURCES := \\\\')for n,e in ipairs(r)do\n_p('\\t%s \\\\',_MAKE.esc(path.translate(e)))end\n_p('')_p('EMBEDFILES := \\\\')for i,n in ipairs(a)do\n_p('\\t%s \\\\',o(e,n))end\n_p('')_p('COPYFILES += \\\\')for e,n in pairs(i[l])do\n_p('\\t%s \\\\',e)end\nfor e,n in pairs(n)do\n_p('\\t%s \\\\',e)end\n_p('')_p('SHELLTYPE := msdos')_p('ifeq (,$(ComSpec)$(COMSPEC))')_p(' SHELLTYPE := posix')_p('endif')_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')_p(' SHELLTYPE := posix')_p('endif')_p('')_p('.PHONY: clean prebuild prelink')_p('')_p('all: $(TARGETDIR) $(OBJDIR) prebuild $(EMBEDFILES) $(COPYFILES) prelink $(TARGET)')_p('')_p('$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS)')_p('\\t$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) $(SOURCES) $(patsubst %%,/res" "ource:%%,$(EMBEDFILES))')_p('\\t$(POSTBUILDCMDS)')_p('')_p('$(TARGETDIR):')premake.make_mkdirrule(\"$(TARGETDIR)\")_p('$(OBJDIR):')premake.make_mkdirrule(\"$(OBJDIR)\")_p('clean:')_p('\\t@echo Cleaning %s',e.name)_p('ifeq (posix,$(SHELLTYPE))')_p('\\t$(SILENT) rm -f $(TARGETDIR)/%s.* $(COPYFILES)',e.buildtarget.basename)_p('\\t$(SILENT) rm -rf $(OBJDIR)')_p('else')_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*) del $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*)',e.buildtarget.basename,e.buildtarget.basename)for e,n in pairs(i[l])do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)',e,e)end\nfor e,n in pairs(n)do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)',e,e)end\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')_p('endif')_p('')_p('prebuild:')_p('\\t$(PREBUILDCMDS)')_p('')_p('prelink:')_p('\\t$(PRELINKCMDS)')_p('')_p('# Per-configuration copied file rules')for e in premake.eachconfig(e)do\n_p(" "'ifneq (,$(findstring %s,$(config)))',_MAKE.esc(e.name:lower()))for e,n in pairs(i[e])do\npremake.make_copyrule(n,e)end\n_p('endif')_p('')end\n_p('# Copied file rules')for e,n in pairs(n)do\npremake.make_copyrule(n,e)end\n_p('# Embedded file rules')for i,n in ipairs(a)do\nif path.getextension(n)==\".resx\"then\n_p('%s: %s',o(e,n),_MAKE.esc(n))_p('\\t$(SILENT) $(RESGEN) $^ $@')end\n_p('')end\nend\nfunction premake.gmake_cs_config(e,i,n)_p('ifneq (,$(findstring %s,$(config)))',_MAKE.esc(e.name:lower()))_p(' TARGETDIR := %s',_MAKE.esc(e.buildtarget.directory))_p(' OBJDIR := %s',_MAKE.esc(e.objectsdir))_p(' DEPENDS := %s',table.concat(_MAKE.esc(premake.getlinks(e,\"dependencies\",\"fullpath\")),\" \"))_p(' REFERENCES := %s',table.implode(_MAKE.esc(n[e]),\"/r:\",\"\",\" \"))_p(' FLAGS += %s %s',table.implode(e.defines,\"/d:\",\"\",\" \"),table.concat(table.join(i.getflags(e),e.buildoptions),\" \"))_p(' define PREBUILDCMDS')if#e.prebuildcommands>0 then\n_p('\\t@echo Running pre-build commands')_p(" "'\\t%s',table.implode(e.prebuildcommands,\"\",\"\",\"\\n\\t\"))end\n_p(' endef')_p(' define PRELINKCMDS')if#e.prelinkcommands>0 then\n_p('\\t@echo Running pre-link commands')_p('\\t%s',table.implode(e.prelinkcommands,\"\",\"\",\"\\n\\t\"))end\n_p(' endef')_p(' define POSTBUILDCMDS')if#e.postbuildcommands>0 then\n_p('\\t@echo Running post-build commands')_p('\\t%s',table.implode(e.postbuildcommands,\"\",\"\",\"\\n\\t\"))end\n_p(' endef')_p('endif')_p('')end", /* actions/vstudio/_vstudio.lua */ "premake.vstudio={}local e=premake.vstudio\ne.platforms={any=\"Any CPU\",mixed=\"Mixed Platforms\",Native=\"Win32\",x86=\"x86\",x32=\"Win32\",x64=\"x64\",PS3=\"PS3\",Xbox360=\"Xbox 360\",Itanium=\"Itanium\",ARM=\"ARM\",ARM64=\"ARM64\",}function e.arch(e)if(e.language==\"C#\")then\nif(_ACTION<\"vs2005\")then\nreturn\".NET\"else\nreturn\"Any CPU\"end\nelse\nreturn\"Win32\"end\nend\nfunction e.buildconfigs(r)local s={}local n=premake.filterplatforms(r,e.platforms,\"Native\")local t=premake.hascppproject(r)local a=premake.hasdotnetproject(r)if a and(_ACTION>\"vs2008\"or t)then\ntable.insert(n,1,\"mixed\")end\nif a and(_ACTION<\"vs2010\"or not t)then\ntable.insert(n,1,\"any\")end\nif _ACTION>\"vs2008\"then\nlocal r={}for s,o in ipairs(n)do\nif e.platforms[o]==\"Win32\"then\nif t then\ntable.insert(r,o)end\nif a then\ntable.insert(r,\"x86\")end\nelse\ntable.insert(r,o)end\nend\nn=r\nend\nfor r,t in ipairs(r.configurations)do\nfor n,r in ipairs(n)do\nlocal n={}n.src_buildcfg=t\nn.src_platform=r\nif r~=\"PS3\"or _ACTIO" "N>\"vs2008\"then\nn.buildcfg=t\nn.platform=e.platforms[r]else\nn.buildcfg=r..\" \"..t\nn.platform=\"Win32\"end\nn.name=n.buildcfg..\"|\"..n.platform\nn.isreal=(r~=\"any\"and r~=\"mixed\")table.insert(s,n)end\nend\nreturn s\nend\nfunction e.cleansolution(e)premake.clean.file(e,\"%%.sln\")premake.clean.file(e,\"%%.suo\")premake.clean.file(e,\"%%.ncb\")premake.clean.file(e,\"%%.userprefs\")premake.clean.file(e,\"%%.usertasks\")end\nfunction e.cleanproject(e)local e=premake.project.getfilename(e,\"%%\")os.remove(e..\".vcproj\")os.remove(e..\".vcxproj\")os.remove(e..\".vcxproj.filters\")os.remove(e..\".csproj\")os.remove(e..\".pidb\")os.remove(e..\".sdf\")if _OPTIONS.generate_user then\nos.remove(e..\".vcproj.user\")os.remove(e..\".vcxproj.user\")os.remove(e..\".csproj.user\")end\nend\nfunction e.cleantarget(e)os.remove(e..\".pdb\")os.remove(e..\".idb\")os.remove(e..\".ilk\")os.remove(e..\".vshost.exe\")os.remove(e..\".exe.manifest\")end\nfunction e.projectfile(n)local e\nif n.language==\"C#\"then\ne=\"%%.csproj\"e" "lse\ne=iif(_ACTION>\"vs2008\",\"%%.vcxproj\",\"%%.vcproj\")end\nlocal e=premake.project.getbasename(n.name,e)e=path.join(n.location,e)return e\nend\nfunction e.tool(e)if(e.language==\"C#\")then\nreturn\"FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\"else\nreturn\"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"end\nend\nnewaction{trigger=\"vs2002\",shortname=\"Visual Studio 2002\",description=\"Generate Microsoft Visual Studio 2002 project files\",os=\"windows\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\",\"C#\"},valid_tools={cc={\"msc\"},dotnet={\"msnet\"},},onsolution=function(n)premake.generate(n,\"%%.sln\",e.sln2002.generate)end,onproject=function(n)if premake.isdotnetproject(n)then\npremake.generate(n,\"%%.csproj\",e.cs2002.generate)if _OPTIONS.generate_user then\npremake.generate(n,\"%%.csproj.user\",e.cs2002.generate_user)end\nelse\npremake.generate(n,\"%%.vcproj\",e.vc200x.generate)if _OPTIONS.generate_user then\npremake.generate(n,\"%%.vcproj.user\",e.vc200x.ge" "nerate_user)end\nend\nend,oncleansolution=premake.vstudio.cleansolution,oncleanproject=premake.vstudio.cleanproject,oncleantarget=premake.vstudio.cleantarget,vstudio={}}newaction{trigger=\"vs2003\",shortname=\"Visual Studio 2003\",description=\"Generate Microsoft Visual Studio 2003 project files\",os=\"windows\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\",\"C#\"},valid_tools={cc={\"msc\"},dotnet={\"msnet\"},},onsolution=function(n)premake.generate(n,\"%%.sln\",e.sln2003.generate)end,onproject=function(n)if premake.isdotnetproject(n)then\npremake.generate(n,\"%%.csproj\",e.cs2002.generate)if _OPTIONS.generate_user then\npremake.generate(n,\"%%.csproj.user\",e.cs2002.generate_user)end\nelse\npremake.generate(n,\"%%.vcproj\",e.vc200x.generate)if _OPTIONS.generate_user then\npremake.generate(n,\"%%.vcproj.user\",e.vc200x.generate_user)end\nend\nend,oncleansolution=premake.vstudio.cleansolution,oncleanproject=premake.vstudio.cleanproject,oncleantarget=prem" "ake.vstudio.cleantarget,vstudio={}}newaction{trigger=\"vs2005\",shortname=\"Visual Studio 2005\",description=\"Generate Microsoft Visual Studio 2005 project files\",os=\"windows\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\",\"C#\"},valid_tools={cc={\"msc\"},dotnet={\"msnet\"},},onsolution=function(n)premake.generate(n,\"%%.sln\",e.sln2005.generate)end,onproject=function(n)if premake.isdotnetproject(n)then\npremake.generate(n,\"%%.csproj\",e.cs2005.generate)if _OPTIONS.generate_user then\npremake.generate(n,\"%%.csproj.user\",e.cs2005.generate_user)end\nelse\npremake.generate(n,\"%%.vcproj\",e.vc200x.generate)if _OPTIONS.generate_user then\npremake.generate(n,\"%%.vcproj.user\",e.vc200x.generate_user)end\nend\nend,oncleansolution=e.cleansolution,oncleanproject=e.cleanproject,oncleantarget=e.cleantarget,vstudio={productVersion=\"8.0.50727\",solutionVersion=\"9\",}}newaction{trigger=\"vs2008\",shortname=\"Visual Studio 2008\",description=\"Generate Micro" "soft Visual Studio 2008 project files\",os=\"windows\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\",\"C#\"},valid_tools={cc={\"msc\"},dotnet={\"msnet\"},},onsolution=function(n)premake.generate(n,\"%%.sln\",e.sln2005.generate)end,onproject=function(n)if premake.isdotnetproject(n)then\npremake.generate(n,\"%%.csproj\",e.cs2005.generate)if _OPTIONS.generate_user then\npremake.generate(n,\"%%.csproj.user\",e.cs2005.generate_user)end\nelse\npremake.generate(n,\"%%.vcproj\",e.vc200x.generate)if _OPTIONS.generate_user then\npremake.generate(n,\"%%.vcproj.user\",e.vc200x.generate_user)end\nend\nend,oncleansolution=e.cleansolution,oncleanproject=e.cleanproject,oncleantarget=e.cleantarget,vstudio={productVersion=\"9.0.21022\",solutionVersion=\"10\",toolsVersion=\"3.5\",}}newaction{trigger=\"vs2010\",shortname=\"Visual Studio 2010\",description=\"Generate Microsoft Visual Studio 2010 project files\",os=\"windows\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"St" "aticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\",\"C#\"},valid_tools={cc={\"msc\"},dotnet={\"msnet\"},},onsolution=function(n)premake.generate(n,\"%%.sln\",e.sln2005.generate)end,onproject=function(n)if premake.isdotnetproject(n)then\npremake.generate(n,\"%%.csproj\",e.cs2005.generate)if _OPTIONS.generate_user then\npremake.generate(n,\"%%.csproj.user\",e.cs2005.generate_user)end\nelse\npremake.generate(n,\"%%.vcxproj\",premake.vs2010_vcxproj)if _OPTIONS.generate_user then\npremake.generate(n,\"%%.vcxproj.user\",premake.vs2010_vcxproj_user)end\npremake.generate(n,\"%%.vcxproj.filters\",e.vc2010.generate_filters)end\nend,oncleansolution=premake.vstudio.cleansolution,oncleanproject=premake.vstudio.cleanproject,oncleantarget=premake.vstudio.cleantarget,vstudio={productVersion=\"8.0.30703\",solutionVersion=\"11\",targetFramework=\"4.0\",toolsVersion=\"4.0\",}}", /* actions/vstudio/vs2002_solution.lua */ "premake.vstudio.sln2002={}local i=premake.vstudio\nlocal o=premake.vstudio.sln2002\nfunction o.generate(o)io.indent=nil\nio.eol='\\r\\n'o.vstudio_configs=premake.vstudio.buildconfigs(o)_p('Microsoft Visual Studio Solution File, Format Version 7.00')for n in premake.solution.eachproject(o)do\nlocal o=path.translate(path.getrelative(o.location,i.projectfile(n)))_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"',i.tool(n),n.name,o,n.uuid)_p('EndProject')end\n_p('Global')_p(1,'GlobalSection(SolutionConfiguration) = preSolution')for o,i in ipairs(o.configurations)do\n_p(2,'ConfigName.%d = %s',o-1,i)end\n_p(1,'EndGlobalSection')_p(1,'GlobalSection(ProjectDependencies) = postSolution')_p(1,'EndGlobalSection')_p(1,'GlobalSection(ProjectConfiguration) = postSolution')for n in premake.solution.eachproject(o)do\nfor t,o in ipairs(o.configurations)do\n_p(2,'{%s}.%s.ActiveCfg = %s|%s',n.uuid,o,o,i.arch(n))_p(2,'{%s}.%s.Build.0 = %s|%s',n.uuid,o,o,i.arch(n))end\nend\n_p(1,'EndGlobalSection')_p(1,'GlobalSection(ExtensibilityG" "lobals) = postSolution')_p(1,'EndGlobalSection')_p(1,'GlobalSection(ExtensibilityAddIns) = postSolution')_p(1,'EndGlobalSection')_p('EndGlobal')end", /* actions/vstudio/vs2002_csproj.lua */ "premake.vstudio.cs2002={}local s=premake.vstudio\nlocal a=premake.vstudio.cs2002\nlocal function n(a,t,e)if t==\"Compile\"and e:endswith(\".cs\")then\nreturn\"SubTypeCode\"end\nif t==\"EmbeddedResource\"and e:endswith(\".resx\")then\nlocal e=e:sub(1,-6)local e=path.getname(e..\".cs\")if premake.findfile(a,e)then\nreturn\"Dependency\",e\nend\nend\nreturn\"None\"end\nfunction a.Files(a)local e=premake.project.buildsourcetree(a)premake.tree.traverse(e,{onleaf=function(e)local t=premake.dotnet.getbuildaction(e.cfg)local s=path.translate(premake.esc(e.cfg.name),\"\\\\\")local a,e=n(a,t,e.path)_p(4,'')end},false)end\nfunction a.generate(t)io.eol=\"\\r\\n\"_p('')_p(1,'')_p(2,'')_p(3,'')for e in premake.eachconfig(t)do\n_p(4,'')end\n_p(3,'')_p(3,'')for t,e in ipairs(premake.getlinks(t,\"siblings\",\"object\"))do\n_p(4,'')end\nfor t,e in ipairs(premake.getlinks(t,\"system\",\"fullpath\"))do\n_p(4,'')end\n_p(3,'')_p(2,'')_p(2,'')_p(3,'')a.Files(t)_p(3,'')_p(2,'')_p(1,'')_p('')end", /* actions/vstudio/vs2002_csproj_user.lua */ "local e=premake.vstudio.cs2002\nfunction e.generate_user(e)io.eol=\"\\r\\n\"_p('')_p(1,'')_p(2,'')local t=table.translate(e.libdirs,function(t)return path.getabsolute(e.location..\"/\"..t)end)_p(3,'',path.translate(table.concat(t,\";\"),\"\\\\\"))for e in premake.eachconfig(e)do\n_p(4,'')end\n_p(3,'')_p(2,'')_p(2,'')_p(1,'')_p('')end", /* actions/vstudio/vs200x_vcproj.lua */ "premake.vstudio.vc200x={}local e=premake.vstudio.vc200x\nlocal d=premake.tree\nlocal function i(e)if(_ACTION<\"vs2005\")then\nreturn iif(e,\"TRUE\",\"FALSE\")else\nreturn iif(e,\"true\",\"false\")end\nend\nfunction e.optimization(o)local e=0\nfor i,o in ipairs(o.flags)do\nif(o==\"Optimize\")then\ne=3\nelseif(o==\"OptimizeSize\")then\ne=1\nelseif(o==\"OptimizeSpeed\")then\ne=2\nend\nend\nreturn e\nend\nfunction e.header(e)io.eol=\"\\r\\n\"_p('')_p('<%s',e)_p(1,'ProjectType=\"Visual C++\"')if _ACTION==\"vs2002\"then\n_p(1,'Version=\"7.00\"')elseif _ACTION==\"vs2003\"then\n_p(1,'Version=\"7.10\"')elseif _ACTION==\"vs2005\"then\n_p(1,'Version=\"8.00\"')elseif _ACTION==\"vs2008\"then\n_p(1,'Version=\"9.00\"')end\nend\nfunction e.Configuration(i,o)_p(2,'')end\ne.individualSourceFileOptions=nil\nfunction e.individualSourceFile(i,o,t,s)for n,l in ipairs(i.solution.vstudio_configs)do\nif l.isreal then\nlocal n=premake.getconfig(i,l.src_buildcfg,l.src_platform)local r=(not i.flags.NoPCH and i.pchsource==s.cfg.name)local p=path.iscppfile(t)local a=(path.iscfile(t)~=premake.project.iscproject(i))if r or(p and a)or(type(e.individualSourceFileOptions)=='function')then\n_p(o,'')_p(o,'\\t')_p(o,'')end\nend\nend\nend\nfunction e.Files(i)local o=premake.project.buildsourcetree(i)d.traverse(o,{onbranchenter=function(o,e)_p(e,'')end,onbranchexit=function(o,e)_p(e,'')end,onleaf=function(n,o)local t=n.cfg.name\n_p(o,'')o=o+1\ne.individualSourceFile(i,o,t,n)o=o-1\n_p(o,'')end,},false,2)end\nfunction e.Platforms(e)local o={}_p(1,'')for i,e in ipairs(e.solution.vstud" "io_configs)do\nif e.isreal and not table.contains(o,e.platform)then\ntable.insert(o,e.platform)_p(2,'')end\nend\n_p(1,'')end\nfunction e.Symbols(o)if(not o.flags.Symbols)then\nreturn 0\nelse\nif o.flags.NoEditAndContinue or\ne.optimization(o)~=0 or\no.flags.Managed or\no.platform==\"x64\"then\nreturn 3\nelse\nreturn 4\nend\nend\nend\nfunction e.VCCLCompilerTool(o)_p(3,'0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(o.buildoptions),\" \"))end\n_p(4,'Optimization=\"%s\"',e.optimization(o))if o.flags.NoFramePointer then\n_p(4,'OmitFramePointers=\"%s\"',i(true))end\nif#o.includedirs>0 then\n_p(4,'AdditionalIncludeDirectories=\"%s\"',premake.esc(path.translate(table.concat(o.includedirs,\";\"),'\\\\')))end\nif#o.defines>0 then\n_p(4,'PreprocessorDefinitions=\"%s\"',premake.esc(table.concat(o.defines,\";\")))end\nif prema" "ke.config.isdebugbuild(o)and not o.flags.NoMinimalRebuild and not o.flags.Managed then\n_p(4,'MinimalRebuild=\"%s\"',i(true))end\nif o.flags.NoExceptions then\n_p(4,'ExceptionHandling=\"%s\"',iif(_ACTION<\"vs2005\",\"FALSE\",0))elseif o.flags.SEH and _ACTION>\"vs2003\"then\n_p(4,'ExceptionHandling=\"2\"')end\nif e.optimization(o)==0 and not o.flags.Managed then\n_p(4,'BasicRuntimeChecks=\"3\"')end\nif e.optimization(o)~=0 then\n_p(4,'StringPooling=\"%s\"',i(true))end\nlocal n\nif premake.config.isdebugbuild(o)then\nn=iif(o.flags.StaticRuntime,1,3)else\nn=iif(o.flags.StaticRuntime,0,2)end\n_p(4,'RuntimeLibrary=\"%s\"',n)_p(4,'EnableFunctionLevelLinking=\"%s\"',i(true))if _ACTION>\"vs2003\"and o.platform~=\"Xbox360\"and o.platform~=\"x64\"then\nif o.flags.EnableSSE then\n_p(4,'EnableEnhancedInstructionSet=\"1\"')elseif o.flags.EnableSSE2 then\n_p(4,'EnableEnhancedInstructionSet=\"2\"')end\nend\nif _ACTION<\"vs2005\"then\nif o.flags.FloatFast then\n_p(4,'ImproveFloatingPointConsistency=\"%s\"',i(false))elseif o.f" "lags.FloatStrict then\n_p(4,'ImproveFloatingPointConsistency=\"%s\"',i(true))end\nelse\nif o.flags.FloatFast then\n_p(4,'FloatingPointModel=\"2\"')elseif o.flags.FloatStrict then\n_p(4,'FloatingPointModel=\"1\"')end\nend\nif _ACTION<\"vs2005\"and not o.flags.NoRTTI then\n_p(4,'RuntimeTypeInfo=\"%s\"',i(true))elseif _ACTION>\"vs2003\"and o.flags.NoRTTI and not o.flags.Managed then\n_p(4,'RuntimeTypeInfo=\"%s\"',i(false))end\nif o.flags.NativeWChar then\n_p(4,'TreatWChar_tAsBuiltInType=\"%s\"',i(true))elseif o.flags.NoNativeWChar then\n_p(4,'TreatWChar_tAsBuiltInType=\"%s\"',i(false))end\nif not o.flags.NoPCH and o.pchheader then\n_p(4,'UsePrecompiledHeader=\"%s\"',iif(_ACTION<\"vs2005\",3,2))_p(4,'PrecompiledHeaderThrough=\"%s\"',o.pchheader)else\n_p(4,'UsePrecompiledHeader=\"%s\"',iif(_ACTION>\"vs2003\"or o.flags.NoPCH,0,2))end\n_p(4,'WarningLevel=\"%s\"',iif(o.flags.ExtraWarnings,4,3))if o.flags.FatalWarnings then\n_p(4,'WarnAsError=\"%s\"',i(true))end\nif _ACTION<\"vs2008\"and not o.flags.Managed then\n_p(4," "'Detect64BitPortabilityProblems=\"%s\"',i(not o.flags.No64BitChecks))end\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"',path.getbasename(o.buildtarget.name))_p(4,'DebugInformationFormat=\"%s\"',e.Symbols(o))if o.language==\"C\"then\n_p(4,'CompileAs=\"1\"')end\n_p(3,'/>')end\nfunction e.VCLinkerTool(o)_p(3,'0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(o.linkoptions),\" \"))end\nif#o.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(o,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',o.buildtarget.name)_p(4,'LinkIncremental=\"%s\"',iif(premake.config.isincrementallink(o),2,1))_p(4,'AdditionalLibraryDirectories=\"%s\"',table.concat(premake.esc(path.translate(o.libdirs,'\\\\')),\";\"))local n=premake.findfile(o,\".def\")i" "f n then\n_p(4,'ModuleDefinitionFile=\"%s\"',n)end\nif o.flags.NoManifest then\n_p(4,'GenerateManifest=\"%s\"',i(false))end\n_p(4,'GenerateDebugInformation=\"%s\"',i(e.Symbols(o)~=0))if e.Symbols(o)~=0 then\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"',path.getbasename(o.buildtarget.name))end\n_p(4,'SubSystem=\"%s\"',iif(o.kind==\"ConsoleApp\",1,2))if e.optimization(o)~=0 then\n_p(4,'OptimizeReferences=\"2\"')_p(4,'EnableCOMDATFolding=\"2\"')end\nif(o.kind==\"ConsoleApp\"or o.kind==\"WindowedApp\")and not o.flags.WinMain then\n_p(4,'EntryPointSymbol=\"%s\"',iif(o.flags.Unicode,\"wmainCRTStartup\",\"mainCRTStartup\"))end\nif o.kind==\"SharedLib\"then\nlocal e=o.linktarget.fullpath\n_p(4,'ImportLibrary=\"%s\"',iif(o.flags.NoImportLib,o.objectsdir..\"\\\\\"..path.getname(e),e))end\n_p(4,'TargetMachine=\"%d\"',iif(o.platform==\"x64\",17,1))else\n_p(4,'Name=\"VCLibrarianTool\"')if#o.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(o,\"all\",\"fullpath\"),\" \"))end\n_p(4,'O" "utputFile=\"$(OutDir)\\\\%s\"',o.buildtarget.name)if#o.libdirs>0 then\n_p(4,'AdditionalLibraryDirectories=\"%s\"',premake.esc(path.translate(table.concat(o.libdirs,\";\"))))end\nlocal e={}if o.platform==\"x32\"then\ntable.insert(e,\"/MACHINE:X86\")elseif o.platform==\"x64\"then\ntable.insert(e,\"/MACHINE:X64\")end\ne=table.join(e,o.linkoptions)if#e>0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e),\" \"))end\nend\n_p(3,'/>')end\nfunction e.VCCLCompilerTool_PS3(e)_p(3,'\"vs2003\"or e.flags.NoPCH,0,2))end\n_p(4,'AdditionalOptions=\"%s\"',premake.esc(table.concat(o,\" \")))if#e.includedirs>0 th" "en\n_p(4,'AdditionalIncludeDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.includedirs,\";\"),'\\\\')))end\nif#e.defines>0 then\n_p(4,'PreprocessorDefinitions=\"%s\"',table.concat(premake.esc(e.defines),\";\"))end\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"',path.getbasename(e.buildtarget.name))_p(4,'DebugInformationFormat=\"0\"')_p(4,'CompileAs=\"0\"')_p(3,'/>')end\nfunction e.VCLinkerTool_PS3(e)_p(3,'0 then\n_p(4,'AdditionalOptions=\"%s\"',premake.esc(table.concat(o,\" \")))end\nif#e.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(e,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',e.buildtarget.name)_p(4,'LinkIncremental=\"0\"')_p(4,'AdditionalLibraryDirectories=\"%s\"',table.concat(premake.esc(path.translate(e.libdirs,'\\\\')),\";\"))_p(4,'GenerateManifest=\"%s\"',i(false))_p(4,'ProgramDatabaseFile=" "\"\"')_p(4,'RandomizedBaseAddress=\"1\"')_p(4,'DataExecutionPrevention=\"0\"')else\n_p(4,'Name=\"VCLibrarianTool\"')local o=table.join(premake.snc.getldflags(e),e.linkoptions)if#o>0 then\n_p(4,'AdditionalOptions=\"%s\"',premake.esc(table.concat(o,\" \")))end\nif#e.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(e,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',e.buildtarget.name)if#e.libdirs>0 then\n_p(4,'AdditionalLibraryDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.libdirs,\";\"))))end\nend\n_p(3,'/>')end\nfunction e.VCResourceCompilerTool(e)_p(3,'0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.resoptions),\" \"))end\nif#e.defines>0 or#e.resdefines>0 then\n_p(4,'PreprocessorDefinitions=\"%s\"',table.concat(premake.esc(table.join(e.defines,e.resdefines)),\";\"))end\nif#e.includedirs>0 or#e.resincludedirs>0 then\nlocal e=table.join(e.includedirs,e.resincluded" "irs)_p(4,'AdditionalIncludeDirectories=\"%s\"',premake.esc(path.translate(table.concat(e,\";\"),'\\\\')))end\n_p(3,'/>')end\nfunction e.VCManifestTool(o)local e={}for i,o in ipairs(o.files)do\nif path.getextension(o)==\".manifest\"then\ntable.insert(e,o)end\nend\n_p(3,'0 then\n_p(4,'AdditionalManifestFiles=\"%s\"',premake.esc(table.concat(e,\";\")))end\n_p(3,'/>')end\nfunction e.VCMIDLTool(e)_p(3,'')end\nfunction e.buildstepsblock(i,o)_p(3,'0 then\n_p(4,'CommandLine=\"%s\"',premake.esc(table.implode(o,\"\",\"\",\"\\r\\n\")))end\n_p(3,'/>')end\ne.toolmap={VCCLCompilerTool=e.VCCLCompilerTool,VCCLCompilerTool_PS3=e.VCCLCompilerTool_PS3,VCLinkerTool=e.VCLinkerTool,VCLinkerTool_PS3=e.VCLinkerTool_PS3,VCManifestTool=e.VCManifestTool,VCMIDLTool=e.VCMIDLTool,VCResourceCompilerTool=e.VCResourceCompilerTool,VCPreBuildEventTool=function(o)e.b" "uildstepsblock(\"VCPreBuildEventTool\",o.prebuildcommands)end,VCPreLinkEventTool=function(o)e.buildstepsblock(\"VCPreLinkEventTool\",o.prelinkcommands)end,VCPostBuildEventTool=function(o)e.buildstepsblock(\"VCPostBuildEventTool\",o.postbuildcommands)end,}local function t(o,e)if o==\"vs2002\"then\nreturn{\"VCCLCompilerTool\",\"VCCustomBuildTool\",\"VCLinkerTool\",\"VCMIDLTool\",\"VCPostBuildEventTool\",\"VCPreBuildEventTool\",\"VCPreLinkEventTool\",\"VCResourceCompilerTool\",\"VCWebServiceProxyGeneratorTool\",\"VCWebDeploymentTool\"}end\nif o==\"vs2003\"then\nreturn{\"VCCLCompilerTool\",\"VCCustomBuildTool\",\"VCLinkerTool\",\"VCMIDLTool\",\"VCPostBuildEventTool\",\"VCPreBuildEventTool\",\"VCPreLinkEventTool\",\"VCResourceCompilerTool\",\"VCWebServiceProxyGeneratorTool\",\"VCXMLDataGeneratorTool\",\"VCWebDeploymentTool\",\"VCManagedWrapperGeneratorTool\",\"VCAuxiliaryManagedWrapperGeneratorTool\"}end\nif e==\"Xbox360\"then\nreturn{\"VCPreBuildEventTool\",\"VCCustomBuildTool\",\"VCXMLDataGeneratorTool\",\"VCWebS" "erviceProxyGeneratorTool\",\"VCMIDLTool\",\"VCCLCompilerTool\",\"VCManagedResourceCompilerTool\",\"VCResourceCompilerTool\",\"VCPreLinkEventTool\",\"VCLinkerTool\",\"VCALinkTool\",\"VCX360ImageTool\",\"VCBscMakeTool\",\"VCX360DeploymentTool\",\"VCPostBuildEventTool\",\"DebuggerTool\",}end\nif e==\"PS3\"then\nreturn{\"VCPreBuildEventTool\",\"VCCustomBuildTool\",\"VCXMLDataGeneratorTool\",\"VCWebServiceProxyGeneratorTool\",\"VCMIDLTool\",\"VCCLCompilerTool_PS3\",\"VCManagedResourceCompilerTool\",\"VCResourceCompilerTool\",\"VCPreLinkEventTool\",\"VCLinkerTool_PS3\",\"VCALinkTool\",\"VCManifestTool\",\"VCXDCMakeTool\",\"VCBscMakeTool\",\"VCFxCopTool\",\"VCAppVerifierTool\",\"VCWebDeploymentTool\",\"VCPostBuildEventTool\"}else\nreturn{\"VCPreBuildEventTool\",\"VCCustomBuildTool\",\"VCXMLDataGeneratorTool\",\"VCWebServiceProxyGeneratorTool\",\"VCMIDLTool\",\"VCCLCompilerTool\",\"VCManagedResourceCompilerTool\",\"VCResourceCompilerTool\",\"VCPreLinkEventTool\",\"VCLinkerTool\",\"VCALinkTool\",\"VCManifestTool\",\"VC" "XDCMakeTool\",\"VCBscMakeTool\",\"VCFxCopTool\",\"VCAppVerifierTool\",\"VCWebDeploymentTool\",\"VCPostBuildEventTool\"}end\nend\nfunction e.generate(i)e.header('VisualStudioProject')_p(1,'Name=\"%s\"',premake.esc(i.name))_p(1,'ProjectGUID=\"{%s}\"',i.uuid)if _ACTION>\"vs2003\"then\n_p(1,'RootNamespace=\"%s\"',i.name)end\n_p(1,'Keyword=\"%s\"',iif(i.flags.Managed,\"ManagedCProj\",\"Win32Proj\"))_p(1,'>')e.Platforms(i)if _ACTION>\"vs2003\"then\n_p(1,'')_p(1,'')end\n_p(1,'')for o,n in ipairs(i.solution.vstudio_configs)do\nif n.isreal then\nlocal o=premake.getconfig(i,n.src_buildcfg,n.src_platform)e.Configuration(n.name,o)for n,i in ipairs(t(_ACTION,n.src_platform))do\nif e.toolmap[i]then\ne.toolmap[i](o)elseif i==\"VCX360DeploymentTool\"then\n_p(3,'0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(o.deploymentoptions),\" \"))end\n_p(3,'/>')elseif i==\"VCX360ImageTool" "\"then\n_p(3,'0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(o.imageoptions),\" \"))end\nif o.imagepath~=nil then\n_p(4,'OutputFileName=\"%s\"',premake.esc(path.translate(o.imagepath)))end\n_p(3,'/>')elseif i==\"DebuggerTool\"then\n_p(3,'')else\n_p(3,'')end\nend\n_p(2,'')end\nend\n_p(1,'')_p(1,'')_p(1,'')_p(1,'')e.Files(i)_p(1,'')_p(1,'')_p(1,'')_p('')end", /* actions/vstudio/vs200x_vcproj_user.lua */ "local e=premake.vstudio.vc200x\nfunction e.generate_user(i)e.header('VisualStudioUserFile')_p(1,'ShowAllFiles=\"false\"')_p(1,'>')_p(1,'')for r,n in ipairs(i.solution.vstudio_configs)do\nif n.isreal then\nlocal i=premake.getconfig(i,n.src_buildcfg,n.src_platform)_p(2,'')e.debugdir(i)_p(2,'')end\nend\n_p(1,'')_p('')end\nfunction e.environmentargs(e)if e.environmentargs and#e.environmentargs>0 then\n_p(4,'Environment=\"%s\"',string.gsub(table.concat(e.environmentargs,\" \"),'\"','"'))if e.flags.EnvironmentArgsDontMerge then\n_p(4,'EnvironmentMerge=\"false\"')end\nend\nend\nfunction e.debugdir(n)_p(3,'0 then\n_p(4,'CommandArguments=\"%s\"',table.concat(n.debugargs,\" \"))end\ne.environmentargs(n)_p(3,'/>')end", /* actions/vstudio/vs2003_solution.lua */ "premake.vstudio.sln2003={}local i=premake.vstudio\nlocal o=premake.vstudio.sln2003\nfunction o.generate(o)io.indent=nil\nio.eol='\\r\\n'o.vstudio_configs=premake.vstudio.buildconfigs(o)_p('Microsoft Visual Studio Solution File, Format Version 8.00')for t in premake.solution.eachproject(o)do\nlocal o=path.translate(path.getrelative(o.location,i.projectfile(t)))_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"',i.tool(t),t.name,o,t.uuid)local o=premake.getdependencies(t)if#o>0 then\n_p('\\tProjectSection(ProjectDependencies) = postProject')for t,o in ipairs(o)do\n_p('\\t\\t{%s} = {%s}',o.uuid,o.uuid)end\n_p('\\tEndProjectSection')end\n_p('EndProject')end\n_p('Global')_p('\\tGlobalSection(SolutionConfiguration) = preSolution')for t,o in ipairs(o.configurations)do\n_p('\\t\\t%s = %s',o,o)end\n_p('\\tEndGlobalSection')_p('\\tGlobalSection(ProjectDependencies) = postSolution')_p('\\tEndGlobalSection')_p('\\tGlobalSection(ProjectConfiguration) = postSolution')for t in premake.solution.eachproject(o)do\nfor e,o in ipai" "rs(o.configurations)do\n_p('\\t\\t{%s}.%s.ActiveCfg = %s|%s',t.uuid,o,o,i.arch(t))_p('\\t\\t{%s}.%s.Build.0 = %s|%s',t.uuid,o,o,i.arch(t))end\nend\n_p('\\tEndGlobalSection')_p('\\tGlobalSection(ExtensibilityGlobals) = postSolution')_p('\\tEndGlobalSection')_p('\\tGlobalSection(ExtensibilityAddIns) = postSolution')_p('\\tEndGlobalSection')_p('EndGlobal')end", /* actions/vstudio/vs2005_solution.lua */ "premake.vstudio.sln2005={}local t=premake.vstudio\nlocal o=premake.vstudio.sln2005\nfunction o.generate(e)io.indent=nil\nio.eol='\\r\\n'e.vstudio_configs=premake.vstudio.buildconfigs(e)_p('')o.header(e)for e in premake.solution.eachproject(e)do\no.project(e)end\n_p('Global')o.platforms(e)o.project_platforms(e)o.properties(e)_p('EndGlobal')end\nfunction o.header(o)local o=premake.action.current()_p('Microsoft Visual Studio Solution File, Format Version %d.00',o.vstudio.solutionVersion)if o.vstudio.shortSlnVersion~=nil then\n_p('# Visual Studio %s%s',iif(_ACTION>=\"vs2019\",\"Version \",\"\"),o.vstudio.shortSlnVersion)_p('VisualStudioVersion = %s.0.0.0',o.vstudio.shortSlnVersion)else\n_p('# Visual Studio %s',_ACTION:sub(3))end\nend\nfunction o.project(e)local n=path.translate(path.getrelative(e.solution.location,t.projectfile(e)),\"\\\\\")_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"',t.tool(e),e.name,n,e.uuid)o.projectdependencies(e)_p('EndProject')end\nfunction o.projectdependencies(o)local o=premake.get" "dependencies(o)if#o>0 then\n_p('\\tProjectSection(ProjectDependencies) = postProject')for e,o in ipairs(o)do\n_p('\\t\\t{%s} = {%s}',o.uuid,o.uuid)end\n_p('\\tEndProjectSection')end\nend\nfunction o.platforms(o)_p('\\tGlobalSection(SolutionConfigurationPlatforms) = preSolution')for e,o in ipairs(o.vstudio_configs)do\n_p('\\t\\t%s = %s',o.name,o.name)end\n_p('\\tEndGlobalSection')end\nfunction o.project_platforms_sln2prj_mapping(n,t,o,e)_p('\\t\\t{%s}.%s.ActiveCfg = %s|%s',t.uuid,o.name,o.buildcfg,e)if e==o.platform or o.platform==\"Mixed Platforms\"then\n_p('\\t\\t{%s}.%s.Build.0 = %s|%s',t.uuid,o.name,o.buildcfg,e)end\nend\nfunction o.project_platforms(n)_p('\\tGlobalSection(ProjectConfigurationPlatforms) = postSolution')for i in premake.solution.eachproject(n)do\nfor e,t in ipairs(n.vstudio_configs)do\nlocal e\nif premake.isdotnetproject(i)then\ne=\"Any CPU\"else\nif t.platform==\"Any CPU\"or t.platform==\"Mixed Platforms\"then\ne=n.vstudio_configs[3].platform\nelse\ne=t.platform\nend\nend\no.project_platfor" "ms_sln2prj_mapping(n,i,t,e)end\nend\n_p('\\tEndGlobalSection')end\nfunction o.properties(o)_p('\\tGlobalSection(SolutionProperties) = preSolution')_p('\\t\\tHideSolutionNode = FALSE')_p('\\tEndGlobalSection')end", /* actions/vstudio/vs2005_csproj.lua */ "premake.vstudio.cs2005={}local s=premake.vstudio\nlocal e=premake.vstudio.cs2005\nlocal function i(t,r,e)if r==\"Compile\"and e:endswith(\".cs\")then\nif e:endswith(\".Designer.cs\")then\nlocal n=e:sub(1,-13)local e=n..\".cs\"if premake.findfile(t,e)then\nreturn\"Dependency\",e\nend\ne=n..\".resx\"if premake.findfile(t,e)then\nreturn\"AutoGen\",e\nend\nelseif e:endswith(\".xaml.cs\")then\nlocal e=e:sub(1,-9)local e=e..\".xaml\"if premake.findfile(t,e)then\nreturn\"SubTypeCode\",e\nend\nelse\nlocal e=e:sub(1,-4)local e=e..\".Designer.cs\"if premake.findfile(t,e)then\nreturn\"SubTypeForm\"end\nend\nend\nif r==\"EmbeddedResource\"and e:endswith(\".resx\")then\nlocal n=e:sub(1,-6)local e=path.getname(n..\".cs\")if premake.findfile(t,e)then\nif premake.findfile(t,n..\".Designer.cs\")then\nreturn\"DesignerType\",e\nelse\nreturn\"Dependency\",e\nend\nelse\ne=path.getname(n..\".Designer.cs\")if premake.findfile(t,e)then\nreturn\"AutoGenerated\"end\nend\nend\nif e:endswith(\".xaml\")then\nreturn\"XamlDesigner\"end\nif " "r==\"Content\"then\nreturn\"CopyNewest\"end\nreturn\"None\"end\nfunction e.arch(e)return\"AnyCPU\"end\nfunction e.files(e)local t=premake.project.buildsourcetree(e)premake.tree.traverse(t,{onleaf=function(n)local t=premake.dotnet.getbuildaction(n.cfg)local o=path.translate(premake.esc(n.cfg.name),\"\\\\\")local e,r=i(e,t,n.path)if e==\"None\"then\n_p(' <%s Include=\"%s\" />',t,o)else\n_p(' <%s Include=\"%s\">',t,o)if e==\"AutoGen\"then\n_p(' True')elseif e==\"AutoGenerated\"then\n_p(' Designer')_p(' ResXFileCodeGenerator')_p(' %s.Designer.cs',premake.esc(path.getbasename(n.name)))elseif e==\"SubTypeDesigner\"then\n_p(' Designer')elseif e==\"SubTypeForm\"then\n_p(' Form')elseif e==\"SubTypeCode\"then\n_p(' Code')elseif e==\"XamlDesigner\"then\n_p(' Designer')_p(' MSBuild:Compile')elseif e==\"PreserveNewest\"then\n_p(' PreserveNewest')end\nif r then\n_p(' %s',path.translate(premake.esc(r),\"\\\\\"))end\n_p(' ',t)end\nend},false)end\nfunction e.projectelement(e)local e=premake.action.current()local t=''if e.vstudio.toolsVersion then\nt=string.format(' ToolsVersion=\"%s\"',e.vstudio.toolsVersion)end\nif _ACTION>\"vs2008\"then\n_p('')end\n_p('',t)end\nfunction e.projectsettings(t)_p(' ')_p(\" %s\",premake.esc(t.solution.configurations[1]))_p(\" %s\",e.arch(t))local e=premake.action.current()if e.vstudio.productVersion then\n_p(' %s',e.vstudio.productVersion)en" "d\nif _ACTION<\"vs2012\"then\n_p(' 2.0')end\n_p(' {%s}',t.uuid)_p(' %s',premake.dotnet.getkind(t))_p(' Properties')_p(' %s',t.buildtarget.basename)_p(' %s',t.buildtarget.basename)local e=t.framework or e.vstudio.targetFramework\nif e then\n_p(' v%s',e)end\nif _ACTION=='vs2010'then\n_p(' ')end\nif _ACTION>=\"vs2010\"then\n_p(' 512')end\n_p(' ')end\nfunction e.propertygroup(t)_p(\" \",premake.esc(t.name),e.arch(t))if _ACTION>\"vs2008\"then\n_p(' %s',e.arch(t))end\nend\nfunction e.buildevents(e)if#e.prebuildcommands>0 then\n_p(' ')_p(' " " %s',premake.esc(table.implode(e.prebuildcommands,\"\",\"\",\"\\r\\n\")))_p(' ')end\nif#e.postbuildcommands>0 then\n_p(' ')_p(' %s',premake.esc(table.implode(e.postbuildcommands,\"\",\"\",\"\\r\\n\")))_p(' ')end\nend\nfunction e.generate(n)io.eol=\"\\r\\n\"e.projectelement(n)if _ACTION>\"vs2010\"then\n_p(' ')end\ne.projectsettings(n)for t in premake.eachconfig(n)do\ne.propertygroup(t)if t.flags.Symbols then\n_p(' true')_p(' full')else\n_p(' pdbonly')end\n_p(' %s',iif(t.flags.Optimize or t.flags.OptimizeSize or t.flags.OptimizeSpeed,\"true\",\"false\"))_p(' %s'" ",t.buildtarget.directory)_p(' %s',table.concat(premake.esc(t.defines),\";\"))_p(' prompt')_p(' 4')if t.flags.Unsafe then\n_p(' true')end\nif t.flags.FatalWarnings then\n_p(' true')end\n_p(' ')end\n_p(' ')for t,e in ipairs(premake.getlinks(n,\"siblings\",\"object\"))do\n_p(' ',path.translate(path.getrelative(n.location,s.projectfile(e)),\"\\\\\"))_p(' {%s}',e.uuid)_p(' %s',premake.esc(e.name))_p(' ')end\nfor t,e in ipairs(premake.getlinks(n,\"system\",\"name\"))do\n_p(' ',premake.esc(e))end\n_p(' ')_p(' ')e.files(n)_p(' ')local e=iif(_ACTION<\"vs2012\",\"Bin\",\"Tools\")_p(' ',e)_p(' ')_p('')end", /* actions/vstudio/vs2005_csproj_user.lua */ "local e=premake.vstudio.cs2005\nfunction e.generate_user(e)io.eol=\"\\r\\n\"_p('')_p(' ')local e=table.translate(e.libdirs,function(t)return path.getabsolute(e.location..\"/\"..t)end)_p(' %s',path.translate(table.concat(e,\";\"),\"\\\\\"))_p(' ')_p('')end", /* actions/vstudio/vs2010_vcxproj.lua */ "premake.vstudio.vc2010={}local e=premake.vstudio.vc2010\nlocal u=premake.vstudio\nlocal function l(e)_p(1,'')for n,e in ipairs(e.solution.vstudio_configs)do\n_p(2,'',premake.esc(e.name))_p(3,'%s',e.buildcfg)_p(3,'%s',e.platform)_p(2,'')end\n_p(1,'')end\nlocal function d(e)_p(1,'')_p(2,'{%s}',e.uuid)_p(2,'%s',e.name)if e.flags and e.flags.Managed then\n_p(2,'v4.0')_p(2,'ManagedCProj')else\n_p(2,'Win32Proj')end\n_p(1,'')end\nfunction e.config_type(e)local n={SharedLib=\"DynamicLibrary\",StaticLib=\"StaticLibrary\",ConsoleApp=\"Application\",WindowedApp=\"Application\"}return n[e.kind]end\nlocal function i()return\"Condition=\\\"'$(Configuration)|$(Platform)'" "=='%s'\\\"\"end\nlocal function o(n)local e=\"Disabled\"for i,n in ipairs(n.flags)do\nif(n==\"Optimize\")then\ne=\"Full\"elseif(n==\"OptimizeSize\")then\ne=\"MinSpace\"elseif(n==\"OptimizeSpeed\")then\ne=\"MaxSpeed\"end\nend\nreturn e\nend\nfunction e.configurationPropertyGroup(n,t)_p(1,'',premake.esc(t.name))_p(2,'%s',e.config_type(n))_p(2,'%s',iif(o(n)==\"Disabled\",\"true\",\"false\"))_p(2,'%s',iif(n.flags.Unicode,\"Unicode\",\"MultiByte\"))local e={vs2012=\"v110\",vs2013=\"v120\",vs2015=\"v140\",vs2017=\"v141\",vs2019=\"v142\",vs2022=\"v143\"}local e=e[_ACTION]if e then\n_p(2,'%s',e)end\nif n.flags.MFC then\n_p(2,'%s',iif(n.flags.StaticRuntime,\"Static\",\"Dynamic\"))end\nif n.flags.ATL or n.flags.StaticATL then\n_p(2,'%s',iif(n.flags.StaticATL,\"Static\",\"Dynamic\"))end\nif n" ".flags.Managed then\n_p(2,'true')end\n_p(1,'')end\nlocal function p(n)for t,e in ipairs(n.solution.vstudio_configs)do\nlocal n=premake.getconfig(n,e.src_buildcfg,e.src_platform)_p(1,'',premake.esc(e.name))_p(2,'')_p(1,'')end\nend\nfunction e.outputProperties(e)for n,t in ipairs(e.solution.vstudio_configs)do\nlocal e=premake.getconfig(e,t.src_buildcfg,t.src_platform)local n=e.buildtarget\n_p(1,'',premake.esc(t.name))_p(2,'%s\\\\',premake.esc(n.directory))if e.platform==\"Xbox360\"then\n_p(2,'$(OutDir)%s',premake.esc(n.name))end\n_p(2,'%s\\\\',premake.esc(e.objectsdir))_p(2,'%s',premake.esc(path.getbasename(n.name)))" "_p(2,'%s',premake.esc(path.getextension(n.name)))if e.kind==\"SharedLib\"then\nlocal e=(e.flags.NoImportLib~=nil)_p(2,'%s',tostring(e))end\nif e.kind~=\"StaticLib\"then\n_p(2,'%s',tostring(premake.config.isincrementallink(e)))end\nif e.flags.NoManifest then\n_p(2,'false')end\n_p(1,'')end\nend\nlocal function r(i)local n\nlocal e=i.flags\nif premake.config.isdebugbuild(i)then\nn=iif(e.StaticRuntime and not e.Managed,\"MultiThreadedDebug\",\"MultiThreadedDebugDLL\")else\nn=iif(e.StaticRuntime and not e.Managed,\"MultiThreaded\",\"MultiThreadedDLL\")end\nreturn n\nend\nlocal function a(e)if not e.flags.NoPCH and e.pchheader then\n_p(3,'Use')_p(3,'%s',e.pchheader)else\n_p(3,'')end\nend\nlocal function t(e,n)if#n.defines>0 then\n_p(e,'%s;%%(PreprocessorDefinitions)',premake.esc(table.concat(n.defines,\";\")))else\n_p(e,'')end\nend\nlocal function s(n,e)if#e.includedirs>0 then\n_p(n,'%s;%%(AdditionalIncludeDirectories)',premake.esc(path.translate(table.concat(e.includedirs,\";\"),'\\\\')))end\nend\nlocal function n(n,e)if#e.includedirs>0 or#e.resincludedirs>0 then\nlocal e=table.join(e.includedirs,e.resincludedirs)_p(n,'%s;%%(AdditionalIncludeDirectories)',premake.esc(path.translate(table.concat(e,\";\"),'\\\\')))end\nend\nlocal function c(e)_p(2,'')t(3,e)n(3,e)_p(2,'')end\nlocal function f(e)if e.flags.NoExceptions then\n_p(2,'false')elseif e.flags.SEH then\n_p(2,'Async')end\nend\nlocal function h(e)if e.flags.NoRTT" "I and not e.flags.Managed then\n_p(3,'false')end\nend\nlocal function _(e)if e.flags.NativeWChar then\n_p(3,'true')elseif e.flags.NoNativeWChar then\n_p(3,'false')end\nend\nlocal function b(e)if e.flags.EnableSSE then\n_p(3,'StreamingSIMDExtensions')elseif e.flags.EnableSSE2 then\n_p(3,'StreamingSIMDExtensions2')end\nend\nlocal function P(e)if e.flags.FloatFast then\n_p(3,'Fast')elseif e.flags.FloatStrict and not e.flags.Managed then\n_p(3,'Strict')end\nend\nlocal function C(e)local n=''if e.flags.Symbols then\nif e.platform==\"x64\"or e.flags.Managed\nor premake.config.isoptimizedbuild(e.flags)or e.flags.NoEditAndContinue\nthen\nn=\"ProgramDatabase\"else\nn=\"EditAnd" "Continue\"end\nend\n_p(3,'%s',n)end\nlocal function g(e)if premake.config.isdebugbuild(e)and not e.flags.NoMinimalRebuild then\n_p(3,'true')else\n_p(3,'false')end\nend\nlocal function n(e)if e.language==\"C\"then\n_p(3,'CompileAsC')end\nend\nlocal function m(e)_p(2,'')if#e.buildoptions>0 then\n_p(3,'%s %%(AdditionalOptions)',table.concat(premake.esc(e.buildoptions),\" \"))end\n_p(3,'%s',o(e))s(3,e)t(3,e)g(e)if not premake.config.isoptimizedbuild(e.flags)then\nif not e.flags.Managed then\n_p(3,'EnableFastChecks')end\nif e.flags.ExtraWarnings then\n_p(3,'true')end\nelse\n_p(3,'true')end\n_p(3,'%s',r(e))_p(3,'true')a" "(e)if e.flags.ExtraWarnings then\n_p(3,'Level4')else\n_p(3,'Level3')end\nif e.flags.FatalWarnings then\n_p(3,'true')end\nf(e)h(e)_(e)b(e)P(e)C(e)if e.flags.Symbols then\n_p(3,'$(OutDir)%s.pdb',path.getbasename(e.buildtarget.name))end\nif e.flags.NoFramePointer then\n_p(3,'true')end\nn(e)_p(2,'')end\nlocal function a(e)if#e.postbuildcommands>0 then\n_p(2,'')_p(3,'%s',premake.esc(table.implode(e.postbuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'')end\nif#e.prebuildcommands>0 then\n_p(2,'')_p(3,'%s',premake.esc(table.implode(e.prebuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'')end\nif#e.prelinkcommands>0 then\n_p(2,'')_p(3,'%s',premake.esc(table.implode(e.prelinkcommands,\"\",\"\",\"\\r" "\\n\")))_p(2,'')end\nend\nlocal function t(n,e)if#e.linkoptions>0 then\n_p(n,'%s %%(AdditionalOptions)',table.concat(premake.esc(e.linkoptions),\" \"))end\nend\nlocal function o(i,n)local e={x32='MachineX86',x64='MachineX64'}if e[n.platform]then\n_p(i,'%s',e[n.platform])end\nend\nlocal function f(e)if e.kind=='StaticLib'and e.platform~=\"Xbox360\"then\n_p(1,'')_p(2,'$(OutDir)%s',e.buildtarget.name)t(2,e)o(2,e)_p(1,'')end\nend\nlocal function r(e)if e.kind==\"SharedLib\"then\nlocal n=e.linktarget.fullpath\n_p(3,'%s',iif(e.flags.NoImportLib,e.objectsdir..\"\\\\\"..path.getname(n),n))end\nend\nfunction e.link(n)_p(2,'')_p(3,'%s',iif(n.kind==\"ConsoleApp\",\"Console\",\"Windows\"))_p(3,'%s',tostring(n.flags.Symbols~=nil))if premake.config.isoptimizedbuild(n.flags)then\n_p(3,'true')_p(3,'true')end\nif n.kind~='StaticLib'then\ne.additionalDependencies(n)_p(3,'$(OutDir)%s',n.buildtarget.name)if#n.libdirs>0 then\n_p(3,'%s;%%(AdditionalLibraryDirectories)',premake.esc(path.translate(table.concat(n.libdirs,';'),'\\\\')))end\nif e.config_type(n)=='Application'and not n.flags.WinMain and not n.flags.Managed then\n_p(3,'%s',iif(n.flags.Unicode,\"wmainCRTStartup\",\"mainCRTStartup\"))end\nr(n)local e=premake.findfile(n,\".def\")if e then\n_p(3,'%s',e)end\no(3,n)t(3,n)end\n_p(2,'')end\nfunction e.additionalDependencies(e)local e=premake.getlinks(e,\"system\",\"fullpath\")if#e>0 then\n_p(3,'%s;%%(AdditionalDependencies)',table.concat(e,\";\"))end\nend\nlocal function s(n)for o,t in ipairs(n.solution" ".vstudio_configs)do\nlocal n=premake.getconfig(n,t.src_buildcfg,t.src_platform)_p(1,'',premake.esc(t.name))m(n)c(n)f(n)e.link(n)a(n)_p(1,'')end\nend\nfunction e.getfilegroup(i,t)local e=i.vc2010sortedfiles\nif not e then\ne={ClCompile={},ClInclude={},None={},ResourceCompile={},}for n in premake.project.eachfile(i)do\nif path.iscppfile(n.name)then\ntable.insert(e.ClCompile,n)elseif path.iscppheader(n.name)then\ntable.insert(e.ClInclude,n)elseif path.isresourcefile(n.name)then\ntable.insert(e.ResourceCompile,n)else\ntable.insert(e.None,n)end\nend\ni.vc2010sortedfiles=e\nend\nreturn e[t]end\nfunction e.files(n)e.simplefilesgroup(n,\"ClInclude\")e.compilerfilesgroup(n)e.simplefilesgroup(n,\"None\")e.simplefilesgroup(n,\"ResourceCompile\")end\nfunction e.simplefilesgroup(n,i)local n=e.getfilegroup(n,i)if#n>0 then\n_p(1,'')for n,e in ipairs(n)do\n_p(2,'<%s Include=\"%s\" />',i,path.translate(e.name,\"\\\\\"))end\n_p(1,'')end\nend\ne.individu" "alSourceFileOptions=nil\nfunction e.individualSourceFile(o,t,n)local r=o.solution.vstudio_configs\nlocal a=path.translate(n.name,\"\\\\\")_p(2,'',a)for n,e in ipairs(r)do\nif t[e]and a==t[e]then\n_p(3,'Create',premake.esc(e.name))t[e]=nil\nend\nend\nif path.iscfile(n.name)~=premake.project.iscproject(o)then\n_p(3,'%s',iif(path.iscfile(n.name),'CompileAsC','CompileAsCpp'))end\nif(type(e.individualSourceFileOptions)=='function')then\ne.individualSourceFileOptions(o,t,n)end\n_p(2,'')end\nfunction e.compilerfilesgroup(n)local i=n.solution.vstudio_configs\nlocal t=e.getfilegroup(n,\"ClCompile\")if#t>0 then\nlocal o={}for e,i in ipairs(i)do\nlocal e=premake.getconfig(n,i.src_buildcfg,i.src_platform)if e.pchheader and e.pchsource and not e.flags.NoPCH then\no[i]=path.translate(e.pchsource,\"\\\\\")end\nend\n_p(1,'')for t,i in ipairs(t)do\ne.individualSourceFile(n,o,i)end\n_p(1,'')end\ne" "nd\nfunction e.header(e)io.eol=\"\\r\\n\"_p('')local n=premake.action.current()local i=''if(_ACTION>=\"vs2010\")and(_ACTION<=\"vs2017\")then\nif n.vstudio.toolsVersion then\ni=string.format(' ToolsVersion=\"%s\"',n.vstudio.toolsVersion)end\nend\nlocal n=\"\"if e then\nn=' DefaultTargets=\"'..e..'\"'end\n_p('',n,i)end\nfunction premake.vs2010_vcxproj(n)io.indent=\" \"e.header(\"Build\")l(n)d(n)_p(1,'')for t,i in ipairs(n.solution.vstudio_configs)do\nlocal n=premake.getconfig(n,i.src_buildcfg,i.src_platform)e.configurationPropertyGroup(n,i)end\n_p(1,'')_p(1,'')_p(1,'')p(n)_p(1,'')e.outputProperties(n)s(n)e.files(n)e.projectReferences(n)_p(1,'')_p(1,'')_p(1,'')_p('')end\nfunction e.projectReferences(n)local e=premake.getdependencies(n)if#e>0 then\n_p(1,'')for i,e in ipairs(e)do\nlocal n=path.getrelative(n.location,u.projectfile(e))_p(2,'',path.translate(n,\"\\\\\"))_p(3,'{%s}',e.uuid)_p(2,'')end\n_p(1,'')end\nend\nfunction e.debugdir(e)if e.debugdir then\n_p(' %s',path.translate(e.debugdir,'\\\\'))_p(' WindowsLocalDebugger')end\nif e.debugargs then\n_p(' %s',table.concat(e.debugargs,\" \"))end\nend\nfunction e.debugenvs(e)if e.debugenvs and#e.debugenvs>0 then\n_p(2,'%s%s',table.concat(e.debugenvs,\"\\n\"),iif(e.flags.DebugEnvsInherit,'\\n$(LocalDe" "buggerEnvironment)',''))if e.flags.DebugEnvsDontMerge then\n_p(2,'false')end\nend\nend\nfunction premake.vs2010_vcxproj_user(t)io.indent=\" \"e.header()for o,n in ipairs(t.solution.vstudio_configs)do\nlocal t=premake.getconfig(t,n.src_buildcfg,n.src_platform)_p(' ',premake.esc(n.name))e.debugdir(t)e.debugenvs(t)_p(' ')end\n_p('')end", /* actions/vstudio/vs2010_vcxproj_filters.lua */ "local e=premake.vstudio.vc2010\nlocal i=premake.project\nfunction e.filteridgroup(e)local l={}local t=false\nfor e in i.eachfile(e)do\nlocal i=string.explode(e.vpath,\"/\",true)local e=\"\"for n=1,#i-1 do\nif not t then\nt=true\n_p(1,'')end\ne=e..i[n]if not l[e]then\nl[e]=true\n_p(2,'',e)_p(3,'{%s}',os.uuid())_p(2,'')end\ne=e..\"\\\\\"end\nend\nif t then\n_p(1,'')end\nend\nfunction e.filefiltergroup(l,t)local e=e.getfilegroup(l,t)if#e>0 then\n_p(1,'')for l,e in ipairs(e)do\nlocal l\nif e.name~=e.vpath then\nl=path.getdirectory(e.vpath)else\nl=path.getdirectory(e.name)end\nif l~=\".\"then\n_p(2,'<%s Include=\"%s\">',t,path.translate(e.name,\"\\\\\"))_p(3,'%s',path.translate(l,\"\\\\\"))_p(2,'',t)else\n_p(2,'<%s Include=\"%s\" />',t,path.translate(e.name,\"\\\\\"))end\nend\n_p(1,'')end\nend\nfunction e.generate_filters(t)io.indent=\" \"e.header()e.filteridgroup(t)e.filefilterg" "roup(t,\"None\")e.filefiltergroup(t,\"ClInclude\")e.filefiltergroup(t,\"ClCompile\")e.filefiltergroup(t,\"ResourceCompile\")_p('')end", /* actions/vstudio/vs2012.lua */ "premake.vstudio.vc2012={}local e=premake.vstudio.vc2012\nlocal r=premake.vstudio\nnewaction{trigger=\"vs2012\",shortname=\"Visual Studio 2012\",description=\"Generate Microsoft Visual Studio 2012 project files\",os=\"windows\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\",\"C#\"},valid_tools={cc={\"msc\"},dotnet={\"msnet\"},},onsolution=function(e)premake.generate(e,\"%%.sln\",r.sln2005.generate)end,onproject=function(e)if premake.isdotnetproject(e)then\npremake.generate(e,\"%%.csproj\",r.cs2005.generate)premake.generate(e,\"%%.csproj.user\",r.cs2005.generate_user)else\npremake.generate(e,\"%%.vcxproj\",premake.vs2010_vcxproj)premake.generate(e,\"%%.vcxproj.user\",premake.vs2010_vcxproj_user)premake.generate(e,\"%%.vcxproj.filters\",r.vc2010.generate_filters)end\nend,oncleansolution=premake.vstudio.cleansolution,oncleanproject=premake.vstudio.cleanproject,oncleantarget=premake.vstudio.cleantarget,vstudio={solutionVersion=\"12\",targetFramework=\"4.5\",t" "oolsVersion=\"4.0\",}}", /* actions/vstudio/vs2013.lua */ "premake.vstudio.vc2013={}local e=premake.vstudio.vc2013\nlocal r=premake.vstudio\nnewaction{trigger=\"vs2013\",shortname=\"Visual Studio 2013\",description=\"Generate Microsoft Visual Studio 2013 project files\",os=\"windows\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\",\"C#\"},valid_tools={cc={\"msc\"},dotnet={\"msnet\"},},onsolution=function(e)premake.generate(e,\"%%.sln\",r.sln2005.generate)end,onproject=function(e)if premake.isdotnetproject(e)then\npremake.generate(e,\"%%.csproj\",r.cs2005.generate)premake.generate(e,\"%%.csproj.user\",r.cs2005.generate_user)else\npremake.generate(e,\"%%.vcxproj\",premake.vs2010_vcxproj)premake.generate(e,\"%%.vcxproj.user\",premake.vs2010_vcxproj_user)premake.generate(e,\"%%.vcxproj.filters\",r.vc2010.generate_filters)end\nend,oncleansolution=premake.vstudio.cleansolution,oncleanproject=premake.vstudio.cleanproject,oncleantarget=premake.vstudio.cleantarget,vstudio={solutionVersion=\"12\",targetFramework=\"4.5\",t" "oolsVersion=\"12.0\",}}", /* actions/vstudio/vs2015.lua */ "premake.vstudio.vc2015={}local e=premake.vstudio.vc2015\nlocal r=premake.vstudio\nnewaction{trigger=\"vs2015\",shortname=\"Visual Studio 2015\",description=\"Generate Microsoft Visual Studio 2015 project files\",os=\"windows\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\",\"C#\"},valid_tools={cc={\"msc\"},dotnet={\"msnet\"},},onsolution=function(e)premake.generate(e,\"%%.sln\",r.sln2005.generate)end,onproject=function(e)if premake.isdotnetproject(e)then\npremake.generate(e,\"%%.csproj\",r.cs2005.generate)premake.generate(e,\"%%.csproj.user\",r.cs2005.generate_user)else\npremake.generate(e,\"%%.vcxproj\",premake.vs2010_vcxproj)premake.generate(e,\"%%.vcxproj.user\",premake.vs2010_vcxproj_user)premake.generate(e,\"%%.vcxproj.filters\",r.vc2010.generate_filters)end\nend,oncleansolution=premake.vstudio.cleansolution,oncleanproject=premake.vstudio.cleanproject,oncleantarget=premake.vstudio.cleantarget,vstudio={solutionVersion=\"12\",targetFramework=\"4.5.2\"" ",toolsVersion=\"14.0\",shortSlnVersion=\"14\",}}", /* actions/vstudio/vs2017.lua */ "premake.vstudio.vc2017={}local e=premake.vstudio.vc2017\nlocal r=premake.vstudio\nnewaction{trigger=\"vs2017\",shortname=\"Visual Studio 2017\",description=\"Generate Microsoft Visual Studio 2017 project files\",os=\"windows\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\",\"C#\"},valid_tools={cc={\"msc\"},dotnet={\"msnet\"},},onsolution=function(e)premake.generate(e,\"%%.sln\",r.sln2005.generate)end,onproject=function(e)if premake.isdotnetproject(e)then\npremake.generate(e,\"%%.csproj\",r.cs2005.generate)premake.generate(e,\"%%.csproj.user\",r.cs2005.generate_user)else\npremake.generate(e,\"%%.vcxproj\",premake.vs2010_vcxproj)premake.generate(e,\"%%.vcxproj.user\",premake.vs2010_vcxproj_user)premake.generate(e,\"%%.vcxproj.filters\",r.vc2010.generate_filters)end\nend,oncleansolution=premake.vstudio.cleansolution,oncleanproject=premake.vstudio.cleanproject,oncleantarget=premake.vstudio.cleantarget,vstudio={solutionVersion=\"12\",targetFramework=\"4.5.2\"" ",toolsVersion=\"15.0\",shortSlnVersion=\"15\",}}", /* actions/vstudio/vs2019.lua */ "premake.vstudio.vc2019={}local e=premake.vstudio.vc2019\nlocal r=premake.vstudio\nnewaction{trigger=\"vs2019\",shortname=\"Visual Studio 2019\",description=\"Generate Microsoft Visual Studio 2019 project files\",os=\"windows\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\",\"C#\"},valid_tools={cc={\"msc\"},dotnet={\"msnet\"},},onsolution=function(e)premake.generate(e,\"%%.sln\",r.sln2005.generate)end,onproject=function(e)if premake.isdotnetproject(e)then\npremake.generate(e,\"%%.csproj\",r.cs2005.generate)premake.generate(e,\"%%.csproj.user\",r.cs2005.generate_user)else\npremake.generate(e,\"%%.vcxproj\",premake.vs2010_vcxproj)premake.generate(e,\"%%.vcxproj.user\",premake.vs2010_vcxproj_user)premake.generate(e,\"%%.vcxproj.filters\",r.vc2010.generate_filters)end\nend,oncleansolution=premake.vstudio.cleansolution,oncleanproject=premake.vstudio.cleanproject,oncleantarget=premake.vstudio.cleantarget,vstudio={solutionVersion=\"12\",targetFramework=\"4.7\",t" "oolsVersion=\"16.0\",shortSlnVersion=\"16\",}}", /* actions/vstudio/vs2022.lua */ "premake.vstudio.vc2022={}local e=premake.vstudio.vc2022\nlocal r=premake.vstudio\nnewaction{trigger=\"vs2022\",shortname=\"Visual Studio 2022\",description=\"Generate Microsoft Visual Studio 2022 project files\",os=\"windows\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\",\"C#\"},valid_tools={cc={\"msc\"},dotnet={\"msnet\"},},onsolution=function(e)premake.generate(e,\"%%.sln\",r.sln2005.generate)end,onproject=function(e)if premake.isdotnetproject(e)then\npremake.generate(e,\"%%.csproj\",r.cs2005.generate)premake.generate(e,\"%%.csproj.user\",r.cs2005.generate_user)else\npremake.generate(e,\"%%.vcxproj\",premake.vs2010_vcxproj)premake.generate(e,\"%%.vcxproj.user\",premake.vs2010_vcxproj_user)premake.generate(e,\"%%.vcxproj.filters\",r.vc2010.generate_filters)end\nend,oncleansolution=premake.vstudio.cleansolution,oncleanproject=premake.vstudio.cleanproject,oncleantarget=premake.vstudio.cleantarget,vstudio={solutionVersion=\"12\",targetFramework=\"4.7\",t" "oolsVersion=\"17.0\",shortSlnVersion=\"17\",}}", /* actions/xcode/_xcode.lua */ "premake.xcode={}newaction{trigger=\"xcode3\",shortname=\"Xcode 3\",description=\"Generate Apple Xcode 3 project files (experimental)\",os=\"macosx\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"SharedLib\",\"StaticLib\"},valid_languages={\"C\",\"C++\"},valid_tools={cc={\"gcc\"},},valid_platforms={Native=\"Native\",x32=\"Native 32-bit\",x64=\"Native 64-bit\",Universal32=\"32-bit Universal\",Universal64=\"64-bit Universal\",Universal=\"Universal\",},default_platform=\"Universal\",onsolution=function(e)premake.xcode.preparesolution(e)end,onproject=function(e)premake.generate(e,\"%%.xcodeproj/project.pbxproj\",premake.xcode.project)end,oncleanproject=function(e)premake.clean.directory(e,\"%%.xcodeproj\")end,oncheckproject=function(n)local e\nfor o in premake.eachconfig(n)do\nif e and e~=o.kind then\nerror(\"Project '\"..n.name..\"' uses more than one target kind; not supported by Xcode\",0)end\ne=o.kind\nend\nend,}newaction{trigger=\"xcode4\",shortname=\"Xcode 4\",description=\"Generate Apple Xcode 4 project file" "s (experimental)\",os=\"macosx\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"SharedLib\",\"StaticLib\"},valid_languages={\"C\",\"C++\"},valid_tools={cc={\"gcc\"},},valid_platforms={Native=\"Native\",x32=\"Native 32-bit\",x64=\"Native 64-bit\",Universal32=\"32-bit Universal\",Universal64=\"64-bit Universal\",Universal=\"Universal\",},default_platform=\"Universal\",onsolution=function(e)premake.generate(e,\"%%.xcworkspace/contents.xcworkspacedata\",premake.xcode4.workspace_generate)end,onproject=function(e)premake.generate(e,\"%%.xcodeproj/project.pbxproj\",premake.xcode.project)end,oncleanproject=function(e)premake.clean.directory(e,\"%%.xcodeproj\")premake.clean.directory(e,\"%%.xcworkspace\")end,oncheckproject=function(o)local e\nfor n in premake.eachconfig(o)do\nif e and e~=n.kind then\nerror(\"Project '\"..o.name..\"' uses more than one target kind; not supported by Xcode\",0)end\ne=n.kind\nend\nend,}", /* actions/xcode/xcode_common.lua */ "local e=premake.xcode\nlocal i=premake.tree\nfunction e.getbuildcategory(n)local e={[\".a\"]=\"Frameworks\",[\".c\"]=\"Sources\",[\".cc\"]=\"Sources\",[\".cpp\"]=\"Sources\",[\".cxx\"]=\"Sources\",[\".dylib\"]=\"Frameworks\",[\".framework\"]=\"Frameworks\",[\".m\"]=\"Sources\",[\".mm\"]=\"Sources\",[\".strings\"]=\"Resources\",[\".nib\"]=\"Resources\",[\".xib\"]=\"Resources\",[\".icns\"]=\"Resources\",[\".bmp\"]=\"Resources\",[\".wav\"]=\"Resources\",}return e[path.getextension(n.name)]end\nfunction e.getconfigname(e)local n=e.name\nif#e.project.solution.xcode.platforms>1 then\nn=n..\" \"..premake.action.current().valid_platforms[e.platform]end\nreturn n\nend\nfunction e.getfiletype(n)local e={[\".c\"]=\"sourcecode.c.c\",[\".cc\"]=\"sourcecode.cpp.cpp\",[\".cpp\"]=\"sourcecode.cpp.cpp\",[\".css\"]=\"text.css\",[\".cxx\"]=\"sourcecode.cpp.cpp\",[\".framework\"]=\"wrapper.framework\",[\".gif\"]=\"image.gif\",[\".h\"]=\"sourcecode.c.h\",[\".html\"]=\"text.html\",[\".lua\"]=\"sourcecode.lua\",[\".m\"]=\"sourcecode" ".c.objc\",[\".mm\"]=\"sourcecode.cpp.objc\",[\".nib\"]=\"wrapper.nib\",[\".pch\"]=\"sourcecode.c.h\",[\".plist\"]=\"text.plist.xml\",[\".strings\"]=\"text.plist.strings\",[\".xib\"]=\"file.xib\",[\".icns\"]=\"image.icns\",[\".bmp\"]=\"image.bmp\",[\".wav\"]=\"audio.wav\",}return e[path.getextension(n.path)]or\"text\"end\nfunction e.getproducttype(n)local e={ConsoleApp=\"com.apple.product-type.tool\",WindowedApp=\"com.apple.product-type.application\",StaticLib=\"com.apple.product-type.library.static\",SharedLib=\"com.apple.product-type.library.dynamic\",}return e[n.cfg.kind]end\nfunction e.gettargettype(e)local n={ConsoleApp='\"compiled.mach-o.executable\"',WindowedApp=\"wrapper.application\",StaticLib=\"archive.ar\",SharedLib='\"compiled.mach-o.dylib\"',}return n[e.cfg.kind]end\nfunction e.getxcodeprojname(e)local e=premake.project.getfilename(e,\"%%.xcodeproj\")return e\nend\nfunction e.isframework(e)return(path.getextension(e)==\".framework\")end\nfunction e.newid()return string.format(\"%04X%04X%04X%04X%04X" "%04X\",math.random(0,32767),math.random(0,32767),math.random(0,32767),math.random(0,32767),math.random(0,32767),math.random(0,32767))end\nfunction e.preparesolution(e)e.xcode={}e.xcode.platforms=premake.filterplatforms(e,premake.action.current().valid_platforms,\"Universal\")for n in premake.solution.eachproject(e)do\nlocal i=premake.getconfig(n,n.configurations[1],e.xcode.platforms[1])local e=premake.tree.new(path.getname(i.buildtarget.bundlepath))e.cfg=i\ne.id=premake.xcode.newid(e,\"product\")e.targetid=premake.xcode.newid(e,\"target\")n.xcode={}n.xcode.projectnode=e\nend\nend\nfunction e.printlist(e,n)if#e>0 then\n_p(4,'%s = (',n)for n,e in ipairs(e)do\nlocal e=e:gsub('\"','\\\\\"')_p(5,'\"%s\",',e)end\n_p(4,');')end\nend\nfunction e.Header()_p('// !$*UTF8*$!')_p('{')_p(1,'archiveVersion = 1;')_p(1,'classes = {')_p(1,'};')_p(1,'objectVersion = 45;')_p(1,'objects = {')_p('')end\nfunction e.PBXBuildFile(n)_p('/* Begin PBXBuildFile section */')i.traverse(n,{onnode=function(n)if n.buildid then\n_p(2,'%s /* %s " "in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; };',n.buildid,n.name,e.getbuildcategory(n),n.id,n.name)end\nend})_p('/* End PBXBuildFile section */')_p('')end\nfunction e.PBXContainerItemProxy(e)if#e.projects.children>0 then\n_p('/* Begin PBXContainerItemProxy section */')for n,e in ipairs(e.projects.children)do\n_p(2,'%s /* PBXContainerItemProxy */ = {',e.productproxyid)_p(3,'isa = PBXContainerItemProxy;')_p(3,'containerPortal = %s /* %s */;',e.id,path.getname(e.path))_p(3,'proxyType = 2;')_p(3,'remoteGlobalIDString = %s;',e.project.xcode.projectnode.id)_p(3,'remoteInfo = \"%s\";',e.project.xcode.projectnode.name)_p(2,'};')_p(2,'%s /* PBXContainerItemProxy */ = {',e.targetproxyid)_p(3,'isa = PBXContainerItemProxy;')_p(3,'containerPortal = %s /* %s */;',e.id,path.getname(e.path))_p(3,'proxyType = 1;')_p(3,'remoteGlobalIDString = %s;',e.project.xcode.projectnode.targetid)_p(3,'remoteInfo = \"%s\";',e.project.xcode.projectnode.name)_p(2,'};')end\n_p('/* End PBXContainerItemProxy section */')_p('')end\nend" "\nfunction e.PBXFileReference(t)_p('/* Begin PBXFileReference section */')i.traverse(t,{onleaf=function(n)if not n.path then\nreturn\nend\nif n.kind==\"product\"then\n_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; includeInIndex = 0; name = \"%s\"; path = \"%s\"; sourceTree = BUILT_PRODUCTS_DIR; };',n.id,n.name,e.gettargettype(n),n.name,path.getname(n.cfg.buildtarget.bundlepath))elseif n.parent.parent==t.projects then\nlocal e=path.getrelative(t.project.location,n.parent.project.location)_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = \"%s\"; path = \"%s\"; sourceTree = SOURCE_ROOT; };',n.parent.id,n.parent.name,n.parent.name,path.join(e,n.parent.name))else\nlocal t,o\nif e.isframework(n.path)then\nlocal e=n.path\nlocal r,i,n=string.find(e,\"^%$%((.+)%)/\")if n then\ne=string.sub(e,i+1)end\nif string.find(e,'/')then\nif string.find(e,'^%.')then\nerror('relative paths are not currently supported for frameworks')end\nt=e\nelse\nt=\"/System/Libr" "ary/Frameworks/\"..e\nend\nif n then\no=n\nif string.find(t,'^/')then\nt=string.sub(t,2)end\nelse\no=\"\"end\nelse\no=\"\"if n.parent.isvpath then\nt=n.cfg.name\nelse\nt=i.getlocalpath(n)end\nend\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = %s; name = \"%s\"; path = \"%s\"; sourceTree = \"%s\"; };',n.id,n.name,e.getfiletype(n),n.name,t,o)end\nend})_p('/* End PBXFileReference section */')_p('')end\nfunction e.PBXFrameworksBuildPhase(e)_p('/* Begin PBXFrameworksBuildPhase section */')_p(2,'%s /* Frameworks */ = {',e.products.children[1].fxstageid)_p(3,'isa = PBXFrameworksBuildPhase;')_p(3,'buildActionMask = 2147483647;')_p(3,'files = (')i.traverse(e.frameworks,{onleaf=function(e)_p(4,'%s /* %s in Frameworks */,',e.buildid,e.name)end})i.traverse(e.projects,{onleaf=function(e)_p(4,'%s /* %s in Frameworks */,',e.buildid,e.name)end})_p(3,');')_p(3,'runOnlyForDeploymentPostprocessing = 0;')_p(2,'};')_p('/* End PBXFrameworksBuildPhase section */')_p('')end\nfunction e.PBXGroup(n)_" "p('/* Begin PBXGroup section */')i.traverse(n,{onnode=function(e)if(e.path and#e.children==0)or e.kind==\"vgroup\"then\nreturn\nend\nif e.parent==n.projects then\n_p(2,'%s /* Products */ = {',e.productgroupid)else\n_p(2,'%s /* %s */ = {',e.id,e.name)end\n_p(3,'isa = PBXGroup;')_p(3,'children = (')for n,e in ipairs(e.children)do\n_p(4,'%s /* %s */,',e.id,e.name)end\n_p(3,');')if e.parent==n.projects then\n_p(3,'name = Products;')else\n_p(3,'name = \"%s\";',e.name)if e.path and not e.isvpath then\nlocal n=e.path\nif e.parent.path then\nn=path.getrelative(e.parent.path,e.path)end\n_p(3,'path = \"%s\";',n)end\nend\n_p(3,'sourceTree = \"\";')_p(2,'};')end},true)_p('/* End PBXGroup section */')_p('')end\nfunction e.PBXNativeTarget(i)_p('/* Begin PBXNativeTarget section */')for t,n in ipairs(i.products.children)do\nlocal t=i.project.name\nlocal function o(e)if#i.project[e]>0 then\nreturn true\nend\nfor i,n in ipairs(i.configs)do\nif#n[e]>0 then\nreturn true\nend\nend\nend\n_p(2,'%s /* %s */ = {',n.targetid,t)_" "p(3,'isa = PBXNativeTarget;')_p(3,'buildConfigurationList = %s /* Build configuration list for PBXNativeTarget \"%s\" */;',n.cfgsection,t)_p(3,'buildPhases = (')if o('prebuildcommands')then\n_p(4,'9607AE1010C857E500CD1376 /* Prebuild */,')end\n_p(4,'%s /* Resources */,',n.resstageid)_p(4,'%s /* Sources */,',n.sourcesid)if o('prelinkcommands')then\n_p(4,'9607AE3510C85E7E00CD1376 /* Prelink */,')end\n_p(4,'%s /* Frameworks */,',n.fxstageid)if o('postbuildcommands')then\n_p(4,'9607AE3710C85E8F00CD1376 /* Postbuild */,')end\n_p(3,');')_p(3,'buildRules = (')_p(3,');')_p(3,'dependencies = (')for n,e in ipairs(i.projects.children)do\n_p(4,'%s /* PBXTargetDependency */,',e.targetdependid)end\n_p(3,');')_p(3,'name = \"%s\";',t)local i\nif n.cfg.kind==\"ConsoleApp\"then\ni=\"$(HOME)/bin\"elseif n.cfg.kind==\"WindowedApp\"then\ni=\"$(HOME)/Applications\"end\nif i then\n_p(3,'productInstallPath = \"%s\";',i)end\n_p(3,'productName = \"%s\";',t)_p(3,'productReference = %s /* %s */;',n.id,n.name)_p(3,'productType = \"%s\";'," "e.getproducttype(n))_p(2,'};')end\n_p('/* End PBXNativeTarget section */')_p('')end\nfunction e.PBXProject(e)_p('/* Begin PBXProject section */')_p(2,'08FB7793FE84155DC02AAC07 /* Project object */ = {')_p(3,'isa = PBXProject;')_p(3,'buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */;',e.name)_p(3,'compatibilityVersion = \"Xcode 3.2\";')_p(3,'hasScannedForEncodings = 1;')_p(3,'mainGroup = %s /* %s */;',e.id,e.name)_p(3,'projectDirPath = \"\";')if#e.projects.children>0 then\n_p(3,'projectReferences = (')for n,e in ipairs(e.projects.children)do\n_p(4,'{')_p(5,'ProductGroup = %s /* Products */;',e.productgroupid)_p(5,'ProjectRef = %s /* %s */;',e.id,path.getname(e.path))_p(4,'},')end\n_p(3,');')end\n_p(3,'projectRoot = \"\";')_p(3,'targets = (')for n,e in ipairs(e.products.children)do\n_p(4,'%s /* %s */,',e.targetid,e.name)end\n_p(3,');')_p(2,'};')_p('/* End PBXProject section */')_p('')end\nfunction e.PBXReferenceProxy(n)if#n.projects.children>0 then\n_p('/* Beg" "in PBXReferenceProxy section */')i.traverse(n.projects,{onleaf=function(n)_p(2,'%s /* %s */ = {',n.id,n.name)_p(3,'isa = PBXReferenceProxy;')_p(3,'fileType = %s;',e.gettargettype(n))_p(3,'path = \"%s\";',n.path)_p(3,'remoteRef = %s /* PBXContainerItemProxy */;',n.parent.productproxyid)_p(3,'sourceTree = BUILT_PRODUCTS_DIR;')_p(2,'};')end})_p('/* End PBXReferenceProxy section */')_p('')end\nend\nfunction e.PBXResourcesBuildPhase(n)_p('/* Begin PBXResourcesBuildPhase section */')for o,t in ipairs(n.products.children)do\n_p(2,'%s /* Resources */ = {',t.resstageid)_p(3,'isa = PBXResourcesBuildPhase;')_p(3,'buildActionMask = 2147483647;')_p(3,'files = (')i.traverse(n,{onnode=function(n)if e.getbuildcategory(n)==\"Resources\"then\n_p(4,'%s /* %s in Resources */,',n.buildid,n.name)end\nend})_p(3,');')_p(3,'runOnlyForDeploymentPostprocessing = 0;')_p(2,'};')end\n_p('/* End PBXResourcesBuildPhase section */')_p('')end\nfunction e.PBXShellScriptBuildPhase(r)local t=false\nlocal function i(a,s,p)local o=r.project[p]local" " n=table.join(o,{})for i,t in ipairs(r.configs)do\nlocal i=t[p]if#i>#o then\ntable.insert(n,'if [ \"${CONFIGURATION}\" = \"'..e.getconfigname(t)..'\" ]; then')for e=#o+1,#i do\ntable.insert(n,i[e])end\ntable.insert(n,'fi')end\nend\nif#n>0 then\nif not t then\n_p('/* Begin PBXShellScriptBuildPhase section */')t=true\nend\n_p(2,'%s /* %s */ = {',a,s)_p(3,'isa = PBXShellScriptBuildPhase;')_p(3,'buildActionMask = 2147483647;')_p(3,'files = (')_p(3,');')_p(3,'inputPaths = (');_p(3,');');_p(3,'name = %s;',s);_p(3,'outputPaths = (');_p(3,');');_p(3,'runOnlyForDeploymentPostprocessing = 0;');_p(3,'shellPath = /bin/sh;');_p(3,'shellScript = \"%s\";',table.concat(n,\"\\\\n\"):gsub('\"','\\\\\"'))_p(2,'};')end\nend\ni(\"9607AE1010C857E500CD1376\",\"Prebuild\",\"prebuildcommands\")i(\"9607AE3510C85E7E00CD1376\",\"Prelink\",\"prelinkcommands\")i(\"9607AE3710C85E8F00CD1376\",\"Postbuild\",\"postbuildcommands\")if t then\n_p('/* End PBXShellScriptBuildPhase section */')end\nend\nfunction e.PBXSourcesBuildPhase(n)_p('/* Begin" " PBXSourcesBuildPhase section */')for o,t in ipairs(n.products.children)do\n_p(2,'%s /* Sources */ = {',t.sourcesid)_p(3,'isa = PBXSourcesBuildPhase;')_p(3,'buildActionMask = 2147483647;')_p(3,'files = (')i.traverse(n,{onleaf=function(n)if e.getbuildcategory(n)==\"Sources\"then\n_p(4,'%s /* %s in Sources */,',n.buildid,n.name)end\nend})_p(3,');')_p(3,'runOnlyForDeploymentPostprocessing = 0;')_p(2,'};')end\n_p('/* End PBXSourcesBuildPhase section */')_p('')end\nfunction e.PBXVariantGroup(e)_p('/* Begin PBXVariantGroup section */')i.traverse(e,{onbranch=function(e)if e.kind==\"vgroup\"then\n_p(2,'%s /* %s */ = {',e.id,e.name)_p(3,'isa = PBXVariantGroup;')_p(3,'children = (')for n,e in ipairs(e.children)do\n_p(4,'%s /* %s */,',e.id,e.name)end\n_p(3,');')_p(3,'name = %s;',e.name)_p(3,'sourceTree = \"\";')_p(2,'};')end\nend})_p('/* End PBXVariantGroup section */')_p('')end\nfunction e.PBXTargetDependency(e)if#e.projects.children>0 then\n_p('/* Begin PBXTargetDependency section */')i.traverse(e.projects,{onle" "af=function(e)_p(2,'%s /* PBXTargetDependency */ = {',e.parent.targetdependid)_p(3,'isa = PBXTargetDependency;')_p(3,'name = \"%s\";',e.name)_p(3,'targetProxy = %s /* PBXContainerItemProxy */;',e.parent.targetproxyid)_p(2,'};')end})_p('/* End PBXTargetDependency section */')_p('')end\nend\nfunction e.XCBuildConfiguration_Target(i,t,n)local t=e.getconfigname(n)_p(2,'%s /* %s */ = {',n.xcode.targetid,t)_p(3,'isa = XCBuildConfiguration;')_p(3,'buildSettings = {')_p(4,'ALWAYS_SEARCH_USER_PATHS = NO;')if not n.flags.Symbols then\n_p(4,'DEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";')end\nif n.kind~=\"StaticLib\"and n.buildtarget.prefix~=\"\"then\n_p(4,'EXECUTABLE_PREFIX = %s;',n.buildtarget.prefix)end\nif n.targetextension then\nlocal e=n.targetextension\ne=iif(e:startswith(\".\"),e:sub(2),e)_p(4,'EXECUTABLE_EXTENSION = %s;',e)end\nlocal e=path.getdirectory(n.buildtarget.bundlepath)if e~=\".\"then\n_p(4,'CONFIGURATION_BUILD_DIR = %s;',e)end\n_p(4,'GCC_DYNAMIC_NO_PIC = NO;')_p(4,'GCC_MODEL_TUNING = G5;')if i.infopl" "ist then\n_p(4,'INFOPLIST_FILE = \"%s\";',i.infoplist.cfg.name)end\ninstallpaths={ConsoleApp='/usr/local/bin',WindowedApp='\"$(HOME)/Applications\"',SharedLib='/usr/local/lib',StaticLib='/usr/local/lib',}_p(4,'INSTALL_PATH = %s;',installpaths[n.kind])_p(4,'PRODUCT_NAME = \"%s\";',n.buildtarget.basename)_p(3,'};')_p(3,'name = \"%s\";',t)_p(2,'};')end\nfunction e.XCBuildConfiguration_Project(i,n)local o=e.getconfigname(n)_p(2,'%s /* %s */ = {',n.xcode.projectid,o)_p(3,'isa = XCBuildConfiguration;')_p(3,'buildSettings = {')local i={Native=\"$(NATIVE_ARCH_ACTUAL)\",x32=\"i386\",x64=\"x86_64\",Universal32=\"$(ARCHS_STANDARD_32_BIT)\",Universal64=\"$(ARCHS_STANDARD_64_BIT)\",Universal=\"$(ARCHS_STANDARD_32_64_BIT)\",}_p(4,'ARCHS = \"%s\";',i[n.platform])local t=path.getdirectory(n.buildtarget.bundlepath)if t~=\".\"then\n_p(4,'CONFIGURATION_BUILD_DIR = \"$(SYMROOT)\";');end\n_p(4,'CONFIGURATION_TEMP_DIR = \"$(OBJROOT)\";')if n.flags.Symbols then\n_p(4,'COPY_PHASE_STRIP = NO;')end\n_p(4,'GCC_C_LANGUAGE_STANDARD = gnu9" "9;')if n.flags.NoExceptions then\n_p(4,'GCC_ENABLE_CPP_EXCEPTIONS = NO;')end\nif n.flags.NoRTTI then\n_p(4,'GCC_ENABLE_CPP_RTTI = NO;')end\nif _ACTION~=\"xcode4\"and n.flags.Symbols and not n.flags.NoEditAndContinue then\n_p(4,'GCC_ENABLE_FIX_AND_CONTINUE = YES;')end\nif n.flags.NoExceptions then\n_p(4,'GCC_ENABLE_OBJC_EXCEPTIONS = NO;')end\nif n.flags.Optimize or n.flags.OptimizeSize then\n_p(4,'GCC_OPTIMIZATION_LEVEL = s;')elseif n.flags.OptimizeSpeed then\n_p(4,'GCC_OPTIMIZATION_LEVEL = 3;')else\n_p(4,'GCC_OPTIMIZATION_LEVEL = 0;')end\nif n.pchheader and not n.flags.NoPCH then\n_p(4,'GCC_PRECOMPILE_PREFIX_HEADER = YES;')_p(4,'GCC_PREFIX_HEADER = \"%s\";',n.pchheader)end\ne.printlist(n.defines,'GCC_PREPROCESSOR_DEFINITIONS')_p(4,'GCC_SYMBOLS_PRIVATE_EXTERN = NO;')if n.flags.FatalWarnings then\n_p(4,'GCC_TREAT_WARNINGS_AS_ERRORS = YES;')end\n_p(4,'GCC_WARN_ABOUT_RETURN_TYPE = YES;')_p(4,'GCC_WARN_UNUSED_VARIABLE = YES;')e.printlist(n.includedirs,'HEADER_SEARCH_PATHS')e.printlist(n.libdirs,'LIBRARY_SEARCH_PATH" "S')_p(4,'OBJROOT = \"%s\";',n.objectsdir)_p(4,'ONLY_ACTIVE_ARCH = %s;',iif(premake.config.isdebugbuild(n),'YES','NO'))local r={[\"-ffast-math\"]=n.flags.FloatFast,[\"-ffloat-store\"]=n.flags.FloatStrict,[\"-fomit-frame-pointer\"]=n.flags.NoFramePointer,}local i={}for n,t in pairs(r)do\nif t then\ntable.insert(i,n)end\nend\ne.printlist(table.join(i,n.buildoptions),'OTHER_CFLAGS')i={}for t,n in ipairs(premake.getlinks(n,\"system\"))do\nif not e.isframework(n)then\ntable.insert(i,\"-l\"..n)end\nend\ni=table.join(i,n.linkoptions)e.printlist(i,'OTHER_LDFLAGS')if n.flags.StaticRuntime then\n_p(4,'STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;')end\nif t~=\".\"then\n_p(4,'SYMROOT = \"%s\";',t)end\nif n.flags.ExtraWarnings then\n_p(4,'WARNING_CFLAGS = \"-Wall\";')end\n_p(3,'};')_p(3,'name = \"%s\";',o)_p(2,'};')end\nfunction e.XCBuildConfiguration(n)_p('/* Begin XCBuildConfiguration section */')for t,i in ipairs(n.products.children)do\nfor o,t in ipairs(n.configs)do\ne.XCBuildConfiguration_Target(n,i,t)end\nend\nfor t,i " "in ipairs(n.configs)do\ne.XCBuildConfiguration_Project(n,i)end\n_p('/* End XCBuildConfiguration section */')_p('')end\nfunction e.XCBuildConfigurationList(n)local i=n.project.solution\n_p('/* Begin XCConfigurationList section */')for t,i in ipairs(n.products.children)do\n_p(2,'%s /* Build configuration list for PBXNativeTarget \"%s\" */ = {',i.cfgsection,i.name)_p(3,'isa = XCConfigurationList;')_p(3,'buildConfigurations = (')for i,n in ipairs(n.configs)do\n_p(4,'%s /* %s */,',n.xcode.targetid,e.getconfigname(n))end\n_p(3,');')_p(3,'defaultConfigurationIsVisible = 0;')_p(3,'defaultConfigurationName = \"%s\";',e.getconfigname(n.configs[1]))_p(2,'};')end\n_p(2,'1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */ = {',n.name)_p(3,'isa = XCConfigurationList;')_p(3,'buildConfigurations = (')for i,n in ipairs(n.configs)do\n_p(4,'%s /* %s */,',n.xcode.projectid,e.getconfigname(n))end\n_p(3,');')_p(3,'defaultConfigurationIsVisible = 0;')_p(3,'defaultConfigurationName = \"%s\";',e.getconfigname" "(n.configs[1]))_p(2,'};')_p('/* End XCConfigurationList section */')_p('')end\nfunction e.Footer()_p(1,'};')_p('\\trootObject = 08FB7793FE84155DC02AAC07 /* Project object */;')_p('}')end", /* actions/xcode/xcode_project.lua */ "local e=premake.xcode\nlocal r=premake.tree\nfunction e.buildprjtree(o)local n=premake.project.buildsourcetree(o)n.configs={}for t,i in ipairs(o.solution.configurations)do\nfor t,r in ipairs(o.solution.xcode.platforms)do\nlocal r=premake.getconfig(o,i,r)r.xcode={}r.xcode.targetid=e.newid(o.xcode.projectnode,i)r.xcode.projectid=e.newid(n,i)table.insert(n.configs,r)end\nend\nr.traverse(n,{onbranch=function(e)if path.getextension(e.name)==\".lproj\"then\nlocal i=path.getbasename(e.name)for n,o in ipairs(e.children)do\nlocal n=e.parent.children[o.name]if not n then\nn=r.insert(e.parent,r.new(o.name))n.kind=\"vgroup\"end\no.name=path.getbasename(i)r.insert(n,o)end\nr.remove(e)end\nend})n.frameworks=r.new(\"Frameworks\")for o in premake.eachconfig(o)do\nfor o,i in ipairs(premake.getlinks(o,\"system\",\"fullpath\"))do\nlocal o=path.getname(i)if e.isframework(o)and not n.frameworks.children[o]then\nnode=r.insert(n.frameworks,r.new(o))node.path=i\nend\nend\nend\nif#n.frameworks.children>0 then\nr.insert(n,n.frameworks)" "end\nn.products=r.insert(n,r.new(\"Products\"))n.projects=r.new(\"Projects\")for t,i in ipairs(premake.getdependencies(o,\"sibling\",\"object\"))do\nlocal t=e.getxcodeprojname(i)local n=r.insert(n.projects,r.new(path.getname(t)))n.path=t\nn.project=i\nn.productgroupid=e.newid(n,\"prodgrp\")n.productproxyid=e.newid(n,\"prodprox\")n.targetproxyid=e.newid(n,\"targprox\")n.targetdependid=e.newid(n,\"targdep\")local e=premake.getconfig(i,o.configurations[1])node=r.insert(n,r.new(e.linktarget.name))node.path=e.linktarget.fullpath\nnode.cfg=e\nend\nif#n.projects.children>0 then\nr.insert(n,n.projects)end\nr.traverse(n,{onnode=function(r)r.id=e.newid(r)if e.getbuildcategory(r)then\nr.buildid=e.newid(r,\"build\")end\nif string.endswith(r.name,\"Info.plist\")then\nn.infoplist=r\nend\nend},true)node=r.insert(n.products,o.xcode.projectnode)node.kind=\"product\"node.path=node.cfg.buildtarget.fullpath\nnode.cfgsection=e.newid(node,\"cfg\")node.resstageid=e.newid(node,\"rez\")node.sourcesid=e.newid(node,\"src\")node.fxstagei" "d=e.newid(node,\"fxs\")return n\nend\nfunction premake.xcode.project(n)local n=e.buildprjtree(n)e.Header(n)e.PBXBuildFile(n)e.PBXContainerItemProxy(n)e.PBXFileReference(n)e.PBXFrameworksBuildPhase(n)e.PBXGroup(n)e.PBXNativeTarget(n)e.PBXProject(n)e.PBXReferenceProxy(n)e.PBXResourcesBuildPhase(n)e.PBXShellScriptBuildPhase(n)e.PBXSourcesBuildPhase(n)e.PBXVariantGroup(n)e.PBXTargetDependency(n)e.XCBuildConfiguration(n)e.XCBuildConfigurationList(n)e.Footer(n)end", /* actions/xcode/xcode4_workspace.lua */ "premake.xcode4={}local e=premake.xcode4\nfunction e.workspace_head()_p('')_p('')end\nfunction e.workspace_tail()_p('')end\nfunction e.workspace_file_ref(o)local e=path.getrelative(o.solution.location,o.location)if e=='.'then e=''else e=e..'/'end\n_p(1,'',e..o.name..'.xcodeproj')_p(1,'')end\nfunction e.workspace_generate(o)premake.xcode.preparesolution(o)e.workspace_head()for o in premake.solution.eachproject(o)do\ne.workspace_file_ref(o)end\ne.workspace_tail()end", /* actions/clean/_clean.lua */ "premake.clean={}function premake.clean.directory(n,e)local e=premake.project.getfilename(n,e)os.rmdir(e)end\nfunction premake.clean.file(e,n)local e=premake.project.getfilename(e,n)os.remove(e)end\nnewaction{trigger=\"clean\",description=\"Remove all binaries and generated files\",onsolution=function(n)for e in premake.action.each()do\nif e.oncleansolution then\ne.oncleansolution(n)end\nend\nend,onproject=function(e)for n in premake.action.each()do\nif n.oncleanproject then\nn.oncleanproject(e)end\nend\nif(e.objectsdir)then\npremake.clean.directory(e,e.objectsdir)end\nlocal n=e.solution.platforms or{}if not table.contains(n,\"Native\")then\nn=table.join(n,{\"Native\"})end\nfor a,n in ipairs(n)do\nfor n in premake.eachconfig(e,n)do\npremake.clean.directory(e,n.objectsdir)premake.clean.file(e,premake.gettarget(n,\"build\",\"posix\",\"windows\",\"windows\").fullpath)premake.clean.file(e,premake.gettarget(n,\"build\",\"posix\",\"posix\",\"linux\").fullpath)premake.clean.file(e,premake.gettarget(n,\"build\",\"posix" "\",\"posix\",\"macosx\").fullpath)premake.clean.file(e,premake.gettarget(n,\"build\",\"posix\",\"PS3\",\"windows\").fullpath)if n.kind==\"WindowedApp\"then\npremake.clean.directory(e,premake.gettarget(n,\"build\",\"posix\",\"posix\",\"linux\").fullpath..\".app\")end\npremake.clean.file(e,premake.gettarget(n,\"link\",\"windows\",\"windows\",\"windows\").fullpath)premake.clean.file(e,premake.gettarget(n,\"link\",\"posix\",\"posix\",\"linux\").fullpath)local n=path.join(premake.project.getfilename(e,n.buildtarget.directory),n.buildtarget.basename)for e in premake.action.each()do\nif e.oncleantarget then\ne.oncleantarget(n)end\nend\nend\nend\nend}", /* _premake_main.lua */ "local t=\"premake4.lua\"local a=\"Type 'premake4 --help' for help\"local i=\"premake4 (Premake Build Script Generator) %s\"_WORKING_DIR=os.getcwd()local function o(r)if not r then return true end\nr=premake.checkvalue(r,premake.fields.platforms.allowed)for n in premake.solution.each()do\nlocal e=n.platforms or{}if#e==0 then\ntable.insert(e,\"Native\")end\nif not table.contains(e,\"Native\")then\nreturn false,n.name..\" does not target native platform\\nNative platform settings are required for the --platform feature.\"end\nif not table.contains(e,r)then\ntable.insert(e,r)end\nn.platforms=e\nend\nreturn true\nend\nfunction _premake_main(e)if(e)then\nlocal r=dofile(e..\"/_manifest.lua\")for n,r in ipairs(r)do\ndofile(e..\"/\"..r)end\nend\n_PREMAKE_COMMAND=path.getabsolute(_PREMAKE_COMMAND)premake.action.set(_ACTION)math.randomseed(os.time())local e=_OPTIONS[\"file\"]or t\nif(os.isfile(e))then\ndofile(e)end\nif(_OPTIONS[\"version\"])then\nprintf(i,_PREMAKE_VERSION)return 1\nend\nif(_OPTIONS[\"help\"])then\npremak" "e.showhelp()return 1\nend\nif(not _ACTION)then\nprint(a)return 1\nend\nif(not os.isfile(e))then\nerror(\"No Premake script (\"..t..\") found!\",2)end\naction=premake.action.current()if(not action)then\nerror(\"Error: no such action '\".._ACTION..\"'\",0)end\nok,err=premake.option.validate(_OPTIONS)if(not ok)then error(\"Error: \"..err,0)end\nok,err=premake.checktools()if(not ok)then error(\"Error: \"..err,0)end\nok,err=o(_OPTIONS[\"platform\"])if(not ok)then error(\"Error: \"..err,0)end\nprint(\"Building configurations...\")premake.bake.buildconfigs()ok,err=premake.checkprojects()if(not ok)then error(\"Error: \"..err,0)end\nprintf(\"Running action '%s'...\",action.trigger)premake.action.call(action.trigger)print(\"Done.\")return 0\nend", 0 }; const char* builtin_script_fnames[] = { "@base/os.lua", "@base/path.lua", "@base/string.lua", "@base/table.lua", "@base/io.lua", "@base/globals.lua", "@base/action.lua", "@base/option.lua", "@base/tree.lua", "@base/solution.lua", "@base/project.lua", "@base/config.lua", "@base/bake.lua", "@base/api.lua", "@base/cmdline.lua", "@tools/dotnet.lua", "@tools/gcc.lua", "@tools/msc.lua", "@tools/ow.lua", "@tools/snc.lua", "@base/validate.lua", "@base/help.lua", "@base/premake.lua", "@actions/codeblocks/_codeblocks.lua", "@actions/codeblocks/codeblocks_workspace.lua", "@actions/codeblocks/codeblocks_cbp.lua", "@actions/codelite/_codelite.lua", "@actions/codelite/codelite_workspace.lua", "@actions/codelite/codelite_project.lua", "@actions/make/_make.lua", "@actions/make/make_solution.lua", "@actions/make/make_cpp.lua", "@actions/make/make_csharp.lua", "@actions/vstudio/_vstudio.lua", "@actions/vstudio/vs2002_solution.lua", "@actions/vstudio/vs2002_csproj.lua", "@actions/vstudio/vs2002_csproj_user.lua", "@actions/vstudio/vs200x_vcproj.lua", "@actions/vstudio/vs200x_vcproj_user.lua", "@actions/vstudio/vs2003_solution.lua", "@actions/vstudio/vs2005_solution.lua", "@actions/vstudio/vs2005_csproj.lua", "@actions/vstudio/vs2005_csproj_user.lua", "@actions/vstudio/vs2010_vcxproj.lua", "@actions/vstudio/vs2010_vcxproj_filters.lua", "@actions/vstudio/vs2012.lua", "@actions/vstudio/vs2013.lua", "@actions/vstudio/vs2015.lua", "@actions/vstudio/vs2017.lua", "@actions/vstudio/vs2019.lua", "@actions/vstudio/vs2022.lua", "@actions/xcode/_xcode.lua", "@actions/xcode/xcode_common.lua", "@actions/xcode/xcode_project.lua", "@actions/xcode/xcode4_workspace.lua", "@actions/clean/_clean.lua", "@_premake_main.lua", 0 };