Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Schneider <oliver@assarbad.net>2019-11-06 23:10:52 +0300
committerOliver Schneider <oliver@assarbad.net>2019-11-06 23:10:52 +0300
commit58629d9bc6a77685fb2b86445cbb2e02573b2e70 (patch)
treeca8f35811b374b63ff036b6cad39a6c9fba8ba72
parent867b97e99bb48724d3c7efbe429f5e6509700b80 (diff)
parent6e74d01f94cba36a48fa7faee0e03ae213ba2bb7 (diff)
Merge with vs2019_support
--HG-- branch : WDS-build
-rw-r--r--premake4.lua2
-rw-r--r--release.cmd2
-rw-r--r--setvcvars.cmd211
-rw-r--r--src/_manifest.lua1
-rw-r--r--src/actions/vstudio/vs2010_vcxproj.lua2
-rw-r--r--src/actions/vstudio/vs2019.lua58
-rw-r--r--src/host/keccak.c8
-rwxr-xr-xsrc/host/os_getversion.c192
-rwxr-xr-xsrc/host/os_is64bit.c28
-rw-r--r--src/host/premake4.rc2
-rw-r--r--src/host/scripts.c37
-rwxr-xr-xtests/actions/vstudio/sln2005/header.lua23
-rw-r--r--tests/actions/vstudio/vc2010/test_config_props.lua13
13 files changed, 420 insertions, 159 deletions
diff --git a/premake4.lua b/premake4.lua
index c930eb9..4360dd9 100644
--- a/premake4.lua
+++ b/premake4.lua
@@ -204,7 +204,7 @@ do
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
if _ACTION then
- name_map = {vs2002 = "vs7", vs2003 = "vs7_1", vs2005 = "vs8", vs2008 = "vs9", vs2010 = "vs10", vs2012 = "vs11", vs2013 = "vs12", vs2015 = "vs14", vs2017 = "vs15"}
+ name_map = {vs2002 = "vs7", vs2003 = "vs7_1", vs2005 = "vs8", vs2008 = "vs9", vs2010 = "vs10", vs2012 = "vs11", vs2013 = "vs12", vs2015 = "vs14", vs2017 = "vs15", vs2019 = "vs16"}
if name_map[_ACTION] then
pattern = pattern:gsub("%%%%", "%%%%." .. name_map[_ACTION])
else
diff --git a/release.cmd b/release.cmd
index 3a2eff2..71fc201 100644
--- a/release.cmd
+++ b/release.cmd
@@ -33,7 +33,7 @@ vcbuild /rebuild /time "%SLNFILE%" "%SLNCFGNAME%|%SLNCFGPLTF%"
set NEWNAME=%BASEPATH%%BASENAME%.rev-%HG_TIP_REVNO%-%HG_TIP_ID%.exe
copy /y "%BASEPATH%%BINDIR%\%BASENAME%.exe" "%NEWNAME%"
sigcheck -a "%NEWNAME%"
-gpg2 --batch --yes -u 0xC779D8290E88590F -bao "%NEWNAME%.asc" "%NEWNAME%"
+gpg --batch --yes -u 0xC779D8290E88590F -bao "%NEWNAME%.asc" "%NEWNAME%"
copy /y "%BASEPATH%%BINDIR%\%BASENAME%.exe" "%BASEPATH%%BASENAME%.exe"
endlocal
goto :EOF
diff --git a/setvcvars.cmd b/setvcvars.cmd
index 67062b0..97c55fd 100644
--- a/setvcvars.cmd
+++ b/setvcvars.cmd
@@ -1,12 +1,12 @@
@echo off
-@if not "%OS%"=="Windows_NT" @(echo This script requires Windows NT 4.0 or later to run properly! & goto :EOF)
+@if not "%OS%"=="Windows_NT" (echo This script requires Windows NT 4.0 or later to run properly! & goto :EOF)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-::: 2009-2018, Oliver Schneider (assarbad.net) - PUBLIC DOMAIN/CC0
+::: 2009-2019, Oliver Schneider (assarbad.net) - PUBLIC DOMAIN/CC0
::: Available from: <https://bitbucket.org/assarbad/scripts/>
:::
::: 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 2017 or versions (or a single version) given on
+::: (2002) through 2019 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,11 +25,11 @@ 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=15.0 14.0 12.0 11.0 10.0 9.0 8.0 7.1 7.0
+set SUPPORTED_VC=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=2017 2015 2013 2012 2010 2008 2005 2003 2002
+set SUPPORTED_NICE=2019 2017 2015 2013 2012 2010 2008 2005 2003 2002
set DEFAULT_TSET=x86
-if not "%~1" == "" @(
+if not "%~1" == "" (
if "%~1" == "/?" goto :Help
if "%~1" == "-?" goto :Help
if "%~1" == "/h" goto :Help
@@ -39,13 +39,14 @@ if not "%~1" == "" @(
)
if defined VCVER_FRIENDLY echo This script expects a clean environment. Don't run it several times in the same instance of CMD! Or use setlocal and endlocal in your own script to limit the effect of this one.&popd&endlocal&goto :EOF
set MIN_VC=7.0
-set MAX_VC=15.0
+set MAX_VC=16.0
set MIN_NICE=2002
-reg /? > NUL 2>&1 || echo "REG.EXE is a prerequisite but wasn't found!" && goto :EOF
+reg /? > NUL 2>&1
+if not ERRORLEVEL 0 echo "REG.EXE is a prerequisite but wasn't found!" & goto :EOF
set SETVCV_ERROR=0
:: First parameter may point to a particular toolset ...
-if not "%~1" == "" @(
- for %%i in (%SUPPORTED_TSET%) do @(
+if not "%~1" == "" (
+ for %%i in (%SUPPORTED_TSET%) do (
if "%~1" == "%%i" shift & call :SetVar VCTGT_TOOLSET %%i
)
)
@@ -55,30 +56,45 @@ if not defined VCTGT_TOOLSET set VCTGT_TOOLSET=%DEFAULT_TSET%
set SUPPORTED_PP=%SUPPORTED_NICE: =, %
:: Allow the version to be overridden on the command line
:: ... else find the VC versions in the order given by SUPPORTED_VC
-if not "%~1" == "" @(
- for %%i in (%~1) do @(
+if not "%~1" == "" (
+ for %%i in (%~1) do (
call :FindVC "%%i"
)
-) else @(
+) else (
echo Trying to auto-detect supported MSVC version ^(%SUPPORTED_PP%^)
echo HINT: pass one ^(or several^) of %SUPPORTED_PP% on the command line.
echo alternatively one ^(or several^) of: %SUPPORTED_VC%
echo.
- for %%i in (%SUPPORTED_VC%) do @(
+ for %%i in (%SUPPORTED_VC%) do (
call :FindVC "%%i"
)
)
:: Check result and quit with error if necessary
-if not defined VCVARS_PATH @(
- if not "%~1" == "" @(
+if not defined VCVARS_PATH (
+ if not "%~1" == "" (
echo Requested version ^"%~1^" of Visual Studio not found.
- ) else @(
+ ) else (
echo Could not find any supported version ^(%SUPPORTED_PP%^) of Visual C++.
)
popd & endlocal & exit /b %SETVCV_ERROR%
)
-:: Return and make sure the outside world sees the results (i.e. leave the scope)
-popd & endlocal & if not "%VCVARS_PATH%" == "" @(call "%VCVARS_PATH%" %VCTGT_TOOLSET%) & if not "%VCVER_FRIENDLY%" == "" set VCVER_FRIENDLY=%VCVER_FRIENDLY%
+set ALLORNOT=%VCVARS_PATH:~-7,3%
+if "%ALLORNOT%" == "all" set VCTGT_TOOLSET_ARG=%VCTGT_TOOLSET%
+set WINSDK_TOOLSET=%VCTGT_TOOLSET:~0,5%
+if "%WINSDK_TOOLSET%" == "amd64" set WINSDK_TOOLSET=x64
+set WINSDK_TOOLSET=%WINSDK_TOOLSET:~0,3%
+:: ... make sure the outside world sees the results (i.e. leave the scope)
+popd & endlocal & if not "%VCVARS_PATH%" == "" @call "%VCVARS_PATH%" %VCTGT_TOOLSET_ARG% & if not "%VCVER_FRIENDLY%" == "" set VCVER_FRIENDLY=%VCVER_FRIENDLY%&set WINSDK_TOOLSET=%WINSDK_TOOLSET%
+:: ... and make sure the resource compiler (rc.exe) can be used (by default it can't on VS2015)
+rc.exe /? > NUL 2>&1
+:: Didn't fail, so nothing for us to fix
+if not ERRORLEVEL 1 goto :EOF
+:: We need those to locate rc.exe
+if not defined WindowsSdkDir goto :EOF
+if not defined WindowsSDKVersion goto :EOF
+"%WindowsSdkDir%\bin\%WindowsSDKVersion%%WINSDK_TOOLSET%\rc.exe" > NUL 2>&1
+if ERRORLEVEL 1 goto :EOF
+call :SetVar PATH "%PATH%;%WindowsSdkDir%\bin\%WindowsSDKVersion%%WINSDK_TOOLSET%"
goto :EOF
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@@ -90,19 +106,54 @@ goto :EOF
:FindVC
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, ... 2017) from the internal ones
+if defined VCVARS_PATH ( endlocal & goto :EOF )
+:: Now let's distinguish the "nice" version numbers (2002, ... 2019) from the internal ones
set VCVER=%VCVER:vs=%
-set NICEVER=%VCVER%
+:: Not a "real" version number, but the marketing one (2002, ... 2019)?
+if %VCVER% GEQ %MIN_NICE% call :NICE_%VCVER% > NUL 2>&1
set NUMVER=%VCVER:.0=%
-echo %NUMVER%
-:: Not a "real" version number, but the marketing one (2002, ... 2017)?
-if "%VCVER%" geq "%MIN_NICE%" call :NICE_%VCVER% > NUL 2>&1
+set NUMVER=%NUMVER:.1=%
:: Figure out the set of supported toolsets
set VCVERLBL=%VCVER:.=_%
+call :PRETTY_%VCVERLBL% > NUL 2>&1
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_16_0
+ set NICEVER=2019
+ goto :EOF
+:PRETTY_15_0
+ set NICEVER=2017
+ goto :EOF
+:PRETTY_14_0
+ set NICEVER=2015
+ goto :EOF
+:PRETTY_12_0
+ set NICEVER=2013
+ goto :EOF
+:PRETTY_11_0
+ set NICEVER=2012
+ goto :EOF
+:PRETTY_10_0
+ set NICEVER=2010
+ goto :EOF
+:PRETTY_9_0
+ set NICEVER=2008
+ goto :EOF
+:PRETTY_8_0
+ set NICEVER=2005
+ goto :EOF
+:PRETTY_7_1
+ set NICEVER=2003
+ goto :EOF
+:PRETTY_7_0
+ set NICEVER=2002
+ goto :EOF
+:NICE_2019
+ set VCVER=16.0
+ set NEWVS=1
+ goto :EOF
:NICE_2017
set VCVER=15.0
set NEWVS=1
@@ -131,6 +182,7 @@ goto :NICE_SET
:NICE_2002
set VCVER=7.0
goto :EOF
+:TSET_16_0
:TSET_15_0
:TSET_14_0
:TSET_12_0
@@ -145,97 +197,106 @@ goto :NICE_SET
set SUPPORTED_TSET=x86 ia64 amd64 x86_amd64 x86_ia64
goto :EOF
:NICE_SET
-echo Trying to locate Visual C++ %VCVER% ^(%VCTGT_TOOLSET%^)
+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
+if %NUMVER% LSS 15 goto :OLDVS
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
+"%_VSWHERE%" -? > NUL 2>&1 || set _VSWHERE=vswhere.exe
+"%_VSWHERE%" -? > NUL 2>&1 || goto :SKIPVSWHERE
+if not defined _VCINSTALLDIR (
+ for /f "usebackq tokens=*" %%i in (`"%_VSWHERE%" -products * -format value -property installationPath -version %NUMVER%`) do (
+ call :SetVar _VCINSTALLDIR "%%i\VC\"
+ )
+)
+if defined _VCINSTALLDIR goto :DETECTION_FINISHED
+:SKIPVSWHERE
+if not "%NICEVER%" == "2017" goto :DETECTION_FINISHED
set _VSINSTALLKEY=HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7
-if not defined _VCINSTALLDIR @(
- for /f "tokens=2*" %%i in ('reg query "%_VSINSTALLKEY%" /v %VCVER% 2^> NUL') do @(
+if not defined _VCINSTALLDIR (
+ for /f "tokens=2*" %%i in ('reg query "%_VSINSTALLKEY%" /v %VCVER% 2^> NUL') do (
call :SetVar _VCINSTALLDIR "%%j"
)
)
set _VSINSTALLKEY=HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7
:: If we haven't found it by now, try the WOW64 "Software" key
-if not defined _VCINSTALLDIR @(
- for /f "tokens=2*" %%i in ('reg query "%_VSINSTALLKEY%" /v %VCVER% 2^> NUL') do @(
+if not defined _VCINSTALLDIR (
+ for /f "tokens=2*" %%i in ('reg query "%_VSINSTALLKEY%" /v %VCVER% 2^> NUL') do (
call :SetVar _VCINSTALLDIR "%%j"
)
)
goto :DETECTION_FINISHED
:OLDVS
-echo Old (^<2017) Visual Studio
+:: echo Old (^<2017) Visual Studio
:: The versions of Visual Studio prior to 2017 were all using this key
set _VSINSTALLKEY=HKLM\SOFTWARE\Microsoft\VisualStudio\%VCVER%\Setup\VC
-if not defined _VCINSTALLDIR @(
- for /f "tokens=2*" %%i in ('reg query "%_VSINSTALLKEY%" /v ProductDir 2^> NUL') do @(
+if not defined _VCINSTALLDIR (
+ for /f "tokens=2*" %%i in ('reg query "%_VSINSTALLKEY%" /v ProductDir 2^> NUL') do (
call :SetVar _VCINSTALLDIR "%%j"
)
)
set _VSINSTALLKEY=HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%VCVER%\Setup\VC
:: If we haven't found it by now, try the WOW64 "Software" key
-if not defined _VCINSTALLDIR @(
- for /f "tokens=2*" %%i in ('reg query "%_VSINSTALLKEY%" /v ProductDir 2^> NUL') do @(
+if not defined _VCINSTALLDIR (
+ for /f "tokens=2*" %%i in ('reg query "%_VSINSTALLKEY%" /v ProductDir 2^> NUL') do (
call :SetVar _VCINSTALLDIR "%%j"
)
)
:DETECTION_FINISHED
-set TEMP_TOOLSET=%VCTGT_TOOLSET%
set TEMP_SUPPORTED=
-if defined _VCINSTALLDIR @(
- if EXIST "%_VCINSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" @(
- call :SetVar VCVARS_PATH "%_VCINSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat"
- )
- if EXIST "%_VCINSTALLDIR%\vcvarsall.bat" @(
- call :SetVar VCVARS_PATH "%_VCINSTALLDIR%\vcvarsall.bat"
- )
- if not defined VCVARS_PATH if EXIST "%_VCINSTALLDIR%\bin\vcvars32.bat" @(
- call :SetVar VCVARS_PATH "%_VCINSTALLDIR%\bin\vcvars32.bat"
- call :SetVar VCTGT_TOOLSET
- )
+echo _VCINSTALLDIR=%_VCINSTALLDIR%
+if not defined _VCINSTALLDIR goto :SKIP_VCVARS
+if "%VCTGT_TOOLSET%" == "x86" set BATCHNAME=vcvars32.bat
+if "%VCTGT_TOOLSET%" == "amd64" set BATCHNAME=vcvars64.bat
+if not defined BATCHNAME set BATCHNAME=vcvars%VCTGT_TOOLSET%.bat
+for %%i in (Auxiliary\Build\%BATCHNAME% bin\%VCTGT_TOOLSET%\%BATCHNAME% bin\%BATCHNAME% Auxiliary\Build\vcvarsall.bat vcvarsall.bat) do (
+ call :FindVCVarsScript "%_VCINSTALLDIR%" "%%i" "%VCTGT_TOOLSET%"
)
-if not "%VCTGT_TOOLSET%" == "" @(
- for %%i in (%SUPPORTED_TSET%) do @(
+:SKIP_VCVARS
+if not "%VCTGT_TOOLSET%" == "" (
+ for %%i in (%SUPPORTED_TSET%) do (
if "%VCTGT_TOOLSET%" == "%%i" call :SetVar TEMP_SUPPORTED yes
)
)
-if not "%TEMP_SUPPORTED%" == "yes" @( echo ERROR: Invalid toolset %TEMP_TOOLSET% for version %VCVER% of Visual C++&endlocal&set SETVCV_ERROR=1&goto :EOF )
-set VCTGT_TOOLSET=%TEMP_TOOLSET%
+if not "%TEMP_SUPPORTED%" == "yes" ( echo ERROR: Invalid toolset %TEMP_TOOLSET% for version %VCVER% of Visual C++&endlocal&set SETVCV_ERROR=2&goto :EOF )
:: Return, in case nothing was found
-if not defined VCVARS_PATH @( endlocal&set SETVCV_ERROR=1&goto :EOF )
+if not defined VCVARS_PATH ( endlocal&set SETVCV_ERROR=3&goto :EOF )
:: Replace the . in the version by an underscore
set VCVERLBL=%VCVER:.=_%
:: Try to set a friendlier name for the Visual Studio version
call :FRIENDLY_%VCVERLBL% > NUL 2>&1
:: Jump over those "subs"
goto :FRIENDLY_SET
+:FRIENDLY_16_0
+ set _VCVER=%NICEVER% ^[%TEMP_TOOLSET%^]
+ goto :EOF
:FRIENDLY_15_0
- set _VCVER=2017 ^[%TEMP_TOOLSET%^]
+ set _VCVER=%NICEVER% ^[%TEMP_TOOLSET%^]
goto :EOF
:FRIENDLY_14_0
- set _VCVER=2015 ^[%TEMP_TOOLSET%^]
+ set _VCVER=%NICEVER% ^[%TEMP_TOOLSET%^]
goto :EOF
:FRIENDLY_12_0
- set _VCVER=2013 ^[%TEMP_TOOLSET%^]
+ set _VCVER=%NICEVER% ^[%TEMP_TOOLSET%^]
goto :EOF
:FRIENDLY_11_0
- set _VCVER=2012 ^[%TEMP_TOOLSET%^]
+ set _VCVER=%NICEVER% ^[%TEMP_TOOLSET%^]
goto :EOF
:FRIENDLY_10_0
- set _VCVER=2010 ^[%TEMP_TOOLSET%^]
+ set _VCVER=%NICEVER% ^[%TEMP_TOOLSET%^]
goto :EOF
:FRIENDLY_9_0
- set _VCVER=2008 ^[%TEMP_TOOLSET%^]
+ set _VCVER=%NICEVER% ^[%TEMP_TOOLSET%^]
goto :EOF
:FRIENDLY_8_0
- set _VCVER=2005 ^[%TEMP_TOOLSET%^]
+ set _VCVER=%NICEVER% ^[%TEMP_TOOLSET%^]
goto :EOF
:FRIENDLY_7_1
- set _VCVER=.NET 2003 ^[%TEMP_TOOLSET%^]
+ set _VCVER=.NET %NICEVER% ^[%TEMP_TOOLSET%^]
goto :EOF
:FRIENDLY_7_0
- set _VCVER=.NET 2002 ^[%TEMP_TOOLSET%^]
+ set _VCVER=.NET %NICEVER% ^[%TEMP_TOOLSET%^]
goto :EOF
:FRIENDLY_SET
if not defined _VCVER call :SetVar _VCVER "%VCVER%"
@@ -282,3 +343,29 @@ goto :EOF
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::: \ SetVar subroutine
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+::: / FindVCVarsScript subroutine
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FindVCVarsScript
+setlocal ENABLEEXTENSIONS
+:: Do not overwrite any pre-existing path
+if defined VCVARS_PATH endlocal&goto :EOF
+set VCINSTALLDIR=%~1
+set VCVARSGUESS=%~2
+set VCTGT_TOOLSET=%~3
+set VCVARS_CURRENT_GUESS=%VCINSTALLDIR%%VCVARSGUESS%
+:: Use the guess passed as second argument, after building a path based on VCINSTALLDIR
+if EXIST "%VCVARS_CURRENT_GUESS%" set VCVARS_PATH=%VCVARS_CURRENT_GUESS%
+if defined VCVARS_PATH goto :VCVarsFound
+:: Just in case the install directory path contains no trailing backslash
+set VCVARS_CURRENT_GUESS=%VCINSTALLDIR%\%VCVARSGUESS%
+if EXIST "%VCVARS_CURRENT_GUESS%" set VCVARS_PATH=%VCVARS_CURRENT_GUESS%
+if defined VCVARS_PATH goto :VCVarsFound
+endlocal & goto :EOF
+:VCVarsFound
+endlocal & set VCVARS_PATH=%VCVARS_PATH%
+goto :EOF
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+::: \ FindVCVarsScript subroutine
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
diff --git a/src/_manifest.lua b/src/_manifest.lua
index e8a6619..96225d1 100644
--- a/src/_manifest.lua
+++ b/src/_manifest.lua
@@ -67,6 +67,7 @@
"actions/vstudio/vs2013.lua",
"actions/vstudio/vs2015.lua",
"actions/vstudio/vs2017.lua",
+ "actions/vstudio/vs2019.lua",
-- Xcode action
"actions/xcode/_xcode.lua",
diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua
index b4961c8..d888504 100644
--- a/src/actions/vstudio/vs2010_vcxproj.lua
+++ b/src/actions/vstudio/vs2010_vcxproj.lua
@@ -79,7 +79,7 @@
_p(2,'<UseDebugLibraries>%s</UseDebugLibraries>', iif(optimisation(cfg) == "Disabled","true","false"))
_p(2,'<CharacterSet>%s</CharacterSet>',iif(cfg.flags.Unicode,"Unicode","MultiByte"))
- local toolsets = { vs2012 = "v110", vs2013 = "v120", vs2015 = "v140", vs2017 = "v141" }
+ local toolsets = { vs2012 = "v110", vs2013 = "v120", vs2015 = "v140", vs2017 = "v141", vs2019 = "v142" }
local toolset = toolsets[_ACTION]
if toolset then
_p(2,'<PlatformToolset>%s</PlatformToolset>', toolset)
diff --git a/src/actions/vstudio/vs2019.lua b/src/actions/vstudio/vs2019.lua
new file mode 100644
index 0000000..acfb924
--- /dev/null
+++ b/src/actions/vstudio/vs2019.lua
@@ -0,0 +1,58 @@
+--
+-- vs2019.lua
+-- Baseline support for Visual Studio 2019.
+-- Copyright (c) 2013 Jason Perkins and the Premake project
+--
+
+ premake.vstudio.vc2019 = {}
+ local vc2019 = premake.vstudio.vc2019
+ local vstudio = premake.vstudio
+
+
+---
+-- Register a command-line action for Visual Studio 2019.
+---
+
+ newaction
+ {
+ 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(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 = "16.0",
+ shortSlnVersion = "16",
+ }
+ }
diff --git a/src/host/keccak.c b/src/host/keccak.c
index d4a3d70..6c97cf4 100644
--- a/src/host/keccak.c
+++ b/src/host/keccak.c
@@ -155,7 +155,7 @@ static void store64(UINT8 *x, UINT64 u)
unsigned int i;
for(i=0; i<8; ++i) {
- x[i] = u;
+ x[i] = u & 0xFF;
u >>= 8;
}
}
@@ -285,8 +285,8 @@ that use the Keccak-f[1600] permutation.
void Keccak(unsigned int rate, unsigned int capacity, const unsigned char *input, unsigned long long int inputByteLen, unsigned char delimitedSuffix, unsigned char *output, unsigned long long int outputByteLen)
{
UINT8 state[200];
- unsigned int rateInBytes = rate/8;
- unsigned int blockSize = 0;
+ unsigned long long int rateInBytes = rate/8;
+ unsigned long long int blockSize = 0;
unsigned int i;
if (((rate + capacity) != 1600) || ((rate % 8) != 0))
@@ -323,7 +323,7 @@ void Keccak(unsigned int rate, unsigned int capacity, const unsigned char *input
/* === Squeeze out all the output blocks === */
while(outputByteLen > 0) {
blockSize = MIN(outputByteLen, rateInBytes);
- memcpy(output, state, blockSize);
+ memcpy(output, state, (size_t)blockSize);
output += blockSize;
outputByteLen -= blockSize;
diff --git a/src/host/os_getversion.c b/src/host/os_getversion.c
index 446848f..609ca04 100755
--- a/src/host/os_getversion.c
+++ b/src/host/os_getversion.c
@@ -63,82 +63,148 @@ int os_getversion(lua_State* L)
SYSTEM_INFO getsysteminfo()
{
- typedef void (WINAPI *GetNativeSystemInfoSig)(LPSYSTEM_INFO);
- GetNativeSystemInfoSig nativeSystemInfo = (GetNativeSystemInfoSig)
- GetProcAddress(GetModuleHandle(TEXT("kernel32")), "GetNativeSystemInfo");
+ static SYSTEM_INFO systemInfo;
+ HMODULE hKrnl32 = GetModuleHandle(TEXT("kernel32"));
+ memset(&systemInfo, 0, sizeof(systemInfo));
+ if (hKrnl32)
+ {
+ typedef void (WINAPI* GetNativeSystemInfoSig)(LPSYSTEM_INFO);
+ GetNativeSystemInfoSig nativeSystemInfo = (GetNativeSystemInfoSig)GetProcAddress(hKrnl32, "GetNativeSystemInfo");
- SYSTEM_INFO systemInfo = {{0}};
- if ( nativeSystemInfo ) nativeSystemInfo(&systemInfo);
- else GetSystemInfo(&systemInfo);
+ if (nativeSystemInfo)
+ nativeSystemInfo(&systemInfo);
+ else
+ GetSystemInfo(&systemInfo);
+ }
return systemInfo;
}
-void getversion(struct OsVersionInfo* info)
-{
- OSVERSIONINFOEX versionInfo = {0};
-
- versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- GetVersionEx((OSVERSIONINFO*)&versionInfo);
-
- info->majorversion = versionInfo.dwMajorVersion;
- info->minorversion = versionInfo.dwMinorVersion;
- info->revision = versionInfo.wServicePackMajor;
+#ifndef NT_SUCCESS
+# define NT_SUCCESS(x) ((x) >= 0)
+#endif
- if (versionInfo.dwMajorVersion == 5 && versionInfo.dwMinorVersion == 0)
- {
- info->description = "Windows 2000";
- }
- else if (versionInfo.dwMajorVersion == 5 && versionInfo.dwMinorVersion == 1)
- {
- info->description = "Windows XP";
- }
- else if (versionInfo.dwMajorVersion == 5 && versionInfo.dwMinorVersion == 2)
- {
- SYSTEM_INFO systemInfo = getsysteminfo();
- if (versionInfo.wProductType == VER_NT_WORKSTATION &&
- systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
- {
- info->description = "Windows XP Professional x64";
- }
- else if (versionInfo.wSuiteMask & VER_SUITE_WH_SERVER)
- {
- info->description = "Windows Home Server";
- }
- else if (GetSystemMetrics(SM_SERVERR2) == 0)
- {
- info->description = "Windows Server 2003";
- }
- else
- {
- info->description = "Windows Server 2003 R2";
- }
- }
- else if (versionInfo.dwMajorVersion == 6 && versionInfo.dwMinorVersion == 0)
+OSVERSIONINFOEXW const * GetOSVersionInfo()
+{
+ static OSVERSIONINFOEXW* posvix = NULL;
+ if (!posvix)
{
- if (versionInfo.wProductType == VER_NT_WORKSTATION)
+ static OSVERSIONINFOEXW osvix = { sizeof(OSVERSIONINFOEXW), 0, 0, 0, 0,{ 0 } }; // not an error, this has to be the W variety!
+ static LONG(WINAPI * RtlGetVersion)(OSVERSIONINFOEXW*) = NULL;
+ static HMODULE hNtDll = NULL;
+ hNtDll = GetModuleHandle(TEXT("ntdll.dll"));
+ if (hNtDll)
{
- info->description = "Windows Vista";
- }
- else
- {
- info->description = "Windows Server 2008";
+ *(FARPROC*)&RtlGetVersion = GetProcAddress(hNtDll, "RtlGetVersion");
+ if (NULL != RtlGetVersion)
+ {
+ if (NT_SUCCESS(RtlGetVersion(&osvix)))
+ {
+ posvix = &osvix;
+ }
+ }
}
}
- else if (versionInfo.dwMajorVersion == 6 && versionInfo.dwMinorVersion == 1 )
+ return posvix;
+}
+
+void getversion(struct OsVersionInfo* info)
+{
+ static OSVERSIONINFOEXW const* posvix = NULL;
+ static struct OsVersionInfo s_info;
+ s_info.majorversion = 0;
+ s_info.minorversion = 0;
+ s_info.revision = 0;
+ s_info.description = "Windows";
+
+ if (!posvix)
{
- if (versionInfo.wProductType != VER_NT_WORKSTATION)
+ posvix = GetOSVersionInfo();
+ if (posvix)
{
- info->description = "Windows Server 2008 R2";
+ s_info.majorversion = posvix->dwMajorVersion;
+ s_info.minorversion = posvix->dwMinorVersion;
+ s_info.revision = posvix->wServicePackMajor;
+ switch (posvix->dwMajorVersion)
+ {
+ case 5:
+ switch (posvix->dwMinorVersion)
+ {
+ case 0:
+ s_info.description = "Windows 2000";
+ break;
+ case 1:
+ s_info.description = "Windows XP";
+ break;
+ case 2:
+ if (posvix->wProductType == VER_NT_WORKSTATION)
+ s_info.description = "Windows XP x64";
+ else
+ if (posvix->wSuiteMask == VER_SUITE_WH_SERVER)
+ s_info.description = "Windows Home Server";
+ else
+ {
+ if (GetSystemMetrics(SM_SERVERR2) == 0)
+ s_info.description = "Windows Server 2003";
+ else
+ s_info.description = "Windows Server 2003 R2";
+ }
+ break;
+ default:
+ s_info.description = "Windows [5.x]";
+ break;
+ }
+ break;
+ case 6:
+ switch (posvix->dwMinorVersion)
+ {
+ case 0:
+ if (posvix->wProductType == VER_NT_WORKSTATION)
+ s_info.description = "Windows Vista";
+ else
+ s_info.description = "Windows Server 2008";
+ break;
+ case 1:
+ if (posvix->wProductType == VER_NT_WORKSTATION)
+ s_info.description = "Windows 7";
+ else
+ s_info.description = "Windows Server 2008 R2";
+ break;
+ case 2:
+ if (posvix->wProductType == VER_NT_WORKSTATION)
+ s_info.description = "Windows 8";
+ else
+ s_info.description = "Windows Server 2012";
+ break;
+ case 3:
+ if (posvix->wProductType == VER_NT_WORKSTATION)
+ s_info.description = "Windows 8.1";
+ else
+ s_info.description = "Windows Server 2012 R2";
+ break;
+ default:
+ s_info.description = "Windows [6.x]";
+ break;
+ }
+ break;
+ case 10:
+ switch (posvix->dwMinorVersion)
+ {
+ case 0:
+ if (posvix->wProductType == VER_NT_WORKSTATION)
+ s_info.description = "Windows 10";
+ else
+ s_info.description = "Windows Server 2016/2019";
+ break;
+ default:
+ s_info.description = "Windows [10.x]";
+ break;
+ }
+ break;
+ }
}
- else
- {
- info->description = "Windows 7";
- }
- }
- else
- {
- info->description = "Windows";
}
+
+ memmove(info, &s_info, sizeof(struct OsVersionInfo));
}
/*************************************************************/
diff --git a/src/host/os_is64bit.c b/src/host/os_is64bit.c
index 3134751..a296981 100755
--- a/src/host/os_is64bit.c
+++ b/src/host/os_is64bit.c
@@ -6,21 +6,35 @@
#include "premake.h"
+#if PLATFORM_WINDOWS
+typedef BOOL(WINAPI* WowFuncSig)(HANDLE, PBOOL);
+#endif
+
int os_is64bit(lua_State* L)
{
+#if PLATFORM_WINDOWS
+ HMODULE hKrnl32 = GetModuleHandle(TEXT("kernel32"));
+#endif
+ if (sizeof(void*) == 8) // our premake build is 64-bit, so the runtime environment must be also (at least) 64-bit ...
+ {
+ lua_pushboolean(L, 1);
+ return 1;
+ }
// If this code returns true, then the platform is 64-bit. If it
// returns false, the platform might still be 64-bit, but more
// checking will need to be done on the Lua side of things.
#if PLATFORM_WINDOWS
- typedef BOOL (WINAPI* WowFuncSig)(HANDLE, PBOOL);
- WowFuncSig func = (WowFuncSig)GetProcAddress(GetModuleHandle(TEXT("kernel32")), "IsWow64Process");
- if (func)
+ if (hKrnl32)
{
- BOOL isWow = FALSE;
- if (func(GetCurrentProcess(), &isWow))
+ WowFuncSig func = (WowFuncSig)GetProcAddress(hKrnl32, "IsWow64Process");
+ if (func)
{
- lua_pushboolean(L, isWow);
- return 1;
+ BOOL isWow = FALSE;
+ if (func(GetCurrentProcess(), &isWow))
+ {
+ lua_pushboolean(L, isWow);
+ return 1;
+ }
}
}
#endif
diff --git a/src/host/premake4.rc b/src/host/premake4.rc
index deb8a51..aac4c27 100644
--- a/src/host/premake4.rc
+++ b/src/host/premake4.rc
@@ -3,7 +3,7 @@
#endif //APSTUDIO_INVOKED
#include <winnt.rh>
-#include <verrsrc.h>
+#include <verrsrc.h> /* if this header is missing you should integrate the Windows 7 SP1 SDK in VS2005, later toolchains should have this file anyway */
#ifdef HAVE_HGTIP
# include "hgtip.h"
#endif
diff --git a/src/host/scripts.c b/src/host/scripts.c
index 9d483e2..2601b26 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,'<ItemGroup Label=\"ProjectConfigurations\">')for n,e in ipairs(e.solution.vstudio_configs)do\n_p(2,'<ProjectConfiguration Include=\"%s\">',premake.esc(e.name))_p(3,'<Configuration>%s</Configuration>',e.buildcfg)_p(3,'<Platform>%s</Platform>',e.platform)_p(2,'</ProjectConfiguration>')end\n_p(1,'</ItemGroup>')end\nlocal function s(e)_p(1,'<PropertyGroup Label=\"Globals\">')_p(2,'<ProjectGuid>{%s}</ProjectGuid>',e.uuid)_p(2,'<RootNamespace>%s</RootNamespace>',e.name)if e.flags and e.flags.Managed then\n_p(2,'<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>')_p(2,'<Keyword>ManagedCProj</Keyword>')else\n_p(2,'<Keyword>Win32Proj</Keyword>')end\n_p(1,'</PropertyGroup>')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,'<PropertyGroup '..i()..' Label=\"Configuration\">',premake.esc(t.name))_p(2,'<ConfigurationType>%s</ConfigurationType>',e.config_type(n))_p(2,'<UseDebugLibraries>%s</UseDebugLibraries>',iif(o(n)==\"Disabled\",\"true\",\"false\"))_p(2,'<CharacterSet>%s</CharacterSet>',iif(n.flags.Unicode,\"Unicode\",\"MultiByte\"))local e={vs2012=\"v110\",vs2013=\"v120\",vs2015=\"v140\",vs2017=\"v141\"}local e=e[_ACTION]if e then\n_p(2,'<PlatformToolset>%s</PlatformToolset>',e)end\nif n.flags.MFC then\n_p(2,'<UseOfMfc>%s</UseOfMfc>',iif(n.flags.StaticRuntime,\"Static\",\"Dynamic\"))end\nif n.flags.ATL or n.flags.StaticATL then\n_p(2,'<UseOfAtl>%s</UseOfAtl>',iif(n.flags.StaticATL,\"Static\",\"Dynamic\"))end\nif n.flags.Managed then\n_p(2,'<CLRS"
- "upport>true</CLRSupport>')end\n_p(1,'</PropertyGroup>')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,'<ImportGroup '..i()..' Label=\"PropertySheets\">',premake.esc(e.name))_p(2,'<Import Project=\"$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists(\\'$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\\')\" Label=\"LocalAppDataPlatform\" />')_p(1,'</ImportGroup>')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,'<PropertyGroup '..i()..'>',premake.esc(t.name))_p(2,'<OutDir>%s\\\\</OutDir>',premake.esc(n.directory))if e.platform==\"Xbox360\"then\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',premake.esc(n.name))end\n_p(2,'<IntDir>%s\\\\</IntDir>',premake.esc(e.objectsdir))_p(2,'<TargetName>%s</TargetName>',premake.esc(path.getbasename(n.name)))_p(2,'<TargetExt>%s</TargetExt>'"
- ",premake.esc(path.getextension(n.name)))if e.kind==\"SharedLib\"then\nlocal e=(e.flags.NoImportLib~=nil)_p(2,'<IgnoreImportLibrary>%s</IgnoreImportLibrary>',tostring(e))end\nif e.kind~=\"StaticLib\"then\n_p(2,'<LinkIncremental>%s</LinkIncremental>',tostring(premake.config.isincrementallink(e)))end\nif e.flags.NoManifest then\n_p(2,'<GenerateManifest>false</GenerateManifest>')end\n_p(1,'</PropertyGroup>')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,'<PrecompiledHeader>Use</PrecompiledHeader>')_p(3,'<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>',e.pchheader)else\n_p(3,'<PrecompiledHeader></PrecompiledHeader>')end\nend\nlocal function t(n,e)if#e.defines>0 then\n_p(n,'<PreprocessorDefinitions>%s;%%(Preproc"
- "essorDefinitions)</PreprocessorDefinitions>',premake.esc(table.concat(e.defines,\";\")))else\n_p(n,'<PreprocessorDefinitions></PreprocessorDefinitions>')end\nend\nlocal function P(n,e)if#e.includedirs>0 then\n_p(n,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</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,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>',premake.esc(path.translate(table.concat(e,\";\"),'\\\\')))end\nend\nlocal function h(e)_p(2,'<ResourceCompile>')t(3,e)n(3,e)_p(2,'</ResourceCompile>')end\nlocal function u(e)if e.flags.NoExceptions then\n_p(2,'<ExceptionHandling>false</ExceptionHandling>')elseif e.flags.SEH then\n_p(2,'<ExceptionHandling>Async</ExceptionHandling>')end\nend\nlocal function c(e)if e.flags.NoRTTI and not e.flags.Managed then\n"
- "_p(3,'<RuntimeTypeInfo>false</RuntimeTypeInfo>')end\nend\nlocal function m(e)if e.flags.NativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>')elseif e.flags.NoNativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>')end\nend\nlocal function g(e)if e.flags.EnableSSE then\n_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>')elseif e.flags.EnableSSE2 then\n_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>')end\nend\nlocal function b(e)if e.flags.FloatFast then\n_p(3,'<FloatingPointModel>Fast</FloatingPointModel>')elseif e.flags.FloatStrict and not e.flags.Managed then\n_p(3,'<FloatingPointModel>Strict</FloatingPointModel>')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\nend\n_p(3,'<Debug"
- "InformationFormat>%s</DebugInformationFormat>',n)end\nlocal function n(e)if premake.config.isdebugbuild(e)and not e.flags.NoMinimalRebuild then\n_p(3,'<MinimalRebuild>true</MinimalRebuild>')else\n_p(3,'<MinimalRebuild>false</MinimalRebuild>')end\nend\nlocal function _(e)if e.language==\"C\"then\n_p(3,'<CompileAs>CompileAsC</CompileAs>')end\nend\nlocal function C(e)_p(2,'<ClCompile>')if#e.buildoptions>0 then\n_p(3,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',table.concat(premake.esc(e.buildoptions),\" \"))end\n_p(3,'<Optimization>%s</Optimization>',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,'<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>')end\nif e.flags.ExtraWarnings then\n_p(3,'<SmallerTypeCheck>true</SmallerTypeCheck>')end\nelse\n_p(3,'<StringPooling>true</StringPooling>')end\n_p(3,'<RuntimeLibrary>%s</RuntimeLibrary>',d(e))_p(3,'<FunctionLevelLinking>true</FunctionLevelLinking>')f(e)if e.flags.ExtraWarnings then"
- "\n_p(3,'<WarningLevel>Level4</WarningLevel>')else\n_p(3,'<WarningLevel>Level3</WarningLevel>')end\nif e.flags.FatalWarnings then\n_p(3,'<TreatWarningAsError>true</TreatWarningAsError>')end\nu(e)c(e)m(e)g(e)b(e)a(e)if e.flags.Symbols then\n_p(3,'<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>',path.getbasename(e.buildtarget.name))end\nif e.flags.NoFramePointer then\n_p(3,'<OmitFramePointers>true</OmitFramePointers>')end\n_(e)_p(2,'</ClCompile>')end\nlocal function c(e)if#e.postbuildcommands>0 then\n_p(2,'<PostBuildEvent>')_p(3,'<Command>%s</Command>',premake.esc(table.implode(e.postbuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'</PostBuildEvent>')end\nif#e.prebuildcommands>0 then\n_p(2,'<PreBuildEvent>')_p(3,'<Command>%s</Command>',premake.esc(table.implode(e.prebuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'</PreBuildEvent>')end\nif#e.prelinkcommands>0 then\n_p(2,'<PreLinkEvent>')_p(3,'<Command>%s</Command>',premake.esc(table.implode(e.prelinkcommands,\"\",\"\",\"\\r\\n\")))_p(2,'</PreLinkEvent>')en"
- "d\nend\nlocal function o(n,e)if#e.linkoptions>0 then\n_p(n,'<AdditionalOptions>%s %%(AdditionalOptions)</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,'<TargetMachine>%s</TargetMachine>',n[e.platform])end\nend\nlocal function a(e)if e.kind=='StaticLib'and e.platform~=\"Xbox360\"then\n_p(1,'<Lib>')_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',e.buildtarget.name)o(2,e)t(2,e)_p(1,'</Lib>')end\nend\nlocal function d(e)if e.kind==\"SharedLib\"then\nlocal n=e.linktarget.fullpath\n_p(3,'<ImportLibrary>%s</ImportLibrary>',iif(e.flags.NoImportLib,e.objectsdir..\"\\\\\"..path.getname(n),n))end\nend\nfunction e.link(n)_p(2,'<Link>')_p(3,'<SubSystem>%s</SubSystem>',iif(n.kind==\"ConsoleApp\",\"Console\",\"Windows\"))_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>',tostring(n.flags.Symbols~=nil))if premake.config.isoptimizedbuild(n.flags)then\n_p(3,'<EnableCOMDATFolding>true</EnableCOMDATFol"
- "ding>')_p(3,'<OptimizeReferences>true</OptimizeReferences>')end\nif n.kind~='StaticLib'then\ne.additionalDependencies(n)_p(3,'<OutputFile>$(OutDir)%s</OutputFile>',n.buildtarget.name)if#n.libdirs>0 then\n_p(3,'<AdditionalLibraryDirectories>%s;%%(AdditionalLibraryDirectories)</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,'<EntryPointSymbol>%s</EntryPointSymbol>',iif(n.flags.Unicode,\"wmainCRTStartup\",\"mainCRTStartup\"))end\nd(n)local e=premake.findfile(n,\".def\")if e then\n_p(3,'<ModuleDefinitionFile>%s</ModuleDefinitionFile>',e)end\nt(3,n)o(3,n)end\n_p(2,'</Link>')end\nfunction e.additionalDependencies(e)local e=premake.getlinks(e,\"system\",\"fullpath\")if#e>0 then\n_p(3,'<AdditionalDependencies>%s;%%(AdditionalDependencies)</AdditionalDependencies>',table.concat(e,\";\"))end\nend\nlocal function d(n)for o,t in ipairs(n.solution.vstudio_configs)do\nlocal n=prem"
- "ake.getconfig(n,t.src_buildcfg,t.src_platform)_p(1,'<ItemDefinitionGroup '..i()..'>',premake.esc(t.name))C(n)h(n)a(n)e.link(n)c(n)_p(1,'</ItemDefinitionGroup>')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,'<ItemGroup>')for i,e in ipairs(e)do\n_p(2,'<%s Include=\"%s\" />',n,path.translate(e.name,\"\\\\\"))end\n_p(1,'</ItemGroup>')end\nend\nfunction e.individualSourceFile(a,t,n)local"
- " e=a.solution.vstudio_configs\nlocal o=path.translate(n.name,\"\\\\\")_p(2,'<ClCompile Include=\"%s\">',o)for n,e in ipairs(e)do\nif t[e]and o==t[e]then\n_p(3,'<PrecompiledHeader '..i()..'>Create</PrecompiledHeader>',premake.esc(e.name))t[e]=nil\nend\nend\nif path.iscfile(n.name)~=premake.project.iscproject(a)then\n_p(3,'<CompileAs>%s</CompileAs>',iif(path.iscfile(n.name),'CompileAsC','CompileAsCpp'))end\n_p(2,'</ClCompile>')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,'<ItemGroup>')for o,i in ipairs(o)do\ne.individualSourceFile(n,t,i)end\n_p(1,'</ItemGroup>')end\nend\nfunction e.header(n)io.eol=\"\\r\\n\"_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')local e=\"\"if n then\ne=' DefaultTargets=\"'..n..'\"'end\n_p('<Project%s Too"
- "lsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">',e)end\nfunction premake.vs2010_vcxproj(n)io.indent=\" \"e.header(\"Build\")l(n)s(n)_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />')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,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />')_p(1,'<ImportGroup Label=\"ExtensionSettings\">')_p(1,'</ImportGroup>')r(n)_p(1,'<PropertyGroup Label=\"UserMacros\" />')e.outputProperties(n)d(n)e.files(n)e.projectReferences(n)_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />')_p(1,'<ImportGroup Label=\"ExtensionTargets\">')_p(1,'</ImportGroup>')_p('</Project>')end\nfunction e.projectReferences(n)local e=premake.getdependencies(n)if#e>0 then\n_p(1,'<ItemGroup>')for i,e in ipairs(e)do\nlocal n=path.getrelative(n.location,p.projectfile(e))_p(2,'<ProjectReference Include=\"%s\">',path.trans"
- "late(n,\"\\\\\"))_p(3,'<Project>{%s}</Project>',e.uuid)_p(2,'</ProjectReference>')end\n_p(1,'</ItemGroup>')end\nend\nfunction e.debugdir(e)if e.debugdir then\n_p(' <LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDirectory>',path.translate(e.debugdir,'\\\\'))_p(' <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>')end\nif e.debugargs then\n_p(' <LocalDebuggerCommandArguments>%s</LocalDebuggerCommandArguments>',table.concat(e.debugargs,\" \"))end\nend\nfunction e.debugenvs(e)if e.debugenvs and#e.debugenvs>0 then\n_p(2,'<LocalDebuggerEnvironment>%s%s</LocalDebuggerEnvironment>',table.concat(e.debugenvs,\"\\n\"),iif(e.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)',''))if e.flags.DebugEnvsDontMerge then\n_p(2,'<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>')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(' <PropertyGroup '..i"
- "()..'>',premake.esc(n.name))e.debugdir(t)e.debugenvs(t)_p(' </PropertyGroup>')end\n_p('</Project>')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,'<PropertyGroup '..i()..' Label=\"Configuration\">',premake.esc(t.name))_p(2,'<ConfigurationType>%s</ConfigurationType>',e.config_type(n))_p(2,'<UseDebugLibraries>%s</UseDebugLibraries>',iif(o(n)==\"Disabled\",\"true\",\"false\"))_p(2,'<CharacterSet>%s</CharacterSet>',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,'<PlatformToolset>%s</PlatformToolset>',e)end\nif n.flags.MFC then\n_p(2,'<UseOfMfc>%s</UseOfMfc>',iif(n.flags.StaticRuntime,\"Static\",\"Dynamic\"))end\nif n.flags.ATL or n.flags.StaticATL then\n_p(2,'<UseOfAtl>%s</UseOfAtl>',iif(n.flags.StaticATL,\"Static\",\"Dynamic\"))end\nif n.flags.Managed t"
+ "hen\n_p(2,'<CLRSupport>true</CLRSupport>')end\n_p(1,'</PropertyGroup>')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,'<ImportGroup '..i()..' Label=\"PropertySheets\">',premake.esc(e.name))_p(2,'<Import Project=\"$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists(\\'$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\\')\" Label=\"LocalAppDataPlatform\" />')_p(1,'</ImportGroup>')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,'<PropertyGroup '..i()..'>',premake.esc(t.name))_p(2,'<OutDir>%s\\\\</OutDir>',premake.esc(n.directory))if e.platform==\"Xbox360\"then\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',premake.esc(n.name))end\n_p(2,'<IntDir>%s\\\\</IntDir>',premake.esc(e.objectsdir))_p(2,'<TargetName>%s</TargetName>',premake.esc(path.getbasename(n.name)))_p(2,'<TargetExt"
+ ">%s</TargetExt>',premake.esc(path.getextension(n.name)))if e.kind==\"SharedLib\"then\nlocal e=(e.flags.NoImportLib~=nil)_p(2,'<IgnoreImportLibrary>%s</IgnoreImportLibrary>',tostring(e))end\nif e.kind~=\"StaticLib\"then\n_p(2,'<LinkIncremental>%s</LinkIncremental>',tostring(premake.config.isincrementallink(e)))end\nif e.flags.NoManifest then\n_p(2,'<GenerateManifest>false</GenerateManifest>')end\n_p(1,'</PropertyGroup>')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,'<PrecompiledHeader>Use</PrecompiledHeader>')_p(3,'<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>',e.pchheader)else\n_p(3,'<PrecompiledHeader></PrecompiledHeader>')end\nend\nlocal function t(n,e)if#e.defines>0 then\n_p(n,'<PreprocessorDefinitio"
+ "ns>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>',premake.esc(table.concat(e.defines,\";\")))else\n_p(n,'<PreprocessorDefinitions></PreprocessorDefinitions>')end\nend\nlocal function P(n,e)if#e.includedirs>0 then\n_p(n,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</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,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>',premake.esc(path.translate(table.concat(e,\";\"),'\\\\')))end\nend\nlocal function h(e)_p(2,'<ResourceCompile>')t(3,e)n(3,e)_p(2,'</ResourceCompile>')end\nlocal function u(e)if e.flags.NoExceptions then\n_p(2,'<ExceptionHandling>false</ExceptionHandling>')elseif e.flags.SEH then\n_p(2,'<ExceptionHandling>Async</ExceptionHandling>')end\nend\nlocal function c(e)if e.flags.NoRTTI and not e.flag"
+ "s.Managed then\n_p(3,'<RuntimeTypeInfo>false</RuntimeTypeInfo>')end\nend\nlocal function m(e)if e.flags.NativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>')elseif e.flags.NoNativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>')end\nend\nlocal function g(e)if e.flags.EnableSSE then\n_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>')elseif e.flags.EnableSSE2 then\n_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>')end\nend\nlocal function b(e)if e.flags.FloatFast then\n_p(3,'<FloatingPointModel>Fast</FloatingPointModel>')elseif e.flags.FloatStrict and not e.flags.Managed then\n_p(3,'<FloatingPointModel>Strict</FloatingPointModel>')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,'<DebugInformationFormat>%s</DebugInformationFormat>',n)end\nlocal function n(e)if premake.config.isdebugbuild(e)and not e.flags.NoMinimalRebuild then\n_p(3,'<MinimalRebuild>true</MinimalRebuild>')else\n_p(3,'<MinimalRebuild>false</MinimalRebuild>')end\nend\nlocal function _(e)if e.language==\"C\"then\n_p(3,'<CompileAs>CompileAsC</CompileAs>')end\nend\nlocal function C(e)_p(2,'<ClCompile>')if#e.buildoptions>0 then\n_p(3,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',table.concat(premake.esc(e.buildoptions),\" \"))end\n_p(3,'<Optimization>%s</Optimization>',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,'<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>')end\nif e.flags.ExtraWarnings then\n_p(3,'<SmallerTypeCheck>true</SmallerTypeCheck>')end\nelse\n_p(3,'<StringPooling>true</StringPooling>')end\n_p(3,'<RuntimeLibrary>%s</RuntimeLibrary>',d(e))_p(3,'<FunctionLevelLinking>true</FunctionLevelLinking>')f(e)if e.flags.Ex"
+ "traWarnings then\n_p(3,'<WarningLevel>Level4</WarningLevel>')else\n_p(3,'<WarningLevel>Level3</WarningLevel>')end\nif e.flags.FatalWarnings then\n_p(3,'<TreatWarningAsError>true</TreatWarningAsError>')end\nu(e)c(e)m(e)g(e)b(e)a(e)if e.flags.Symbols then\n_p(3,'<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>',path.getbasename(e.buildtarget.name))end\nif e.flags.NoFramePointer then\n_p(3,'<OmitFramePointers>true</OmitFramePointers>')end\n_(e)_p(2,'</ClCompile>')end\nlocal function c(e)if#e.postbuildcommands>0 then\n_p(2,'<PostBuildEvent>')_p(3,'<Command>%s</Command>',premake.esc(table.implode(e.postbuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'</PostBuildEvent>')end\nif#e.prebuildcommands>0 then\n_p(2,'<PreBuildEvent>')_p(3,'<Command>%s</Command>',premake.esc(table.implode(e.prebuildcommands,\"\",\"\",\"\\r\\n\")))_p(2,'</PreBuildEvent>')end\nif#e.prelinkcommands>0 then\n_p(2,'<PreLinkEvent>')_p(3,'<Command>%s</Command>',premake.esc(table.implode(e.prelinkcommands,\"\",\"\",\"\\r\\n\")))_p(2,'</P"
+ "reLinkEvent>')end\nend\nlocal function o(n,e)if#e.linkoptions>0 then\n_p(n,'<AdditionalOptions>%s %%(AdditionalOptions)</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,'<TargetMachine>%s</TargetMachine>',n[e.platform])end\nend\nlocal function a(e)if e.kind=='StaticLib'and e.platform~=\"Xbox360\"then\n_p(1,'<Lib>')_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',e.buildtarget.name)o(2,e)t(2,e)_p(1,'</Lib>')end\nend\nlocal function d(e)if e.kind==\"SharedLib\"then\nlocal n=e.linktarget.fullpath\n_p(3,'<ImportLibrary>%s</ImportLibrary>',iif(e.flags.NoImportLib,e.objectsdir..\"\\\\\"..path.getname(n),n))end\nend\nfunction e.link(n)_p(2,'<Link>')_p(3,'<SubSystem>%s</SubSystem>',iif(n.kind==\"ConsoleApp\",\"Console\",\"Windows\"))_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>',tostring(n.flags.Symbols~=nil))if premake.config.isoptimizedbuild(n.flags)then\n_p(3,'<EnableCOMDATFolding>true<"
+ "/EnableCOMDATFolding>')_p(3,'<OptimizeReferences>true</OptimizeReferences>')end\nif n.kind~='StaticLib'then\ne.additionalDependencies(n)_p(3,'<OutputFile>$(OutDir)%s</OutputFile>',n.buildtarget.name)if#n.libdirs>0 then\n_p(3,'<AdditionalLibraryDirectories>%s;%%(AdditionalLibraryDirectories)</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,'<EntryPointSymbol>%s</EntryPointSymbol>',iif(n.flags.Unicode,\"wmainCRTStartup\",\"mainCRTStartup\"))end\nd(n)local e=premake.findfile(n,\".def\")if e then\n_p(3,'<ModuleDefinitionFile>%s</ModuleDefinitionFile>',e)end\nt(3,n)o(3,n)end\n_p(2,'</Link>')end\nfunction e.additionalDependencies(e)local e=premake.getlinks(e,\"system\",\"fullpath\")if#e>0 then\n_p(3,'<AdditionalDependencies>%s;%%(AdditionalDependencies)</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,'<ItemDefinitionGroup '..i()..'>',premake.esc(t.name))C(n)h(n)a(n)e.link(n)c(n)_p(1,'</ItemDefinitionGroup>')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,'<ItemGroup>')for i,e in ipairs(e)do\n_p(2,'<%s Include=\"%s\" />',n,path.translate(e.name,\"\\\\\"))end\n_p(1,'</ItemGroup>')end\nend\nfunction e.individualSource"
+ "File(a,t,n)local e=a.solution.vstudio_configs\nlocal o=path.translate(n.name,\"\\\\\")_p(2,'<ClCompile Include=\"%s\">',o)for n,e in ipairs(e)do\nif t[e]and o==t[e]then\n_p(3,'<PrecompiledHeader '..i()..'>Create</PrecompiledHeader>',premake.esc(e.name))t[e]=nil\nend\nend\nif path.iscfile(n.name)~=premake.project.iscproject(a)then\n_p(3,'<CompileAs>%s</CompileAs>',iif(path.iscfile(n.name),'CompileAsC','CompileAsCpp'))end\n_p(2,'</ClCompile>')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,'<ItemGroup>')for o,i in ipairs(o)do\ne.individualSourceFile(n,t,i)end\n_p(1,'</ItemGroup>')end\nend\nfunction e.header(n)io.eol=\"\\r\\n\"_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')local e=\"\"if n then\ne=' DefaultTargets=\"'..n..'\"'end\n_p"
+ "('<Project%s ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">',e)end\nfunction premake.vs2010_vcxproj(n)io.indent=\" \"e.header(\"Build\")l(n)s(n)_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />')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,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />')_p(1,'<ImportGroup Label=\"ExtensionSettings\">')_p(1,'</ImportGroup>')r(n)_p(1,'<PropertyGroup Label=\"UserMacros\" />')e.outputProperties(n)d(n)e.files(n)e.projectReferences(n)_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />')_p(1,'<ImportGroup Label=\"ExtensionTargets\">')_p(1,'</ImportGroup>')_p('</Project>')end\nfunction e.projectReferences(n)local e=premake.getdependencies(n)if#e>0 then\n_p(1,'<ItemGroup>')for i,e in ipairs(e)do\nlocal n=path.getrelative(n.location,p.projectfile(e))_p(2,'<ProjectReference Include=\"%"
+ "s\">',path.translate(n,\"\\\\\"))_p(3,'<Project>{%s}</Project>',e.uuid)_p(2,'</ProjectReference>')end\n_p(1,'</ItemGroup>')end\nend\nfunction e.debugdir(e)if e.debugdir then\n_p(' <LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDirectory>',path.translate(e.debugdir,'\\\\'))_p(' <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>')end\nif e.debugargs then\n_p(' <LocalDebuggerCommandArguments>%s</LocalDebuggerCommandArguments>',table.concat(e.debugargs,\" \"))end\nend\nfunction e.debugenvs(e)if e.debugenvs and#e.debugenvs>0 then\n_p(2,'<LocalDebuggerEnvironment>%s%s</LocalDebuggerEnvironment>',table.concat(e.debugenvs,\"\\n\"),iif(e.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)',''))if e.flags.DebugEnvsDontMerge then\n_p(2,'<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>')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(' <Pr"
+ "opertyGroup '..i()..'>',premake.esc(n.name))e.debugdir(t)e.debugenvs(t)_p(' </PropertyGroup>')end\n_p('</Project>')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,'<ItemGroup>')end\ne=e..i[n]if not l[e]then\nl[e]=true\n_p(2,'<Filter Include=\"%s\">',e)_p(3,'<UniqueIdentifier>{%s}</UniqueIdentifier>',os.uuid())_p(2,'</Filter>')end\ne=e..\"\\\\\"end\nend\nif t then\n_p(1,'</ItemGroup>')end\nend\nfunction e.filefiltergroup(l,t)local e=e.getfilegroup(l,t)if#e>0 then\n_p(1,'<ItemGroup>')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,'<Filter>%s</Filter>',path.translate(l,\"\\\\\"))_p(2,'</%s>',t)else\n_p(2,'<%s Include=\"%s\" />',t,path.translate(e.name,\"\\\\\"))end\nend\n_p(1,'</ItemGroup>')end\nend\nfunction e.generate_filters(t)io.indent=\" \"e.header()e.filteridgroup(t)e.filefilterg"
@@ -262,6 +262,10 @@ const char* builtin_scripts[] = {
"premake.vstudio.vc2017={}local e=premake.vstudio.vc2017\nlocal r=premake.vstudio\nnewaction{trigger=\"vs2017\",shortname=\"Visual Studio 2017\",description=\"Generate Microsoft Visual Studio 2017 project files\",os=\"windows\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\",\"C#\"},valid_tools={cc={\"msc\"},dotnet={\"msnet\"},},onsolution=function(e)premake.generate(e,\"%%.sln\",r.sln2005.generate)end,onproject=function(e)if premake.isdotnetproject(e)then\npremake.generate(e,\"%%.csproj\",r.cs2005.generate)premake.generate(e,\"%%.csproj.user\",r.cs2005.generate_user)else\npremake.generate(e,\"%%.vcxproj\",premake.vs2010_vcxproj)premake.generate(e,\"%%.vcxproj.user\",premake.vs2010_vcxproj_user)premake.generate(e,\"%%.vcxproj.filters\",r.vc2010.generate_filters)end\nend,oncleansolution=premake.vstudio.cleansolution,oncleanproject=premake.vstudio.cleanproject,oncleantarget=premake.vstudio.cleantarget,vstudio={solutionVersion=\"12\",targetFramework=\"4.5.2\""
",toolsVersion=\"15.0\",shortSlnVersion=\"15\",}}",
+ /* actions/vstudio/vs2019.lua */
+ "premake.vstudio.vc2019={}local e=premake.vstudio.vc2019\nlocal r=premake.vstudio\nnewaction{trigger=\"vs2019\",shortname=\"Visual Studio 2019\",description=\"Generate Microsoft Visual Studio 2019 project files\",os=\"windows\",valid_kinds={\"ConsoleApp\",\"WindowedApp\",\"StaticLib\",\"SharedLib\"},valid_languages={\"C\",\"C++\",\"C#\"},valid_tools={cc={\"msc\"},dotnet={\"msnet\"},},onsolution=function(e)premake.generate(e,\"%%.sln\",r.sln2005.generate)end,onproject=function(e)if premake.isdotnetproject(e)then\npremake.generate(e,\"%%.csproj\",r.cs2005.generate)premake.generate(e,\"%%.csproj.user\",r.cs2005.generate_user)else\npremake.generate(e,\"%%.vcxproj\",premake.vs2010_vcxproj)premake.generate(e,\"%%.vcxproj.user\",premake.vs2010_vcxproj_user)premake.generate(e,\"%%.vcxproj.filters\",r.vc2010.generate_filters)end\nend,oncleansolution=premake.vstudio.cleansolution,oncleanproject=premake.vstudio.cleanproject,oncleantarget=premake.vstudio.cleantarget,vstudio={solutionVersion=\"12\",targetFramework=\"4.7\",t"
+ "oolsVersion=\"16.0\",shortSlnVersion=\"16\",}}",
+
/* actions/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,}",
@@ -299,8 +303,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 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",
+ "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",
0
};
@@ -355,6 +359,7 @@ const char* builtin_script_fnames[] = {
"@actions/vstudio/vs2013.lua",
"@actions/vstudio/vs2015.lua",
"@actions/vstudio/vs2017.lua",
+ "@actions/vstudio/vs2019.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 2208b42..240889d 100755
--- a/tests/actions/vstudio/sln2005/header.lua
+++ b/tests/actions/vstudio/sln2005/header.lua
@@ -77,7 +77,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
]]
--[[
-VS 2013 seems to add:
+VS 2013 seems to add something like:
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
@@ -94,7 +94,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
]]
--[[
-VS 2015 seems to add:
+VS 2015 seems to add something like:
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
@@ -111,7 +111,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
]]
--[[
-VS 2017 seems to add:
+VS 2017 seems to add something like:
VisualStudioVersion = 15.0.26228.4
MinimumVisualStudioVersion = 10.0.40219.1
@@ -119,3 +119,20 @@ MinimumVisualStudioVersion = 10.0.40219.1
which don't seem to be mandatory, though.
]]
end
+
+ function suite.On2019()
+ _ACTION = "vs2019"
+ prepare()
+ test.capture [[
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 16
+ ]]
+--[[
+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
diff --git a/tests/actions/vstudio/vc2010/test_config_props.lua b/tests/actions/vstudio/vc2010/test_config_props.lua
index d2f18dd..b1b19ff 100644
--- a/tests/actions/vstudio/vc2010/test_config_props.lua
+++ b/tests/actions/vstudio/vc2010/test_config_props.lua
@@ -102,3 +102,16 @@
</PropertyGroup>
]]
end
+
+ function suite.structureIsCorrect_onDefaultValues_on2019()
+ _ACTION = "vs2019"
+ prepare()
+ test.capture [[
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ ]]
+ end