From f691e448fa4fd2fb96684612834f29d89a5e2d2b Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Wed, 26 Jan 2022 23:39:18 +0100 Subject: Decomposing some logic, so I can hook into the per-file options --HG-- branch : WDS-build --- README.rst | 4 +-- premake4.lua | 17 ++++++---- release.cmd | 6 +--- src/actions/vstudio/vs200x_vcproj.lua | 6 +++- src/actions/vstudio/vs2010_vcxproj.lua | 5 +++ src/host/scripts.c | 62 +++++++++++++++++----------------- 6 files changed, 55 insertions(+), 45 deletions(-) diff --git a/README.rst b/README.rst index 3a745ac..1b4aebf 100644 --- a/README.rst +++ b/README.rst @@ -13,12 +13,12 @@ Downloads --------- I provide code-signed binaries in the `download area -`_ for the +`_ for the benefit of those who don't want to build the binary themselves. To get the latest code-signed build of ``premake4.exe`` simply download from `this link -`_. +`_. The ``.asc`` files corresponding to the ``.exe`` files which are named something like ``premake4.rev-$rev-$commit.exe`` are the detached PGP diff --git a/premake4.lua b/premake4.lua index 2553182..0d275bc 100644 --- a/premake4.lua +++ b/premake4.lua @@ -1,10 +1,15 @@ --[[ - This premake4.lua _requires_ windirstat/premake-stable to work properly. - If you don't want to use the code-signed build that can be found in the - download section of that project, you can build from the WDS-branch at: + This premake4.lua _requires_ windirstat/premake-stable to work properly. + If you don't want to use the code-signed build that can be found in the + ./common/ subfolder, you can build from the WDS-branch over at: - https://sourceforge.net/projects/premake4-wds/ ---]] + https://sourceforge.net/projects/windirstat/ + + Prebuilt, signed binaries are available from: + https://github.com/windirstat/premake-stable + https://sourceforge.net/projects/windirstat/files/premake-stable/ + https://osdn.net/projects/windirstat/storage/historical/premake-stable/ + ]] local action = _ACTION or "" if _OPTIONS["publish"] then print "INFO: Creating 'Publish' build solution." @@ -204,7 +209,7 @@ do premake.project.getbasename = function(prjname, pattern) -- The below is used to insert the .vs(8|9|10|11|12|14|15|16|17) into the file names for projects and solutions if _ACTION then - name_map = {vs2002 = "vs7", vs2003 = "vs7_1", vs2005 = "vs8", vs2008 = "vs9", vs2010 = "vs10", vs2012 = "vs11", vs2013 = "vs12", vs2015 = "vs14", vs2017 = "vs15", vs2019 = "vs16", vs2022 = "vs17"} + name_map = {vs2005 = "vs8", vs2008 = "vs9", vs2010 = "vs10", vs2012 = "vs11", vs2013 = "vs12", vs2015 = "vs14", vs2017 = "vs15", vs2019 = "vs16", vs2022 = "vs17"} if name_map[_ACTION] then pattern = pattern:gsub("%%%%", "%%%%." .. name_map[_ACTION]) else diff --git a/release.cmd b/release.cmd index eada9d7..ed23bd2 100644 --- a/release.cmd +++ b/release.cmd @@ -30,12 +30,8 @@ set SLNFILE=%~6 set SLNCFGNAME=%~7 set SLNCFGPLTF=%~8 vcbuild /rebuild /time "%SLNFILE%" "%SLNCFGNAME%|%SLNCFGPLTF%" -echo Would now call: -echo ollisign.cmd -2 "%BASEPATH%%BINDIR%\%BASENAME%.exe" "https://sourceforge.net/projects/windirstat/" "premake4" -::call ollisign.cmd -2 "%BASEPATH%%BINDIR%\%BASENAME%.exe" "https://sourceforge.net/projects/windirstat/" "premake4" +call ollisign.cmd -2 "%BASEPATH%%BINDIR%\%BASENAME%.exe" "https://windirstat.net" "premake4" set NEWNAME=%BASEPATH%%BASENAME%.rev-%HG_TIP_REVNO%-%HG_TIP_ID%.exe -echo Next copying and PGP-signing -pause copy /y "%BASEPATH%%BINDIR%\%BASENAME%.exe" "%NEWNAME%" sigcheck -a "%NEWNAME%" gpg --batch --yes -u 0xC779D8290E88590F -bao "%NEWNAME%.asc" "%NEWNAME%" diff --git a/src/actions/vstudio/vs200x_vcproj.lua b/src/actions/vstudio/vs200x_vcproj.lua index d119fa6..6de635d 100644 --- a/src/actions/vstudio/vs200x_vcproj.lua +++ b/src/actions/vstudio/vs200x_vcproj.lua @@ -102,6 +102,7 @@ _p(3,'>') end + vc200x.individualSourceFileOptions = nil function vc200x.individualSourceFile(prj, depth, fname, node) -- handle file configuration stuff. This needs to be cleaned up and simplified. @@ -114,7 +115,7 @@ local isSourceCode = path.iscppfile(fname) local needsCompileAs = (path.iscfile(fname) ~= premake.project.iscproject(prj)) - if usePCH or (isSourceCode and needsCompileAs) then + if usePCH or (isSourceCode and needsCompileAs) or (type(vc200x.individualSourceFileOptions) == 'function') then _p(depth, '') @@ -138,6 +139,9 @@ _p(depth, '\t\tUsePrecompiledHeader="1"') end end + if (type(vc200x.individualSourceFileOptions) == 'function') then + vc200x.individualSourceFileOptions(prj, depth, fname, node) + end _p(depth, '\t/>') _p(depth, '') diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index c776b30..04deecd 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -526,6 +526,8 @@ end end + vc2010.individualSourceFileOptions = nil + function vc2010.individualSourceFile(prj, config_mappings, file) local configs = prj.solution.vstudio_configs local translatedpath = path.translate(file.name, "\\") @@ -539,6 +541,9 @@ if path.iscfile(file.name) ~= premake.project.iscproject(prj) then _p(3,'%s', iif(path.iscfile(file.name), 'CompileAsC', 'CompileAsCpp')) end + if (type(vc2010.individualSourceFileOptions) == 'function') then + vc2010.individualSourceFileOptions(prj, config_mappings, file) + end _p(2,'') end diff --git a/src/host/scripts.c b/src/host/scripts.c index 67f482d..8e64753 100644 --- a/src/host/scripts.c +++ b/src/host/scripts.c @@ -185,22 +185,22 @@ const char* builtin_scripts[] = { " \"0\"')_p(3,'ProjectView = \"ProjectFiles\"')_p(3,'ProjectTrust = \"0\"')_p(2,'/>')_p(1,'')_p('')end", /* actions/vstudio/vs200x_vcproj.lua */ - "premake.vstudio.vc200x={}local o=premake.vstudio.vc200x\nlocal s=premake.tree\nlocal function n(e)if(_ACTION<\"vs2005\")then\nreturn iif(e,\"TRUE\",\"FALSE\")else\nreturn iif(e,\"true\",\"false\")end\nend\nfunction o.optimization(o)local e=0\nfor n,o in ipairs(o.flags)do\nif(o==\"Optimize\")then\ne=3\nelseif(o==\"OptimizeSize\")then\ne=1\nelseif(o==\"OptimizeSpeed\")then\ne=2\nend\nend\nreturn e\nend\nfunction o.header(e)io.eol=\"\\r\\n\"_p('')_p('<%s',e)_p(1,'ProjectType=\"Visual C++\"')if _ACTION==\"vs2002\"then\n_p(1,'Version=\"7.00\"')elseif _ACTION==\"vs2003\"then\n_p(1,'Version=\"7.10\"')elseif _ACTION==\"vs2005\"then\n_p(1,'Version=\"8.00\"')elseif _ACTION==\"vs2008\"then\n_p(1,'Version=\"9.00\"')end\nend\nfunction o.Configuration(o,e)_p(2,'')end\nfunction o.individualSourceFile(n,e,t,l)for o,i in ipairs(n.solution.vstudio_configs)do\nif i.isreal then\nlocal o=premake.getconfig(n,i.src_buildcfg,i.src_platform)local l=(not n.flags.NoPCH and n.pchsource==l.cfg.name)local a=path.iscppfile(t)local n=(path.iscfile(t)~=premake.project.iscproject(n))if l or(a and n)then\n_p(e,'')_p(e,'\\t')_p(e,'')end\nend\nend\nend\nfunction o.Files(n)local e=premake.project.buildsourcetree(n)s.traverse(e,{onbranchenter=function(o,e)_p(e,'')end,onbranchexit=function(o,e)_p(e,'')end,onleaf=function(t,e)local i=t.cfg.name\n_p(e,'')e=e+1\no.individualSourceFile(n,e,i,t)e=e-1\n_p(e,'')end,},false,2)end\nfunction o.Platforms(e)local o={}_p(1,'')for n,e in ipairs(e.solution.vstudio_configs)do\nif e.isreal and not table.contains(o,e.platform)then\ntable.insert(o,e.platform)_p(2,'')end\nend\n_p(1,'')end\n" - "function o.Symbols(e)if(not e.flags.Symbols)then\nreturn 0\nelse\nif e.flags.NoEditAndContinue or\no.optimization(e)~=0 or\ne.flags.Managed or\ne.platform==\"x64\"then\nreturn 3\nelse\nreturn 4\nend\nend\nend\nfunction o.VCCLCompilerTool(e)_p(3,'0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.buildoptions),\" \"))end\n_p(4,'Optimization=\"%s\"',o.optimization(e))if e.flags.NoFramePointer then\n_p(4,'OmitFramePointers=\"%s\"',n(true))end\nif#e.includedirs>0 then\n_p(4,'AdditionalIncludeDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.includedirs,\";\"),'\\\\')))end\nif#e.defines>0 then\n_p(4,'PreprocessorDefinitions=\"%s\"',premake.esc(table.concat(e.defines,\";\")))end\nif premake.config.isdebugbuild(e)and not e.flags.NoMinimalRebuild and not e.flags.Managed then\n_p(4,'MinimalRebuild=\"%s\"',n(true))end\nif e.flags.NoExceptions then\n_p(4,'ExceptionHandling=\"%" - "s\"',iif(_ACTION<\"vs2005\",\"FALSE\",0))elseif e.flags.SEH and _ACTION>\"vs2003\"then\n_p(4,'ExceptionHandling=\"2\"')end\nif o.optimization(e)==0 and not e.flags.Managed then\n_p(4,'BasicRuntimeChecks=\"3\"')end\nif o.optimization(e)~=0 then\n_p(4,'StringPooling=\"%s\"',n(true))end\nlocal i\nif premake.config.isdebugbuild(e)then\ni=iif(e.flags.StaticRuntime,1,3)else\ni=iif(e.flags.StaticRuntime,0,2)end\n_p(4,'RuntimeLibrary=\"%s\"',i)_p(4,'EnableFunctionLevelLinking=\"%s\"',n(true))if _ACTION>\"vs2003\"and e.platform~=\"Xbox360\"and e.platform~=\"x64\"then\nif e.flags.EnableSSE then\n_p(4,'EnableEnhancedInstructionSet=\"1\"')elseif e.flags.EnableSSE2 then\n_p(4,'EnableEnhancedInstructionSet=\"2\"')end\nend\nif _ACTION<\"vs2005\"then\nif e.flags.FloatFast then\n_p(4,'ImproveFloatingPointConsistency=\"%s\"',n(false))elseif e.flags.FloatStrict then\n_p(4,'ImproveFloatingPointConsistency=\"%s\"',n(true))end\nelse\nif e.flags.FloatFast then\n_p(4,'FloatingPointModel=\"2\"')elseif e.flags.FloatStrict then\n_p(4,'F" - "loatingPointModel=\"1\"')end\nend\nif _ACTION<\"vs2005\"and not e.flags.NoRTTI then\n_p(4,'RuntimeTypeInfo=\"%s\"',n(true))elseif _ACTION>\"vs2003\"and e.flags.NoRTTI and not e.flags.Managed then\n_p(4,'RuntimeTypeInfo=\"%s\"',n(false))end\nif e.flags.NativeWChar then\n_p(4,'TreatWChar_tAsBuiltInType=\"%s\"',n(true))elseif e.flags.NoNativeWChar then\n_p(4,'TreatWChar_tAsBuiltInType=\"%s\"',n(false))end\nif not e.flags.NoPCH and e.pchheader then\n_p(4,'UsePrecompiledHeader=\"%s\"',iif(_ACTION<\"vs2005\",3,2))_p(4,'PrecompiledHeaderThrough=\"%s\"',e.pchheader)else\n_p(4,'UsePrecompiledHeader=\"%s\"',iif(_ACTION>\"vs2003\"or e.flags.NoPCH,0,2))end\n_p(4,'WarningLevel=\"%s\"',iif(e.flags.ExtraWarnings,4,3))if e.flags.FatalWarnings then\n_p(4,'WarnAsError=\"%s\"',n(true))end\nif _ACTION<\"vs2008\"and not e.flags.Managed then\n_p(4,'Detect64BitPortabilityProblems=\"%s\"',n(not e.flags.No64BitChecks))end\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"',path.getbasename(e.buildtarget.name))_p(4,'DebugInformatio" - "nFormat=\"%s\"',o.Symbols(e))if e.language==\"C\"then\n_p(4,'CompileAs=\"1\"')end\n_p(3,'/>')end\nfunction o.VCLinkerTool(e)_p(3,'0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.linkoptions),\" \"))end\nif#e.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(e,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',e.buildtarget.name)_p(4,'LinkIncremental=\"%s\"',iif(premake.config.isincrementallink(e),2,1))_p(4,'AdditionalLibraryDirectories=\"%s\"',table.concat(premake.esc(path.translate(e.libdirs,'\\\\')),\";\"))local i=premake.findfile(e,\".def\")if i then\n_p(4,'ModuleDefinitionFile=\"%s\"',i)end\nif e.flags.NoManifest then\n_p(4,'GenerateManifest=\"%s\"',n(false))end\n_p(4,'GenerateDebugInformation=\"%s\"',n(o.Symbols(e)~=0))if o" - ".Symbols(e)~=0 then\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"',path.getbasename(e.buildtarget.name))end\n_p(4,'SubSystem=\"%s\"',iif(e.kind==\"ConsoleApp\",1,2))if o.optimization(e)~=0 then\n_p(4,'OptimizeReferences=\"2\"')_p(4,'EnableCOMDATFolding=\"2\"')end\nif(e.kind==\"ConsoleApp\"or e.kind==\"WindowedApp\")and not e.flags.WinMain then\n_p(4,'EntryPointSymbol=\"%s\"',iif(e.flags.Unicode,\"wmainCRTStartup\",\"mainCRTStartup\"))end\nif e.kind==\"SharedLib\"then\nlocal o=e.linktarget.fullpath\n_p(4,'ImportLibrary=\"%s\"',iif(e.flags.NoImportLib,e.objectsdir..\"\\\\\"..path.getname(o),o))end\n_p(4,'TargetMachine=\"%d\"',iif(e.platform==\"x64\",17,1))else\n_p(4,'Name=\"VCLibrarianTool\"')if#e.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(e,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',e.buildtarget.name)if#e.libdirs>0 then\n_p(4,'AdditionalLibraryDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.libdirs,\";\"))))end\nlocal o={" - "}if e.platform==\"x32\"then\ntable.insert(o,\"/MACHINE:X86\")elseif e.platform==\"x64\"then\ntable.insert(o,\"/MACHINE:X64\")end\no=table.join(o,e.linkoptions)if#o>0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(o),\" \"))end\nend\n_p(3,'/>')end\nfunction o.VCCLCompilerTool_PS3(e)_p(3,'\"vs2003\"or e.flags.NoPCH,0,2))end\n_p(4,'AdditionalOptions=\"%s\"',premake.esc(table.concat(o,\" \")))if#e.includedirs>0 then\n_p(4,'AdditionalIncludeDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.includedirs,\";\"),'\\\\')))end\nif#e.defines>0 then\n_p(4,'PreprocessorDefinitions=\"%s\"',table." - "concat(premake.esc(e.defines),\";\"))end\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"',path.getbasename(e.buildtarget.name))_p(4,'DebugInformationFormat=\"0\"')_p(4,'CompileAs=\"0\"')_p(3,'/>')end\nfunction o.VCLinkerTool_PS3(e)_p(3,'0 then\n_p(4,'AdditionalOptions=\"%s\"',premake.esc(table.concat(o,\" \")))end\nif#e.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(e,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',e.buildtarget.name)_p(4,'LinkIncremental=\"0\"')_p(4,'AdditionalLibraryDirectories=\"%s\"',table.concat(premake.esc(path.translate(e.libdirs,'\\\\')),\";\"))_p(4,'GenerateManifest=\"%s\"',n(false))_p(4,'ProgramDatabaseFile=\"\"')_p(4,'RandomizedBaseAddress=\"1\"')_p(4,'DataExecutionPrevention=\"0\"')else\n_p(4,'Name=\"VCLibrarianTool\"')local o=table.join(premake.snc.getldflags(e),e.linkoptions)if#o>0 then\n" - "_p(4,'AdditionalOptions=\"%s\"',premake.esc(table.concat(o,\" \")))end\nif#e.links>0 then\n_p(4,'AdditionalDependencies=\"%s\"',table.concat(premake.getlinks(e,\"all\",\"fullpath\"),\" \"))end\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"',e.buildtarget.name)if#e.libdirs>0 then\n_p(4,'AdditionalLibraryDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.libdirs,\";\"))))end\nend\n_p(3,'/>')end\nfunction o.VCResourceCompilerTool(e)_p(3,'0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.resoptions),\" \"))end\nif#e.defines>0 or#e.resdefines>0 then\n_p(4,'PreprocessorDefinitions=\"%s\"',table.concat(premake.esc(table.join(e.defines,e.resdefines)),\";\"))end\nif#e.includedirs>0 or#e.resincludedirs>0 then\nlocal e=table.join(e.includedirs,e.resincludedirs)_p(4,'AdditionalIncludeDirectories=\"%s\"',premake.esc(path.translate(table.concat(e,\";\"),'\\\\')))end\n_p(3,'/>')end\nfunction o.VCManifestTool(o)local e={}for n,o in ipairs(o.files" - ")do\nif path.getextension(o)==\".manifest\"then\ntable.insert(e,o)end\nend\n_p(3,'0 then\n_p(4,'AdditionalManifestFiles=\"%s\"',premake.esc(table.concat(e,\";\")))end\n_p(3,'/>')end\nfunction o.VCMIDLTool(e)_p(3,'')end\nfunction o.buildstepsblock(n,e)_p(3,'0 then\n_p(4,'CommandLine=\"%s\"',premake.esc(table.implode(e,\"\",\"\",\"\\r\\n\")))end\n_p(3,'/>')end\no.toolmap={VCCLCompilerTool=o.VCCLCompilerTool,VCCLCompilerTool_PS3=o.VCCLCompilerTool_PS3,VCLinkerTool=o.VCLinkerTool,VCLinkerTool_PS3=o.VCLinkerTool_PS3,VCManifestTool=o.VCManifestTool,VCMIDLTool=o.VCMIDLTool,VCResourceCompilerTool=o.VCResourceCompilerTool,VCPreBuildEventTool=function(e)o.buildstepsblock(\"VCPreBuildEventTool\",e.prebuildcommands)end,VCPreLinkEventTool=function(e)o.buildstepsblock(\"VCPreLinkEventTool\",e.prelinkcommands)end,VCPostBuildEventTool=function(e)o" - ".buildstepsblock(\"VCPostBuildEventTool\",e.postbuildcommands)end,}local function t(o,e)if o==\"vs2002\"then\nreturn{\"VCCLCompilerTool\",\"VCCustomBuildTool\",\"VCLinkerTool\",\"VCMIDLTool\",\"VCPostBuildEventTool\",\"VCPreBuildEventTool\",\"VCPreLinkEventTool\",\"VCResourceCompilerTool\",\"VCWebServiceProxyGeneratorTool\",\"VCWebDeploymentTool\"}end\nif o==\"vs2003\"then\nreturn{\"VCCLCompilerTool\",\"VCCustomBuildTool\",\"VCLinkerTool\",\"VCMIDLTool\",\"VCPostBuildEventTool\",\"VCPreBuildEventTool\",\"VCPreLinkEventTool\",\"VCResourceCompilerTool\",\"VCWebServiceProxyGeneratorTool\",\"VCXMLDataGeneratorTool\",\"VCWebDeploymentTool\",\"VCManagedWrapperGeneratorTool\",\"VCAuxiliaryManagedWrapperGeneratorTool\"}end\nif e==\"Xbox360\"then\nreturn{\"VCPreBuildEventTool\",\"VCCustomBuildTool\",\"VCXMLDataGeneratorTool\",\"VCWebServiceProxyGeneratorTool\",\"VCMIDLTool\",\"VCCLCompilerTool\",\"VCManagedResourceCompilerTool\",\"VCResourceCompilerTool\",\"VCPreLinkEventTool\",\"VCLinkerTool\",\"VCALinkTool\",\"VCX360" - "ImageTool\",\"VCBscMakeTool\",\"VCX360DeploymentTool\",\"VCPostBuildEventTool\",\"DebuggerTool\",}end\nif e==\"PS3\"then\nreturn{\"VCPreBuildEventTool\",\"VCCustomBuildTool\",\"VCXMLDataGeneratorTool\",\"VCWebServiceProxyGeneratorTool\",\"VCMIDLTool\",\"VCCLCompilerTool_PS3\",\"VCManagedResourceCompilerTool\",\"VCResourceCompilerTool\",\"VCPreLinkEventTool\",\"VCLinkerTool_PS3\",\"VCALinkTool\",\"VCManifestTool\",\"VCXDCMakeTool\",\"VCBscMakeTool\",\"VCFxCopTool\",\"VCAppVerifierTool\",\"VCWebDeploymentTool\",\"VCPostBuildEventTool\"}else\nreturn{\"VCPreBuildEventTool\",\"VCCustomBuildTool\",\"VCXMLDataGeneratorTool\",\"VCWebServiceProxyGeneratorTool\",\"VCMIDLTool\",\"VCCLCompilerTool\",\"VCManagedResourceCompilerTool\",\"VCResourceCompilerTool\",\"VCPreLinkEventTool\",\"VCLinkerTool\",\"VCALinkTool\",\"VCManifestTool\",\"VCXDCMakeTool\",\"VCBscMakeTool\",\"VCFxCopTool\",\"VCAppVerifierTool\",\"VCWebDeploymentTool\",\"VCPostBuildEventTool\"}end\nend\nfunction o.generate(n)o.header('VisualStudioProject')_p(1,'" - "Name=\"%s\"',premake.esc(n.name))_p(1,'ProjectGUID=\"{%s}\"',n.uuid)if _ACTION>\"vs2003\"then\n_p(1,'RootNamespace=\"%s\"',n.name)end\n_p(1,'Keyword=\"%s\"',iif(n.flags.Managed,\"ManagedCProj\",\"Win32Proj\"))_p(1,'>')o.Platforms(n)if _ACTION>\"vs2003\"then\n_p(1,'')_p(1,'')end\n_p(1,'')for e,i in ipairs(n.solution.vstudio_configs)do\nif i.isreal then\nlocal e=premake.getconfig(n,i.src_buildcfg,i.src_platform)o.Configuration(i.name,e)for i,n in ipairs(t(_ACTION,i.src_platform))do\nif o.toolmap[n]then\no.toolmap[n](e)elseif n==\"VCX360DeploymentTool\"then\n_p(3,'0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.deploymentoptions),\" \"))end\n_p(3,'/>')elseif n==\"VCX360ImageTool\"then\n_p(3,'0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(e.imageoptions),\" \"))end\nif e.imagepath~=nil then" - "\n_p(4,'OutputFileName=\"%s\"',premake.esc(path.translate(e.imagepath)))end\n_p(3,'/>')elseif n==\"DebuggerTool\"then\n_p(3,'')else\n_p(3,'')end\nend\n_p(2,'')end\nend\n_p(1,'')_p(1,'')_p(1,'')_p(1,'')o.Files(n)_p(1,'')_p(1,'')_p(1,'')_p('')end", + "premake.vstudio.vc200x={}local e=premake.vstudio.vc200x\nlocal r=premake.tree\nlocal function n(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 n,o in ipairs(o.flags)do\nif(o==\"Optimize\")then\ne=3\nelseif(o==\"OptimizeSize\")then\ne=1\nelseif(o==\"OptimizeSpeed\")then\ne=2\nend\nend\nreturn e\nend\nfunction 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(n,o)_p(2,'')end\ne.individualSourceFileOptions=nil\nfunction e.individualSourceFile(i,o,l,a)for n,t in ipairs(i.solution.vstudio_configs)do\nif t.isreal then\nlocal n=premake.getconfig(i,t.src_buildcfg,t.src_platform)local a=(not i.flags.NoPCH and i.pchsource==a.cfg.name)local s=path.iscppfile(l)local i=(path.iscfile(l)~=premake.project.iscproject(i))if a or(s and i)or(type(e.individualSourceFileOptions)=='function')then\n_p(o,'')_p(o,'\\t')_p(o,'')end\nend\nend\nend\nfunction e.Files(n)local o=premake.project.buildsourcetree(n)r.traverse(o,{onbranchenter=function(o,e)_p(e,'')end,onbranchexit=function(o,e)_p(e,'')end,onleaf=function(t,o)local i=t.cfg.name\n_p(o,'')o=o+1\ne.individualSourceFile(n,o,i,t)o=o-1\n_p(o,'')end,},false,2)end\nfunction e.Platforms(e)local o={}_p(1,'')for n,e in ipairs(e.solution.vstudio_configs)do\nif e.isreal and not table.contains(o,e.platform)then\ntable.insert(o,e.platform)_p(2," + "'')end\nend\n_p(1,'')end\nfunction 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\"',n(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 premake.config.isdebugbuild(o)and not o.flags.NoMinimalRebuild and not o.flags.Managed then\n_p(4,'Minima" + "lRebuild=\"%s\"',n(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\"',n(true))end\nlocal i\nif premake.config.isdebugbuild(o)then\ni=iif(o.flags.StaticRuntime,1,3)else\ni=iif(o.flags.StaticRuntime,0,2)end\n_p(4,'RuntimeLibrary=\"%s\"',i)_p(4,'EnableFunctionLevelLinking=\"%s\"',n(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\"',n(false))elseif o.flags.FloatStrict then\n_p(4,'ImproveFloatingPointConsistency=\"%s\"',n(true))end\nelse\nif o.flags.F" + "loatFast 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\"',n(true))elseif _ACTION>\"vs2003\"and o.flags.NoRTTI and not o.flags.Managed then\n_p(4,'RuntimeTypeInfo=\"%s\"',n(false))end\nif o.flags.NativeWChar then\n_p(4,'TreatWChar_tAsBuiltInType=\"%s\"',n(true))elseif o.flags.NoNativeWChar then\n_p(4,'TreatWChar_tAsBuiltInType=\"%s\"',n(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\"',n(true))end\nif _ACTION<\"vs2008\"and not o.flags.Managed then\n_p(4,'Detect64BitPortabilityProblems=\"%s\"',n(not o.flags.No64BitChecks))end\n_p(4,'ProgramDataBaseFileN" + "ame=\"$(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 i=premake.findfile(o,\".def\")if i then\n_p(4,'ModuleDefinitionFile=\"%s\"',i)end\nif o.flags.NoManifest then\n_p(4,'GenerateManife" + "st=\"%s\"',n(false))end\n_p(4,'GenerateDebugInformation=\"%s\"',n(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,'OutputFile=\"$(OutDir)\\\\%s\"',o.buildtarget.name)if#o.libdirs>0 then\n_p(4,'AdditionalLibraryDirect" + "ories=\"%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 then\n_p(4,'AdditionalIncludeDirectories=\"%s\"',premake.esc(path.translate(table.concat(e.includedirs" + ",\";\"),'\\\\')))end\nif#e.defines>0 then\n_p(4,'PreprocessorDefinitions=\"%s\"',table.concat(premake.esc(e.defines),\";\"))end\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"',path.getbasename(e.buildtarget.name))_p(4,'DebugInformationFormat=\"0\"')_p(4,'CompileAs=\"0\"')_p(3,'/>')end\nfunction 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\"',n(false))_p(4,'ProgramDatabaseFile=\"\"')_p(4,'RandomizedBaseAddress=\"1\"')_p(4,'DataExecutionPrevention=\"0\"')else\n_p(4,'Name=\"VCLi" + "brarianTool\"')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.resincludedirs)_p(4,'AdditionalIncludeDirectories=\"%s\"',premake.esc(path.translate(table.concat(e,\";\"),'" + "\\\\')))end\n_p(3,'/>')end\nfunction e.VCManifestTool(o)local e={}for n,o in ipairs(o.files)do\nif path.getextension(o)==\".manifest\"then\ntable.insert(e,o)end\nend\n_p(3,'0 then\n_p(4,'AdditionalManifestFiles=\"%s\"',premake.esc(table.concat(e,\";\")))end\n_p(3,'/>')end\nfunction e.VCMIDLTool(e)_p(3,'')end\nfunction e.buildstepsblock(n,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.buildstepsblock(\"VCPreBuildEventTool\",o.prebuildcommands)end,VCPreLinkEventTool=function(o)e.bui" + "ldstepsblock(\"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\",\"VCWebServiceProxyGeneratorTool\",\"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\",\"VCXDCMakeTool\",\"VCBscMakeTool\",\"VCFxCopTool\",\"VCAppVerifierTool\",\"VCWebDeploymentTool\",\"V" + "CPostBuildEventTool\"}end\nend\nfunction e.generate(n)e.header('VisualStudioProject')_p(1,'Name=\"%s\"',premake.esc(n.name))_p(1,'ProjectGUID=\"{%s}\"',n.uuid)if _ACTION>\"vs2003\"then\n_p(1,'RootNamespace=\"%s\"',n.name)end\n_p(1,'Keyword=\"%s\"',iif(n.flags.Managed,\"ManagedCProj\",\"Win32Proj\"))_p(1,'>')e.Platforms(n)if _ACTION>\"vs2003\"then\n_p(1,'')_p(1,'')end\n_p(1,'')for o,i in ipairs(n.solution.vstudio_configs)do\nif i.isreal then\nlocal o=premake.getconfig(n,i.src_buildcfg,i.src_platform)e.Configuration(i.name,o)for i,n in ipairs(t(_ACTION,i.src_platform))do\nif e.toolmap[n]then\ne.toolmap[n](o)elseif n==\"VCX360DeploymentTool\"then\n_p(3,'0 then\n_p(4,'AdditionalOptions=\"%s\"',table.concat(premake.esc(o.deploymentoptions),\" \"))end\n_p(3,'/>')elseif n==\"VCX360ImageTool\"then\n_p(3,'0 then\n_p(4,'AdditionalOp" + "tions=\"%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 n==\"DebuggerTool\"then\n_p(3,'')else\n_p(3,'')end\nend\n_p(2,'')end\nend\n_p(1,'')_p(1,'')_p(1,'')_p(1,'')e.Files(n)_p(1,'')_p(1,'')_p(1,'')_p('')end", /* actions/vstudio/vs200x_vcproj_user.lua */ "local e=premake.vstudio.vc200x\nfunction e.generate_user(i)e.header('VisualStudioUserFile')_p(1,'ShowAllFiles=\"false\"')_p(1,'>')_p(1,'')for r,n in ipairs(i.solution.vstudio_configs)do\nif n.isreal then\nlocal i=premake.getconfig(i,n.src_buildcfg,n.src_platform)_p(2,'')e.debugdir(i)_p(2,'')end\nend\n_p(1,'')_p('')end\nfunction e.environmentargs(e)if e.environmentargs and#e.environmentargs>0 then\n_p(4,'Environment=\"%s\"',string.gsub(table.concat(e.environmentargs,\" \"),'\"','"'))if e.flags.EnvironmentArgsDontMerge then\n_p(4,'EnvironmentMerge=\"false\"')end\nend\nend\nfunction e.debugdir(n)_p(3,'0 then\n_p(4,'CommandArguments=\"%s\"',table.concat(n.debugargs,\" \"))end\ne.environmentargs(n)_p(3,'/>')end", @@ -226,24 +226,24 @@ const char* builtin_scripts[] = { "local e=premake.vstudio.cs2005\nfunction e.generate_user(e)io.eol=\"\\r\\n\"_p('')_p(' ')local e=table.translate(e.libdirs,function(t)return path.getabsolute(e.location..\"/\"..t)end)_p(' %s',path.translate(table.concat(e,\";\"),\"\\\\\"))_p(' ')_p('')end", /* actions/vstudio/vs2010_vcxproj.lua */ - "premake.vstudio.vc2010={}local e=premake.vstudio.vc2010\nlocal p=premake.vstudio\nlocal function l(e)_p(1,'')for n,e in ipairs(e.solution.vstudio_configs)do\n_p(2,'',premake.esc(e.name))_p(3,'%s',e.buildcfg)_p(3,'%s',e.platform)_p(2,'')end\n_p(1,'')end\nlocal function s(e)_p(1,'')_p(2,'{%s}',e.uuid)_p(2,'%s',e.name)if e.flags and e.flags.Managed then\n_p(2,'v4.0')_p(2,'ManagedCProj')else\n_p(2,'Win32Proj')end\n_p(1,'')end\nfunction e.config_type(e)local n={SharedLib=\"DynamicLibrary\",StaticLib=\"StaticLibrary\",ConsoleApp=\"Application\",WindowedApp=\"Application\"}return n[e.kind]end\nlocal function i()return\"Condition=\\\"'$(Configuration)|$(Platform)'" + "premake.vstudio.vc2010={}local e=premake.vstudio.vc2010\nlocal l=premake.vstudio\nlocal function p(e)_p(1,'')for n,e in ipairs(e.solution.vstudio_configs)do\n_p(2,'',premake.esc(e.name))_p(3,'%s',e.buildcfg)_p(3,'%s',e.platform)_p(2,'')end\n_p(1,'')end\nlocal function r(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 r(n)for t,e in ipairs(n.solution.vstudio_configs)do\nlocal n=premake.getconfig(n,e.src_buildcfg,e.src_platform)_p(1,'',premake.esc(e.name))_p(2,'')_p(1,'')end\nend\nfunction e.outputProperties(e)for n,t in ipairs(e.solution.vstudio_configs)do\nlocal e=premake.getconfig(e,t.src_buildcfg,t.src_platform)local n=e.buildtarget\n_p(1,'',premake.esc(t.name))_p(2,'%s\\\\',premake.esc(n.directory))if e.platform==\"Xbox360\"then\n_p(2,'$(OutDir)%s',premake.esc(n.name))end\n_p(2,'%s\\\\',premake.esc(e.objectsdir))_p(2,'%s',premake.esc(path.getbasename(n.name)))" - "_p(2,'%s',premake.esc(path.getextension(n.name)))if e.kind==\"SharedLib\"then\nlocal e=(e.flags.NoImportLib~=nil)_p(2,'%s',tostring(e))end\nif e.kind~=\"StaticLib\"then\n_p(2,'%s',tostring(premake.config.isincrementallink(e)))end\nif e.flags.NoManifest then\n_p(2,'false')end\n_p(1,'')end\nend\nlocal function d(i)local n\nlocal e=i.flags\nif premake.config.isdebugbuild(i)then\nn=iif(e.StaticRuntime and not e.Managed,\"MultiThreadedDebug\",\"MultiThreadedDebugDLL\")else\nn=iif(e.StaticRuntime and not e.Managed,\"MultiThreaded\",\"MultiThreadedDLL\")end\nreturn n\nend\nlocal function f(e)if not e.flags.NoPCH and e.pchheader then\n_p(3,'Use')_p(3,'%s',e.pchheader)else\n_p(3,'')end\nend\nlocal function t(n,e)if#e.defines>0 then\n_p(n,'%s;%%(PreprocessorDefinitions)',premake.esc(table.concat(e.defines,\";\")))else\n_p(n,'')end\nend\nlocal function P(n,e)if#e.includedirs>0 then\n_p(n,'%s;%%(AdditionalIncludeDirectories)',premake.esc(path.translate(table.concat(e.includedirs,\";\"),'\\\\')))end\nend\nlocal function n(n,e)if#e.includedirs>0 or#e.resincludedirs>0 then\nlocal e=table.join(e.includedirs,e.resincludedirs)_p(n,'%s;%%(AdditionalIncludeDirectories)',premake.esc(path.translate(table.concat(e,\";\"),'\\\\')))end\nend\nlocal function h(e)_p(2,'')t(3,e)n(3,e)_p(2,'')end\nlocal function u(e)if e.flags.NoExceptions then\n_p(2,'false')elseif e.flags.SEH then\n_p(2,'Async')end\nend\nlocal function c(e)if e.flags.NoRTT" + ".flags.Managed then\n_p(2,'true')end\n_p(1,'')end\nlocal function s(n)for t,e in ipairs(n.solution.vstudio_configs)do\nlocal n=premake.getconfig(n,e.src_buildcfg,e.src_platform)_p(1,'',premake.esc(e.name))_p(2,'')_p(1,'')end\nend\nfunction e.outputProperties(e)for n,t in ipairs(e.solution.vstudio_configs)do\nlocal e=premake.getconfig(e,t.src_buildcfg,t.src_platform)local n=e.buildtarget\n_p(1,'',premake.esc(t.name))_p(2,'%s\\\\',premake.esc(n.directory))if e.platform==\"Xbox360\"then\n_p(2,'$(OutDir)%s',premake.esc(n.name))end\n_p(2,'%s\\\\',premake.esc(e.objectsdir))_p(2,'%s',premake.esc(path.getbasename(n.name)))" + "_p(2,'%s',premake.esc(path.getextension(n.name)))if e.kind==\"SharedLib\"then\nlocal e=(e.flags.NoImportLib~=nil)_p(2,'%s',tostring(e))end\nif e.kind~=\"StaticLib\"then\n_p(2,'%s',tostring(premake.config.isincrementallink(e)))end\nif e.flags.NoManifest then\n_p(2,'false')end\n_p(1,'')end\nend\nlocal function d(i)local n\nlocal e=i.flags\nif premake.config.isdebugbuild(i)then\nn=iif(e.StaticRuntime and not e.Managed,\"MultiThreadedDebug\",\"MultiThreadedDebugDLL\")else\nn=iif(e.StaticRuntime and not e.Managed,\"MultiThreaded\",\"MultiThreadedDLL\")end\nreturn n\nend\nlocal function C(e)if not e.flags.NoPCH and e.pchheader then\n_p(3,'Use')_p(3,'%s',e.pchheader)else\n_p(3,'')end\nend\nlocal function t(n,e)if#e.defines>0 then\n_p(n,'%s;%%(PreprocessorDefinitions)',premake.esc(table.concat(e.defines,\";\")))else\n_p(n,'')end\nend\nlocal function P(n,e)if#e.includedirs>0 then\n_p(n,'%s;%%(AdditionalIncludeDirectories)',premake.esc(path.translate(table.concat(e.includedirs,\";\"),'\\\\')))end\nend\nlocal function a(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 f(e)_p(2,'')t(3,e)a(3,e)_p(2,'')end\nlocal function u(e)if e.flags.NoExceptions then\n_p(2,'false')elseif e.flags.SEH then\n_p(2,'Async')end\nend\nlocal function c(e)if e.flags.NoRTT" "I and not e.flags.Managed then\n_p(3,'false')end\nend\nlocal function m(e)if e.flags.NativeWChar then\n_p(3,'true')elseif e.flags.NoNativeWChar then\n_p(3,'false')end\nend\nlocal function g(e)if e.flags.EnableSSE then\n_p(3,'StreamingSIMDExtensions')elseif e.flags.EnableSSE2 then\n_p(3,'StreamingSIMDExtensions2')end\nend\nlocal function b(e)if e.flags.FloatFast then\n_p(3,'Fast')elseif e.flags.FloatStrict and not e.flags.Managed then\n_p(3,'Strict')end\nend\nlocal function a(e)local n=''if e.flags.Symbols then\nif e.platform==\"x64\"or e.flags.Managed\nor premake.config.isoptimizedbuild(e.flags)or e.flags.NoEditAndContinue\nthen\nn=\"ProgramDatabase\"else\nn=\"EditAnd" - "Continue\"end\nend\n_p(3,'%s',n)end\nlocal function n(e)if premake.config.isdebugbuild(e)and not e.flags.NoMinimalRebuild then\n_p(3,'true')else\n_p(3,'false')end\nend\nlocal function _(e)if e.language==\"C\"then\n_p(3,'CompileAsC')end\nend\nlocal function C(e)_p(2,'')if#e.buildoptions>0 then\n_p(3,'%s %%(AdditionalOptions)',table.concat(premake.esc(e.buildoptions),\" \"))end\n_p(3,'%s',o(e))P(3,e)t(3,e)n(e)if not premake.config.isoptimizedbuild(e.flags)then\nif not e.flags.Managed then\n_p(3,'EnableFastChecks')end\nif e.flags.ExtraWarnings then\n_p(3,'true')end\nelse\n_p(3,'true')end\n_p(3,'%s',d(e))_p(3,'true')f" + "Continue\"end\nend\n_p(3,'%s',n)end\nlocal function n(e)if premake.config.isdebugbuild(e)and not e.flags.NoMinimalRebuild then\n_p(3,'true')else\n_p(3,'false')end\nend\nlocal function _(e)if e.language==\"C\"then\n_p(3,'CompileAsC')end\nend\nlocal function h(e)_p(2,'')if#e.buildoptions>0 then\n_p(3,'%s %%(AdditionalOptions)',table.concat(premake.esc(e.buildoptions),\" \"))end\n_p(3,'%s',o(e))P(3,e)t(3,e)n(e)if not premake.config.isoptimizedbuild(e.flags)then\nif not e.flags.Managed then\n_p(3,'EnableFastChecks')end\nif e.flags.ExtraWarnings then\n_p(3,'true')end\nelse\n_p(3,'true')end\n_p(3,'%s',d(e))_p(3,'true')C" "(e)if e.flags.ExtraWarnings then\n_p(3,'Level4')else\n_p(3,'Level3')end\nif e.flags.FatalWarnings then\n_p(3,'true')end\nu(e)c(e)m(e)g(e)b(e)a(e)if e.flags.Symbols then\n_p(3,'$(OutDir)%s.pdb',path.getbasename(e.buildtarget.name))end\nif e.flags.NoFramePointer then\n_p(3,'true')end\n_(e)_p(2,'')end\nlocal function c(e)if#e.postbuildcommands>0 then\n_p(2,'')_p(3,'%s',premake.esc(table.implode(e.postbuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'')end\nif#e.prebuildcommands>0 then\n_p(2,'')_p(3,'%s',premake.esc(table.implode(e.prebuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'')end\nif#e.prelinkcommands>0 then\n_p(2,'')_p(3,'%s',premake.esc(table.implode(e.prelinkcommands,\"\",\"\",\"\\r" "\\n\")))_p(2,'')end\nend\nlocal function o(n,e)if#e.linkoptions>0 then\n_p(n,'%s %%(AdditionalOptions)',table.concat(premake.esc(e.linkoptions),\" \"))end\nend\nlocal function t(i,e)local n={x32='MachineX86',x64='MachineX64'}if n[e.platform]then\n_p(i,'%s',n[e.platform])end\nend\nlocal function a(e)if e.kind=='StaticLib'and e.platform~=\"Xbox360\"then\n_p(1,'')_p(2,'$(OutDir)%s',e.buildtarget.name)o(2,e)t(2,e)_p(1,'')end\nend\nlocal function d(e)if e.kind==\"SharedLib\"then\nlocal n=e.linktarget.fullpath\n_p(3,'%s',iif(e.flags.NoImportLib,e.objectsdir..\"\\\\\"..path.getname(n),n))end\nend\nfunction e.link(n)_p(2,'')_p(3,'%s',iif(n.kind==\"ConsoleApp\",\"Console\",\"Windows\"))_p(3,'%s',tostring(n.flags.Symbols~=nil))if premake.config.isoptimizedbuild(n.flags)then\n_p(3,'true')_p(3,'true')end\nif n.kind~='StaticLib'then\ne.additionalDependencies(n)_p(3,'$(OutDir)%s',n.buildtarget.name)if#n.libdirs>0 then\n_p(3,'%s;%%(AdditionalLibraryDirectories)',premake.esc(path.translate(table.concat(n.libdirs,';'),'\\\\')))end\nif e.config_type(n)=='Application'and not n.flags.WinMain and not n.flags.Managed then\n_p(3,'%s',iif(n.flags.Unicode,\"wmainCRTStartup\",\"mainCRTStartup\"))end\nd(n)local e=premake.findfile(n,\".def\")if e then\n_p(3,'%s',e)end\nt(3,n)o(3,n)end\n_p(2,'')end\nfunction e.additionalDependencies(e)local e=premake.getlinks(e,\"system\",\"fullpath\")if#e>0 then\n_p(3,'%s;%%(AdditionalDependencies)',table.concat(e,\";\"))end\nend\nlocal function d(n)for o,t in ipairs(n.solution" - ".vstudio_configs)do\nlocal n=premake.getconfig(n,t.src_buildcfg,t.src_platform)_p(1,'',premake.esc(t.name))C(n)h(n)a(n)e.link(n)c(n)_p(1,'')end\nend\nfunction e.getfilegroup(i,t)local e=i.vc2010sortedfiles\nif not e then\ne={ClCompile={},ClInclude={},None={},ResourceCompile={},}for n in premake.project.eachfile(i)do\nif path.iscppfile(n.name)then\ntable.insert(e.ClCompile,n)elseif path.iscppheader(n.name)then\ntable.insert(e.ClInclude,n)elseif path.isresourcefile(n.name)then\ntable.insert(e.ResourceCompile,n)else\ntable.insert(e.None,n)end\nend\ni.vc2010sortedfiles=e\nend\nreturn e[t]end\nfunction e.files(n)e.simplefilesgroup(n,\"ClInclude\")e.compilerfilesgroup(n)e.simplefilesgroup(n,\"None\")e.simplefilesgroup(n,\"ResourceCompile\")end\nfunction e.simplefilesgroup(i,n)local e=e.getfilegroup(i,n)if#e>0 then\n_p(1,'')for i,e in ipairs(e)do\n_p(2,'<%s Include=\"%s\" />',n,path.translate(e.name,\"\\\\\"))end\n_p(1,'')end\nend\nfunction e" - ".individualSourceFile(a,t,n)local e=a.solution.vstudio_configs\nlocal o=path.translate(n.name,\"\\\\\")_p(2,'',o)for n,e in ipairs(e)do\nif t[e]and o==t[e]then\n_p(3,'Create',premake.esc(e.name))t[e]=nil\nend\nend\nif path.iscfile(n.name)~=premake.project.iscproject(a)then\n_p(3,'%s',iif(path.iscfile(n.name),'CompileAsC','CompileAsCpp'))end\n_p(2,'')end\nfunction e.compilerfilesgroup(n)local i=n.solution.vstudio_configs\nlocal o=e.getfilegroup(n,\"ClCompile\")if#o>0 then\nlocal t={}for e,i in ipairs(i)do\nlocal e=premake.getconfig(n,i.src_buildcfg,i.src_platform)if e.pchheader and e.pchsource and not e.flags.NoPCH then\nt[i]=path.translate(e.pchsource,\"\\\\\")end\nend\n_p(1,'')for o,i in ipairs(o)do\ne.individualSourceFile(n,t,i)end\n_p(1,'')end\nend\nfunction e.header(n)io.eol=\"\\r\\n\"_p('')local e=\"\"if n then\ne=' DefaultTargets=\"" - "'..n..'\"'end\n_p('',e)end\nfunction premake.vs2010_vcxproj(n)io.indent=\" \"e.header(\"Build\")l(n)s(n)_p(1,'')for t,i in ipairs(n.solution.vstudio_configs)do\nlocal n=premake.getconfig(n,i.src_buildcfg,i.src_platform)e.configurationPropertyGroup(n,i)end\n_p(1,'')_p(1,'')_p(1,'')r(n)_p(1,'')e.outputProperties(n)d(n)e.files(n)e.projectReferences(n)_p(1,'')_p(1,'')_p(1,'')_p('')end\nfunction e.projectReferences(n)local e=premake.getdependencies(n)if#e>0 then\n_p(1,'')for i,e in ipairs(e)do\nlocal n=path.getrelative(n.location,p.projectfile(e))_p(2,'',path.translate(n,\"\\\\\"))_p(3,'{%s}',e.uuid)_p(2,'')end\n_p(1,'')end\nend\nfunction e.debugdir(e)if e.debugdir then\n_p(' %s',path.translate(e.debugdir,'\\\\'))_p(' WindowsLocalDebugger')end\nif e.debugargs then\n_p(' %s',table.concat(e.debugargs,\" \"))end\nend\nfunction e.debugenvs(e)if e.debugenvs and#e.debugenvs>0 then\n_p(2,'%s%s',table.concat(e.debugenvs,\"\\n\"),iif(e.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)',''))if e.flags.DebugEnvsDontMerge then\n_p(2,'false')end\nend\nend\nfunction premake.vs2010_vcxproj_user(t)io.indent=\" \"e.header()for o,n in ipairs(t.solution.vstudio_configs)do\nlocal t=premake.getconfig(t,n.src_buildcfg,n.src_p" - "latform)_p(' ',premake.esc(n.name))e.debugdir(t)e.debugenvs(t)_p(' ')end\n_p('')end", + ".vstudio_configs)do\nlocal n=premake.getconfig(n,t.src_buildcfg,t.src_platform)_p(1,'',premake.esc(t.name))h(n)f(n)a(n)e.link(n)c(n)_p(1,'')end\nend\nfunction e.getfilegroup(i,t)local e=i.vc2010sortedfiles\nif not e then\ne={ClCompile={},ClInclude={},None={},ResourceCompile={},}for n in premake.project.eachfile(i)do\nif path.iscppfile(n.name)then\ntable.insert(e.ClCompile,n)elseif path.iscppheader(n.name)then\ntable.insert(e.ClInclude,n)elseif path.isresourcefile(n.name)then\ntable.insert(e.ResourceCompile,n)else\ntable.insert(e.None,n)end\nend\ni.vc2010sortedfiles=e\nend\nreturn e[t]end\nfunction e.files(n)e.simplefilesgroup(n,\"ClInclude\")e.compilerfilesgroup(n)e.simplefilesgroup(n,\"None\")e.simplefilesgroup(n,\"ResourceCompile\")end\nfunction e.simplefilesgroup(i,n)local e=e.getfilegroup(i,n)if#e>0 then\n_p(1,'')for i,e in ipairs(e)do\n_p(2,'<%s Include=\"%s\" />',n,path.translate(e.name,\"\\\\\"))end\n_p(1,'')end\nend\nfunction e" + ".individualSourceFileOptions(o,t,n)local e=o.solution.vstudio_configs\nlocal a=path.translate(n.name,\"\\\\\")for n,e in ipairs(e)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\nend\nfunction e.individualSourceFile(o,t,n)local i=path.translate(n.name,\"\\\\\")_p(2,'',i)e.individualSourceFileOptions(o,t,n)_p(2,'')end\nfunction e.compilerfilesgroup(n)local i=n.solution.vstudio_configs\nlocal o=e.getfilegroup(n,\"ClCompile\")if#o>0 then\nlocal t={}for e,i in ipairs(i)do\nlocal e=premake.getconfig(n,i.src_buildcfg,i.src_platform)if e.pchheader and e.pchsource and not e.flags.NoPCH then\nt[i]=path.translate(e.pchsource,\"\\\\\")end\nend\n_p(1,'')for o,i in ipairs(o)do\ne.individualSourceFile(n,t,i)end\n_p(1,'')end\nend\nfunc" + "tion e.header(n)io.eol=\"\\r\\n\"_p('')local e=\"\"if n then\ne=' DefaultTargets=\"'..n..'\"'end\n_p('',e)end\nfunction premake.vs2010_vcxproj(n)io.indent=\" \"e.header(\"Build\")p(n)r(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,'')s(n)_p(1,'')e.outputProperties(n)d(n)e.files(n)e.projectReferences(n)_p(1,'')_p(1,'')_p(1,'')_p('')end\nfunction e.projectReferences(n)local e=premake.getdependencies(n)if" + "#e>0 then\n_p(1,'')for i,e in ipairs(e)do\nlocal n=path.getrelative(n.location,l.projectfile(e))_p(2,'',path.translate(n,\"\\\\\"))_p(3,'{%s}',e.uuid)_p(2,'')end\n_p(1,'')end\nend\nfunction e.debugdir(e)if e.debugdir then\n_p(' %s',path.translate(e.debugdir,'\\\\'))_p(' WindowsLocalDebugger')end\nif e.debugargs then\n_p(' %s',table.concat(e.debugargs,\" \"))end\nend\nfunction e.debugenvs(e)if e.debugenvs and#e.debugenvs>0 then\n_p(2,'%s%s',table.concat(e.debugenvs,\"\\n\"),iif(e.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)',''))if e.flags.DebugEnvsDontMerge then\n_p(2,'false')end\nend\nend\nfunction premake.vs2010_vcxproj_user(t)" + "io.indent=\" \"e.header()for o,n in ipairs(t.solution.vstudio_configs)do\nlocal t=premake.getconfig(t,n.src_buildcfg,n.src_platform)_p(' ',premake.esc(n.name))e.debugdir(t)e.debugenvs(t)_p(' ')end\n_p('')end", /* 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" + "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 r=1,#i-1 do\nif not t then\nt=true\n_p(1,'')end\ne=e..i[r]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 */ @@ -295,8 +295,8 @@ const char* builtin_scripts[] = { "(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 o=premake.tree\nfunction e.buildprjtree(r)local n=premake.project.buildsourcetree(r)n.configs={}for t,i in ipairs(r.solution.configurations)do\nfor t,o in ipairs(r.solution.xcode.platforms)do\nlocal o=premake.getconfig(r,i,o)o.xcode={}o.xcode.targetid=e.newid(r.xcode.projectnode,i)o.xcode.projectid=e.newid(n,i)table.insert(n.configs,o)end\nend\no.traverse(n,{onbranch=function(e)if path.getextension(e.name)==\".lproj\"then\nlocal i=path.getbasename(e.name)for n,r in ipairs(e.children)do\nlocal n=e.parent.children[r.name]if not n then\nn=o.insert(e.parent,o.new(r.name))n.kind=\"vgroup\"end\nr.name=path.getbasename(i)o.insert(n,r)end\no.remove(e)end\nend})n.frameworks=o.new(\"Frameworks\")for r in premake.eachconfig(r)do\nfor r,i in ipairs(premake.getlinks(r,\"system\",\"fullpath\"))do\nlocal r=path.getname(i)if e.isframework(r)and not n.frameworks.children[r]then\nnode=o.insert(n.frameworks,o.new(r))node.path=i\nend\nend\nend\nif#n.frameworks.children>0 then\no.insert(n,n.frameworks)" - "end\nn.products=o.insert(n,o.new(\"Products\"))n.projects=o.new(\"Projects\")for t,i in ipairs(premake.getdependencies(r,\"sibling\",\"object\"))do\nlocal t=e.getxcodeprojname(i)local n=o.insert(n.projects,o.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,r.configurations[1])node=o.insert(n,o.new(e.linktarget.name))node.path=e.linktarget.fullpath\nnode.cfg=e\nend\nif#n.projects.children>0 then\no.insert(n,n.projects)end\no.traverse(n,{onnode=function(o)o.id=e.newid(o)if e.getbuildcategory(o)then\no.buildid=e.newid(o,\"build\")end\nif string.endswith(o.name,\"Info.plist\")then\nn.infoplist=o\nend\nend},true)node=o.insert(n.products,r.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" + "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 */ @@ -307,8 +307,8 @@ const char* builtin_scripts[] = { "\",\"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 i=\"Type 'premake4 --help' for help\"local a=\"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(a,_PREMAKE_VERSION)return 1\nend\nif(_OPTIONS[\"help\"])then\npremak" - "e.showhelp()return 1\nend\nif(not _ACTION)then\nprint(i)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", + "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 }; -- cgit v1.2.3