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>2015-11-15 02:14:50 +0300
committerOliver Schneider <oliver@assarbad.net>2015-11-15 02:14:50 +0300
commita20251ef1bb9516ab8dc26cc5039d61a5e6a65dc (patch)
tree8a4983ef152666c0b1fb3b4aa9cbeee34eef844a
parentb5121cf3af9d30c559af3e40636a08b8fb345c12 (diff)
Adding the vs2015.lua file to the project
New setvcvars.cmd Adding tip revision number and identifier to the binary (version info resource) --HG-- branch : WDS-build
-rw-r--r--.hgignore1
-rw-r--r--Premake4.vs8.sln3
-rw-r--r--Premake4.vs8.vcproj92
-rw-r--r--premake4.lua14
-rw-r--r--release.cmd8
-rw-r--r--setvcvars.cmd84
-rwxr-xr-xsrc/host/premake.c6
-rw-r--r--src/host/premake4.rc15
8 files changed, 195 insertions, 28 deletions
diff --git a/.hgignore b/.hgignore
index 587c87b..1fdd4a9 100644
--- a/.hgignore
+++ b/.hgignore
@@ -39,3 +39,4 @@ Visual Lint/PC-lint/**.vlstatus
*.lnt
intermediate/**
premake4.exe
+src/host/hgtip.h
diff --git a/Premake4.vs8.sln b/Premake4.vs8.sln
index c4b2b6f..553260a 100644
--- a/Premake4.vs8.sln
+++ b/Premake4.vs8.sln
@@ -7,12 +7,15 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Win32 = Release|Win32
Debug|Win32 = Debug|Win32
+ Publish|Win32 = Publish|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7F000221-EACC-2F4F-A07F-6A5D34AF10D0}.Release|Win32.ActiveCfg = Release|Win32
{7F000221-EACC-2F4F-A07F-6A5D34AF10D0}.Release|Win32.Build.0 = Release|Win32
{7F000221-EACC-2F4F-A07F-6A5D34AF10D0}.Debug|Win32.ActiveCfg = Debug|Win32
{7F000221-EACC-2F4F-A07F-6A5D34AF10D0}.Debug|Win32.Build.0 = Debug|Win32
+ {7F000221-EACC-2F4F-A07F-6A5D34AF10D0}.Publish|Win32.ActiveCfg = Publish|Win32
+ {7F000221-EACC-2F4F-A07F-6A5D34AF10D0}.Publish|Win32.Build.0 = Publish|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Premake4.vs8.vcproj b/Premake4.vs8.vcproj
index 7073e87..816486e 100644
--- a/Premake4.vs8.vcproj
+++ b/Premake4.vs8.vcproj
@@ -99,7 +99,6 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="ollisign.cmd &quot;$(TargetPath)&quot; &quot;https://bitbucket.org/windirstat/premake-stable&quot; &quot;premake4&quot;"
/>
</Configuration>
<Configuration
@@ -188,6 +187,93 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Publish|Win32"
+ OutputDirectory="bin\release"
+ IntermediateDirectory="intermediate\vs2005_$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories="src\host\lua-5.1.4\src"
+ PreprocessorDefinitions="NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;HAVE_HGTIP"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ ProgramDataBaseFileName="$(OutDir)\premake4.pdb"
+ DebugInformationFormat="0"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;HAVE_HGTIP"
+ AdditionalIncludeDirectories="src\host\lua-5.1.4\src"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ole32.lib"
+ OutputFile="$(OutDir)\premake4.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories=""
+ GenerateDebugInformation="false"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ EntryPointSymbol="mainCRTStartup"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="ollisign.cmd &quot;$(TargetPath)&quot; &quot;https://bitbucket.org/windirstat/premake-stable&quot; &quot;premake4&quot;"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
@@ -459,6 +545,10 @@
RelativePath="src\actions\vstudio\vs2013.lua"
>
</File>
+ <File
+ RelativePath="src\actions\vstudio\vs2015.lua"
+ >
+ </File>
</Filter>
<Filter
Name="xcode"
diff --git a/premake4.lua b/premake4.lua
index 3a50c0e..421ece5 100644
--- a/premake4.lua
+++ b/premake4.lua
@@ -1,7 +1,7 @@
--
-- Premake 4.x build configuration script
--
--- The below is used to insert the .vs(2005|2008|2010|2012|2013) into the file names for projects and solutions
+-- The below is used to insert the .vs(2005|2008|2010|2012|2013|2015) into the file names for projects and solutions
local action = _ACTION or ""
do
-- This is mainly to support older premake4 builds
@@ -35,7 +35,7 @@ do
local orig_getbasename = premake.project.getbasename
premake.project.getbasename = function(prjname, pattern)
if _ACTION then
- name_map = {vs2005 = "vs8", vs2008 = "vs9", vs2010 = "vs10", vs2012 = "vs11", vs2013 = "vs12"}
+ name_map = {vs2005 = "vs8", vs2008 = "vs9", vs2010 = "vs10", vs2012 = "vs11", vs2013 = "vs12", vs2015 = "vs14"}
if name_map[_ACTION] then
pattern = pattern:gsub("%%%%", "%%%%." .. name_map[_ACTION])
else
@@ -81,7 +81,7 @@ end
--
solution "Premake4"
- configurations { "Release", "Debug" }
+ configurations { "Release", "Debug", "Publish" }
location ( _OPTIONS["to"] )
project "Premake4"
@@ -108,7 +108,8 @@ end
"src/host/lua-5.1.4/src/luac.c",
"src/host/lua-5.1.4/src/print.c",
"src/host/lua-5.1.4/**.lua",
- "src/host/lua-5.1.4/etc/*.c"
+ "src/host/lua-5.1.4/etc/*.c",
+ "src/host/hgtip.h"
}
configuration "Debug"
@@ -116,7 +117,7 @@ end
defines "_DEBUG"
flags { "Symbols" }
- configuration "Release"
+ configuration "Release or Publish"
targetdir "bin/release"
defines "NDEBUG"
flags { "OptimizeSize" }
@@ -131,8 +132,9 @@ end
links { "ole32" }
files { "src/host/premake4.rc" }
- configuration {"windows", "Release"}
+ configuration {"windows", "Publish"}
postbuildcommands { 'ollisign.cmd "$(TargetPath)" "https://bitbucket.org/windirstat/premake-stable" "premake4"' }
+ defines "HAVE_HGTIP"
configuration "linux or bsd"
defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
diff --git a/release.cmd b/release.cmd
index 38fa8c5..ae47122 100644
--- a/release.cmd
+++ b/release.cmd
@@ -1,5 +1,11 @@
@echo off
@if not "%OS%"=="Windows_NT" @(echo This script requires Windows NT 4.0 or later to run properly! & goto :EOF)
+setlocal ENABLEEXTENSIONS & pushd .
call setvcvars.cmd 8.0
if NOT defined VCVER_FRIENDLY echo Unfortunately setvcvars.cmd didn't do its job. Fix the problem and run this script again.&goto :EOF
-vcbuild /rebuild /time Premake4.vs8.sln "Release|Win32" \ No newline at end of file
+set HGTIPFILE="%~dp0src\host\hgtip.h"
+for /f %%i in ('hg id -i -r tip') do @echo #define HG_TIP_ID "%%i" > %HGTIPFILE%
+for /f %%i in ('hg id -n -r tip') do @echo #define HG_TIP_REVNO "%%i" >> %HGTIPFILE%
+if exist %HGTIPFILE% type %HGTIPFILE%
+vcbuild /rebuild /time Premake4.vs8.sln "Publish|Win32"
+popd & endlocal & goto :EOF
diff --git a/setvcvars.cmd b/setvcvars.cmd
index 4509494..7d03038 100644
--- a/setvcvars.cmd
+++ b/setvcvars.cmd
@@ -1,18 +1,19 @@
@echo off
@if not "%OS%"=="Windows_NT" @(echo This script requires Windows NT 4.0 or later to run properly! & goto :EOF)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-::: 2009-2013, Oliver Schneider (assarbad.net) - PUBLIC DOMAIN/CC0
+::: 2009-2015, 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 from any of the
-::: existing Visual C++ versions from .NET (2002) through 2013 or
-::: custom given versions (or single version) on the command line.
+::: 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 2015 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
-::: in the variable SUPPORTED_VC below.
+::: in the variable SUPPORTED_VC below, by default.
::: Call it from another script and after that you will have NMAKE,
::: DEVENV.EXE and friends available without having to hardcode
-::: their path into a script or makefile.
+::: their paths into a script or makefile.
:::
::: DISCLAIMER: Disclaimer: This software is provided 'as-is', without any
::: express or implied warranty. In no event will the author be
@@ -20,17 +21,26 @@
::: software.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:SCRIPT
-if defined VCVER_FRIENDLY echo This script expects a clean environment. Don't run it several times in the same instance of CMD!&goto :EOF
setlocal & pushd .
+:: Toolsets (potentially) supported
+set SUPPORTED_TSET=amd64 x86 ia64 x86_ia64 x86_amd64 amd64_x86 x86_arm amd64_arm
+if not "%~1" == "" @(
+ if "%~1" == "/?" popd&endlocal&goto :Help
+ if "%~1" == "-?" popd&endlocal&goto :Help
+ if "%~1" == "/h" popd&endlocal&goto :Help
+ if "%~1" == "-h" popd&endlocal&goto :Help
+ if "%~1" == "/help" popd&endlocal&goto :Help
+ if "%~1" == "--help" popd&endlocal&goto :Help
+)
+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.&goto :EOF
set MIN_VC=7.0
-set MAX_VC=12.0
+set MAX_VC=14.0
set MIN_NICE=2002
+set MAX_NICE=2015
:: Internal representation of the version number
-set SUPPORTED_VC=12.0 11.0 10.0 9.0 8.0 7.1 7.0
+set SUPPORTED_VC=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=2013 2012 2010 2008 2005 2003 2002
-:: Toolsets (potentially) supported
-set SUPPORTED_TSET=amd64 x86 ia64 x86_ia64 x86_amd64 x86_arm
+set SUPPORTED_NICE=2015 2013 2012 2010 2008 2005 2003 2002
set DEFAULT_TSET=x86
reg /? > NUL 2>&1 || echo "REG.EXE is a prerequisite but wasn't found!" && goto :EOF
set SETVCV_ERROR=0
@@ -42,7 +52,7 @@ if not "%~1" == "" @(
)
:: Fall back to x86 if not given
if not defined VCTGT_TOOLSET set VCTGT_TOOLSET=%DEFAULT_TSET%
-:: Make the string appear a bit nicer
+:: Make the string appear a bit nicer, i.e. comma-separated
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
@@ -82,11 +92,17 @@ 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, ... 2013) from the internal ones
+:: Now let's distinguish the "nice" version numbers (2002, ... 2015) from the internal ones
set VCVER=%VCVER:vs=%
if "%VCVER%" geq "%MIN_NICE%" call :NICE_%VCVER% > NUL 2>&1
+:: Figure out the set of supported toolsets
+set VCVERLBL=%VCVER:.=_%
+call :TSET_%VCVERLBL% > NUL 2>&1
:: Jump over those "subs"
goto :NICE_SET
+:NICE_2015
+ set VCVER=14.0
+ goto :EOF
:NICE_2013
set VCVER=12.0
goto :EOF
@@ -108,10 +124,22 @@ goto :NICE_SET
:NICE_2002
set VCVER=7.0
goto :EOF
+:TSET_14_0
+:TSET_12_0
+ set SUPPORTED_TSET=x86 amd64 arm x86_amd64 x86_arm amd64_x86 amd64_arm
+ goto :EOF
+:TSET_11_0
+ set SUPPORTED_TSET=x86 amd64 arm x86_amd64 x86_arm
+ goto :EOF
+:TSET_10_0
+:TSET_9_0
+:TSET_8_0
+ set SUPPORTED_TSET=x86 ia64 amd64 x86_amd64 x86_ia64
+ goto :EOF
:NICE_SET
:: This is where we intend to find the installation path in the registry
set _VSINSTALLKEY=HKLM\SOFTWARE\Microsoft\VisualStudio\%VCVER%\Setup\VC
-echo Trying to find Visual C++ %VCVER% ^(%VCTGT_TOOLSET%^)
+echo Trying to locate Visual C++ %VCVER% ^(%VCTGT_TOOLSET%^)
for /f "tokens=2*" %%i in ('reg query "%_VSINSTALLKEY%" /v ProductDir 2^> NUL') do @(
call :SetVar _VCINSTALLDIR "%%j"
)
@@ -123,6 +151,7 @@ if not defined _VCINSTALLDIR @(
)
)
set TEMP_TOOLSET=%VCTGT_TOOLSET%
+set TEMP_SUPPORTED=
if defined _VCINSTALLDIR @(
if EXIST "%_VCINSTALLDIR%\vcvarsall.bat" @(
call :SetVar VCVARS_PATH "%_VCINSTALLDIR%\vcvarsall.bat"
@@ -132,7 +161,13 @@ if defined _VCINSTALLDIR @(
call :SetVar VCTGT_TOOLSET
)
)
-:
+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%
:: Return, in case nothing was found
if not defined VCVARS_PATH @( endlocal&set SETVCV_ERROR=1&goto :EOF )
:: Replace the . in the version by an underscore
@@ -141,6 +176,9 @@ set VCVERLBL=%VCVER:.=_%
call :FRIENDLY_%VCVERLBL% > NUL 2>&1
:: Jump over those "subs"
goto :FRIENDLY_SET
+:FRIENDLY_14_0
+ set _VCVER=2015 ^[%TEMP_TOOLSET%^]
+ goto :EOF
:FRIENDLY_12_0
set _VCVER=2013 ^[%TEMP_TOOLSET%^]
goto :EOF
@@ -172,6 +210,20 @@ goto :EOF
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+::: / Help subroutine
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:Help
+echo.
+echo Syntax: setvcvars ^[toolset^] ^[store^] ^[VS versions^]
+echo.
+echo The toolset can be one of %SUPPORTED_TSET% according to the version of Visual Studio.
+echo 'store' is the literal string store for Visual Studio 2015 and newer.
+exit /b 0
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+::: \ Help subroutine
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::: / SetVar subroutine
::: Param1 == name of the variable, Param2 == value to be set for the variable
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
diff --git a/src/host/premake.c b/src/host/premake.c
index 9e30d50..e93754e 100755
--- a/src/host/premake.c
+++ b/src/host/premake.c
@@ -12,8 +12,12 @@
#include <CoreFoundation/CFBundle.h>
#endif
-
+#ifdef HAVE_HGTIP
+# include "hgtip.h"
+# define VERSION HG_TIP_ID ":" HG_TIP_REVNO
+#else
#define VERSION "HEAD"
+#endif
#define COPYRIGHT "Copyright (C) 2002-2013 Jason Perkins and the Premake Project"
#define ERROR_MESSAGE "%s\n"
diff --git a/src/host/premake4.rc b/src/host/premake4.rc
index 10ce7a2..7018839 100644
--- a/src/host/premake4.rc
+++ b/src/host/premake4.rc
@@ -4,6 +4,9 @@
#include <winnt.rh>
#include <verrsrc.h>
+#ifdef HAVE_HGTIP
+# include "hgtip.h"
+#endif
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
@@ -25,12 +28,18 @@ BEGIN
BEGIN
VALUE "CompanyName", "WDS Team"
VALUE "FileDescription", "A build configuration tool"
- VALUE "FileVersion", "4.4-wds"
VALUE "InternalName", "premake4-windirstat"
- VALUE "LegalCopyright", "Copyright (C) 2002-2013 by Jason Perkins, with minor customizations by WDS team"
+#ifdef HAVE_HGTIP
+ VALUE "FileVersion", "4.4-wds-" HG_TIP_REVNO
+ VALUE "ProductVersion", "4.4-wds-" HG_TIP_REVNO
+ VALUE "OriginalFilename", "premake4.rev-" HG_TIP_REVNO "-" HG_TIP_ID ".exe"
+#else
+ VALUE "FileVersion", "4.4-wds"
+ VALUE "ProductVersion", "4.4-wds"
VALUE "OriginalFilename", "premake4.exe"
+#endif
+ VALUE "LegalCopyright", "Copyright (C) 2002-2013 by Jason Perkins, with minor customizations by WDS team"
VALUE "ProductName", "premake4"
- VALUE "ProductVersion", "4.4-wds"
END
END
BLOCK "VarFileInfo"