From 2d36609e8ab587519f30e7adfeae85801815a154 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Sun, 23 Jan 2022 01:21:28 +0100 Subject: Arranging for VS2022 support --HG-- branch : WDS-build --- premake4.lua | 4 +- setvcvars.cmd | 48 +++++++++++++++--- src/_manifest.lua | 1 + src/actions/vstudio/vs2010_vcxproj.lua | 2 +- src/actions/vstudio/vs2022.lua | 58 ++++++++++++++++++++++ src/host/scripts.c | 37 ++++++++------ tests/actions/vstudio/sln2005/header.lua | 17 +++++++ tests/actions/vstudio/vc2010/test_config_props.lua | 13 +++++ 8 files changed, 153 insertions(+), 27 deletions(-) create mode 100644 src/actions/vstudio/vs2022.lua diff --git a/premake4.lua b/premake4.lua index cfc3dda..331d0b9 100644 --- a/premake4.lua +++ b/premake4.lua @@ -202,9 +202,9 @@ do -- Name the project files after their VS version local orig_getbasename = premake.project.getbasename premake.project.getbasename = function(prjname, pattern) - -- The below is used to insert the .vs(8|9|10|11|12|14|15) into the file names for projects and solutions + -- 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"} + 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"} if name_map[_ACTION] then pattern = pattern:gsub("%%%%", "%%%%." .. name_map[_ACTION]) else diff --git a/setvcvars.cmd b/setvcvars.cmd index 97c55fd..8eddda1 100644 --- a/setvcvars.cmd +++ b/setvcvars.cmd @@ -2,11 +2,11 @@ @if not "%OS%"=="Windows_NT" (echo This script requires Windows NT 4.0 or later to run properly! & goto :EOF) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::: 2009-2019, Oliver Schneider (assarbad.net) - PUBLIC DOMAIN/CC0 -::: Available from: +::: Available from Git mirror: ::: ::: PURPOSE: This script can be used to run the vcvars32.bat/vcvarsall.bat ::: from any of the existing Visual C++ versions starting with .NET -::: (2002) through 2019 or versions (or a single version) given on +::: (2002) through 2022 or versions (or a single version) given on ::: the command line. ::: The script will try to find the newest installed VC version by ::: iterating over the space-separated (descending) list of versions @@ -25,9 +25,29 @@ setlocal & pushd . :: Toolsets (potentially) supported set SUPPORTED_TSET=amd64 x86 ia64 x86_ia64 x86_amd64 amd64_x86 x86_arm amd64_arm :: Internal representation of the version number -set SUPPORTED_VC=16.0 15.0 14.0 12.0 11.0 10.0 9.0 8.0 7.1 7.0 +set SUPPORTED_VC=17.0 ^ +16.0 ^ +15.0 ^ +14.0 ^ +12.0 ^ +11.0 ^ +10.0 ^ +9.0 ^ +8.0 ^ +7.1 ^ +7.0 :: Marketing name of the Visual Studio versions -set SUPPORTED_NICE=2019 2017 2015 2013 2012 2010 2008 2005 2003 2002 +set SUPPORTED_NICE=2022 ^ +2019 ^ +2017 ^ +2015 ^ +2013 ^ +2012 ^ +2010 ^ +2008 ^ +2005 ^ +2003 ^ +2002 set DEFAULT_TSET=x86 if not "%~1" == "" ( if "%~1" == "/?" goto :Help @@ -107,9 +127,9 @@ goto :EOF setlocal ENABLEEXTENSIONS & set VCVER=%~1 :: We're not interested in overwriting an already existing value if defined VCVARS_PATH ( endlocal & goto :EOF ) -:: Now let's distinguish the "nice" version numbers (2002, ... 2019) from the internal ones +:: Now let's distinguish the "nice" version numbers (2002, ... 2022) from the internal ones set VCVER=%VCVER:vs=% -:: Not a "real" version number, but the marketing one (2002, ... 2019)? +:: Not a "real" version number, but the marketing one (2002, ... 2022)? if %VCVER% GEQ %MIN_NICE% call :NICE_%VCVER% > NUL 2>&1 set NUMVER=%VCVER:.0=% set NUMVER=%NUMVER:.1=% @@ -120,6 +140,9 @@ call :TSET_%VCVERLBL% > NUL 2>&1 if not defined NICEVER ( echo ERROR: This script does not know the given version Visual C++ version&endlocal&set SETVCV_ERROR=1&goto :EOF ) :: Jump over those "subs" goto :NICE_SET +:PRETTY_17_0 + set NICEVER=2022 + goto :EOF :PRETTY_16_0 set NICEVER=2019 goto :EOF @@ -150,6 +173,10 @@ goto :NICE_SET :PRETTY_7_0 set NICEVER=2002 goto :EOF +:NICE_2022 + set VCVER=17.0 + set NEWVS=1 + goto :EOF :NICE_2019 set VCVER=16.0 set NEWVS=1 @@ -200,13 +227,18 @@ goto :NICE_SET echo Trying to locate Visual C++ %NICEVER% ^(= %VCVER%, %VCTGT_TOOLSET%^) :: Is it a version below 15? Then we use the old registry keys if %NUMVER% LSS 15 goto :OLDVS +set /a NUMVERNEXT=%NUMVER%+1 echo Modern (^>=2017) Visual Studio :: This is where we intend to find the installation path in the registry -set _VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe +set _VSWHERE_PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer +set _VSWHERE=%_VSWHERE_PATH%\vswhere.exe "%_VSWHERE%" -? > NUL 2>&1 || set _VSWHERE=vswhere.exe "%_VSWHERE%" -? > NUL 2>&1 || goto :SKIPVSWHERE +set PATH=%_VSWHERE_PATH%;%PATH% +::@echo Trying to call vswhere.exe from ^(%_VSWHERE_PATH%^) with: +@echo Running: vswhere -products * -format value -property installationPath -version ^"^[%NUMVER%.0,%NUMVERNEXT%.0^)^" if not defined _VCINSTALLDIR ( - for /f "usebackq tokens=*" %%i in (`"%_VSWHERE%" -products * -format value -property installationPath -version %NUMVER%`) do ( + for /f "usebackq tokens=*" %%i in (`vswhere -products * -format value -property installationPath -version "[%NUMVER%.0,%NUMVERNEXT%.0)"`) do ( call :SetVar _VCINSTALLDIR "%%i\VC\" ) ) diff --git a/src/_manifest.lua b/src/_manifest.lua index 96225d1..30daba3 100644 --- a/src/_manifest.lua +++ b/src/_manifest.lua @@ -68,6 +68,7 @@ "actions/vstudio/vs2015.lua", "actions/vstudio/vs2017.lua", "actions/vstudio/vs2019.lua", + "actions/vstudio/vs2022.lua", -- Xcode action "actions/xcode/_xcode.lua", diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index d888504..c776b30 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -79,7 +79,7 @@ _p(2,'%s', iif(optimisation(cfg) == "Disabled","true","false")) _p(2,'%s',iif(cfg.flags.Unicode,"Unicode","MultiByte")) - local toolsets = { vs2012 = "v110", vs2013 = "v120", vs2015 = "v140", vs2017 = "v141", vs2019 = "v142" } + local toolsets = { vs2012 = "v110", vs2013 = "v120", vs2015 = "v140", vs2017 = "v141", vs2019 = "v142", vs2022 = "v143" } local toolset = toolsets[_ACTION] if toolset then _p(2,'%s', toolset) diff --git a/src/actions/vstudio/vs2022.lua b/src/actions/vstudio/vs2022.lua new file mode 100644 index 0000000..0df82ae --- /dev/null +++ b/src/actions/vstudio/vs2022.lua @@ -0,0 +1,58 @@ +-- +-- vs2022.lua +-- Baseline support for Visual Studio 2022. +-- Copyright (c) 2013 Jason Perkins and the Premake project +-- + + premake.vstudio.vc2022 = {} + local vc2022 = premake.vstudio.vc2022 + local vstudio = premake.vstudio + + +--- +-- Register a command-line action for Visual Studio 2022. +--- + + newaction + { + 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(sln) + premake.generate(sln, "%%.sln", vstudio.sln2005.generate) + end, + + onproject = function(prj) + if premake.isdotnetproject(prj) then + premake.generate(prj, "%%.csproj", vstudio.cs2005.generate) + premake.generate(prj, "%%.csproj.user", vstudio.cs2005.generate_user) + else + premake.generate(prj, "%%.vcxproj", premake.vs2010_vcxproj) + premake.generate(prj, "%%.vcxproj.user", premake.vs2010_vcxproj_user) + premake.generate(prj, "%%.vcxproj.filters", vstudio.vc2010.generate_filters) + end + end, + + + oncleansolution = premake.vstudio.cleansolution, + oncleanproject = premake.vstudio.cleanproject, + oncleantarget = premake.vstudio.cleantarget, + + vstudio = { + solutionVersion = "12", + targetFramework = "4.7", + toolsVersion = "17.0", + shortSlnVersion = "17", + } + } diff --git a/src/host/scripts.c b/src/host/scripts.c index 2601b26..67f482d 100644 --- a/src/host/scripts.c +++ b/src/host/scripts.c @@ -227,20 +227,20 @@ const char* builtin_scripts[] = { /* 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)'" - "=='%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\"}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 t" - "hen\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.NoRTTI and not e.flag" - "s.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=\"EditAndContinue\"end\ne" - "nd\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(e)if e.flags.Ex" - "traWarnings 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<" - "/EnableCOMDATFolding>')_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.individualSource" - "File(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_platform)_p(' ',premake.esc(n.name))e.debugdir(t)e.debugenvs(t)_p(' ')end\n_p('')end", + "=='%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" + "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" + "(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", /* 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" @@ -266,6 +266,10 @@ const char* builtin_scripts[] = { "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,}", @@ -291,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 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" + "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" "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 */ @@ -360,6 +364,7 @@ const char* builtin_script_fnames[] = { "@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", diff --git a/tests/actions/vstudio/sln2005/header.lua b/tests/actions/vstudio/sln2005/header.lua index 240889d..61aae75 100755 --- a/tests/actions/vstudio/sln2005/header.lua +++ b/tests/actions/vstudio/sln2005/header.lua @@ -133,6 +133,23 @@ VS 2019 seems to add something like: VisualStudioVersion = 16.0.29411.108 MinimumVisualStudioVersion = 10.0.40219.1 +which don't seem to be mandatory, though. +]] + end + + function suite.On2022() + _ACTION = "vs2022" + prepare() + test.capture [[ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 17 + ]] +--[[ +VS 2022 seems to add something like: + +VisualStudioVersion = 17.0.0.0 +MinimumVisualStudioVersion = 10.0.40219.1 + which don't seem to be mandatory, though. ]] end diff --git a/tests/actions/vstudio/vc2010/test_config_props.lua b/tests/actions/vstudio/vc2010/test_config_props.lua index b1b19ff..a5b05e1 100644 --- a/tests/actions/vstudio/vc2010/test_config_props.lua +++ b/tests/actions/vstudio/vc2010/test_config_props.lua @@ -115,3 +115,16 @@ ]] end + + function suite.structureIsCorrect_onDefaultValues_on2022() + _ACTION = "vs2022" + prepare() + test.capture [[ + + Application + true + MultiByte + v143 + + ]] + end -- cgit v1.2.3