Include the current commit as part of the build process.
BUG=angle:529
Change-Id: I6d1d227b495e9bae6e017c88642679210c6d2355
Reviewed-on: https://chromium-review.googlesource.com/177233
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Commit-Queue: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
diff --git a/.gitignore b/.gitignore
index c448ccd..7f46068 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,4 +29,5 @@
tests/third_party
out
lib/*
+src/common/commit.h
diff --git a/projects/build/All.vcxproj b/projects/build/All.vcxproj
index fde7554..2c48e7d 100644
--- a/projects/build/All.vcxproj
+++ b/projects/build/All.vcxproj
@@ -121,6 +121,10 @@
<Project>{19386E01-D811-FA3B-9F1E-122BB0C0E9F5}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
+ <ProjectReference Include="..\src\commit_id.vcxproj">
+ <Project>{3B7F5656-177F-52EE-26B3-D6A75368D0A9}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
<ProjectReference Include="..\src\libGLESv2.vcxproj">
<Project>{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
diff --git a/projects/build/all.sln b/projects/build/all.sln
index 9c0fe25..6510dc2 100644
--- a/projects/build/all.sln
+++ b/projects/build/all.sln
@@ -5,6 +5,7 @@
{C7BAF548-697D-2DCB-9DF3-9D1506A7B444} = {C7BAF548-697D-2DCB-9DF3-9D1506A7B444}
{C15697F6-5057-016E-BD29-422971875679} = {C15697F6-5057-016E-BD29-422971875679}
{19386E01-D811-FA3B-9F1E-122BB0C0E9F5} = {19386E01-D811-FA3B-9F1E-122BB0C0E9F5}
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}
{FBAEE4F6-562A-588F-01F9-72DCABB3B061} = {FBAEE4F6-562A-588F-01F9-72DCABB3B061}
{293E74D1-544C-D368-02A0-52F61A4D0679} = {293E74D1-544C-D368-02A0-52F61A4D0679}
@@ -22,6 +23,8 @@
{CBE3D362-43EA-60FC-D5AC-490039CA449A} = {CBE3D362-43EA-60FC-D5AC-490039CA449A}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "commit_id", "..\src\commit_id.vcxproj", "{3B7F5656-177F-52EE-26B3-D6A75368D0A9}"
+EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "es_util", "..\samples\es_util.vcxproj", "{80E5C3D9-93C2-943E-176F-C9A903E27BC9}"
ProjectSection(ProjectDependencies) = postProject
{FBAEE4F6-562A-588F-01F9-72DCABB3B061} = {FBAEE4F6-562A-588F-01F9-72DCABB3B061}
@@ -50,11 +53,13 @@
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libEGL", "..\src\libEGL.vcxproj", "{FBAEE4F6-562A-588F-01F9-72DCABB3B061}"
ProjectSection(ProjectDependencies) = postProject
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLESv2", "..\src\libGLESv2.vcxproj", "{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}"
ProjectSection(ProjectDependencies) = postProject
{19386E01-D811-FA3B-9F1E-122BB0C0E9F5} = {19386E01-D811-FA3B-9F1E-122BB0C0E9F5}
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}
{C7BAF548-697D-2DCB-9DF3-9D1506A7B444} = {C7BAF548-697D-2DCB-9DF3-9D1506A7B444}
EndProjectSection
EndProject
@@ -153,6 +158,10 @@
{37E1BB43-65DC-A25A-042E-30B88E6C75A2}.Debug|Win32.Build.0 = Debug|Win32
{37E1BB43-65DC-A25A-042E-30B88E6C75A2}.Release|Win32.ActiveCfg = Release|Win32
{37E1BB43-65DC-A25A-042E-30B88E6C75A2}.Release|Win32.Build.0 = Release|Win32
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9}.Debug|Win32.ActiveCfg = Debug|Win32
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9}.Debug|Win32.Build.0 = Debug|Win32
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9}.Release|Win32.ActiveCfg = Release|Win32
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9}.Release|Win32.Build.0 = Release|Win32
{3F4D97A9-0809-E0E4-5A3F-B6ACB6EABB46}.Debug|Win32.ActiveCfg = Debug|Win32
{3F4D97A9-0809-E0E4-5A3F-B6ACB6EABB46}.Debug|Win32.Build.0 = Debug|Win32
{3F4D97A9-0809-E0E4-5A3F-B6ACB6EABB46}.Release|Win32.ActiveCfg = Release|Win32
diff --git a/projects/samples/samples.sln b/projects/samples/samples.sln
index d97ccca..f6263b2 100644
--- a/projects/samples/samples.sln
+++ b/projects/samples/samples.sln
@@ -1,5 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "commit_id", "..\src\commit_id.vcxproj", "{3B7F5656-177F-52EE-26B3-D6A75368D0A9}"
+EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "es_util", "es_util.vcxproj", "{80E5C3D9-93C2-943E-176F-C9A903E27BC9}"
ProjectSection(ProjectDependencies) = postProject
{FBAEE4F6-562A-588F-01F9-72DCABB3B061} = {FBAEE4F6-562A-588F-01F9-72DCABB3B061}
@@ -28,11 +30,13 @@
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libEGL", "..\src\libEGL.vcxproj", "{FBAEE4F6-562A-588F-01F9-72DCABB3B061}"
ProjectSection(ProjectDependencies) = postProject
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLESv2", "..\src\libGLESv2.vcxproj", "{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}"
ProjectSection(ProjectDependencies) = postProject
{19386E01-D811-FA3B-9F1E-122BB0C0E9F5} = {19386E01-D811-FA3B-9F1E-122BB0C0E9F5}
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}
{C7BAF548-697D-2DCB-9DF3-9D1506A7B444} = {C7BAF548-697D-2DCB-9DF3-9D1506A7B444}
EndProjectSection
EndProject
@@ -129,6 +133,10 @@
{37E1BB43-65DC-A25A-042E-30B88E6C75A2}.Debug|Win32.Build.0 = Debug|Win32
{37E1BB43-65DC-A25A-042E-30B88E6C75A2}.Release|Win32.ActiveCfg = Release|Win32
{37E1BB43-65DC-A25A-042E-30B88E6C75A2}.Release|Win32.Build.0 = Release|Win32
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9}.Debug|Win32.ActiveCfg = Debug|Win32
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9}.Debug|Win32.Build.0 = Debug|Win32
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9}.Release|Win32.ActiveCfg = Release|Win32
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9}.Release|Win32.Build.0 = Release|Win32
{3F4D97A9-0809-E0E4-5A3F-B6ACB6EABB46}.Debug|Win32.ActiveCfg = Debug|Win32
{3F4D97A9-0809-E0E4-5A3F-B6ACB6EABB46}.Debug|Win32.Build.0 = Debug|Win32
{3F4D97A9-0809-E0E4-5A3F-B6ACB6EABB46}.Release|Win32.ActiveCfg = Release|Win32
diff --git a/projects/src/angle.sln b/projects/src/angle.sln
index da59f8b..46d0e56 100644
--- a/projects/src/angle.sln
+++ b/projects/src/angle.sln
@@ -1,13 +1,17 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "commit_id", "commit_id.vcxproj", "{3B7F5656-177F-52EE-26B3-D6A75368D0A9}"
+EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libEGL", "libEGL.vcxproj", "{FBAEE4F6-562A-588F-01F9-72DCABB3B061}"
ProjectSection(ProjectDependencies) = postProject
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLESv2", "libGLESv2.vcxproj", "{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}"
ProjectSection(ProjectDependencies) = postProject
{19386E01-D811-FA3B-9F1E-122BB0C0E9F5} = {19386E01-D811-FA3B-9F1E-122BB0C0E9F5}
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}
{C7BAF548-697D-2DCB-9DF3-9D1506A7B444} = {C7BAF548-697D-2DCB-9DF3-9D1506A7B444}
EndProjectSection
EndProject
@@ -27,6 +31,10 @@
{19386E01-D811-FA3B-9F1E-122BB0C0E9F5}.Debug|Win32.Build.0 = Debug|Win32
{19386E01-D811-FA3B-9F1E-122BB0C0E9F5}.Release|Win32.ActiveCfg = Release|Win32
{19386E01-D811-FA3B-9F1E-122BB0C0E9F5}.Release|Win32.Build.0 = Release|Win32
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9}.Debug|Win32.ActiveCfg = Debug|Win32
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9}.Debug|Win32.Build.0 = Debug|Win32
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9}.Release|Win32.ActiveCfg = Release|Win32
+ {3B7F5656-177F-52EE-26B3-D6A75368D0A9}.Release|Win32.Build.0 = Release|Win32
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}.Debug|Win32.ActiveCfg = Debug|Win32
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}.Debug|Win32.Build.0 = Debug|Win32
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}.Release|Win32.ActiveCfg = Release|Win32
diff --git a/projects/src/commit_id.vcxproj b/projects/src/commit_id.vcxproj
new file mode 100644
index 0000000..e894386
--- /dev/null
+++ b/projects/src/commit_id.vcxproj
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{3B7F5656-177F-52EE-26B3-D6A75368D0A9}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>commit_id</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
+ <PropertyGroup Label="Configuration">
+ <CharacterSet>Unicode</CharacterSet>
+ <ConfigurationType>Utility</ConfigurationType>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
+ <ImportGroup Label="ExtensionSettings"/>
+ <ImportGroup Label="PropertySheets">
+ <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros"/>
+ <PropertyGroup>
+ <ExecutablePath>$(ExecutablePath);$(MSBuildProjectDirectory)\..\..\third_party\cygwin\bin\;$(MSBuildProjectDirectory)\..\..\third_party\python_26\</ExecutablePath>
+ <OutDir>$(SolutionDir)$(Configuration)_$(Platform)\</OutDir>
+ <IntDir>$(OutDir)obj\$(ProjectName)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <TargetName>$(ProjectName)</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4530;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MinimalRebuild>false</MinimalRebuild>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;_HAS_EXCEPTIONS=0;_WIN32_WINNT=0x0600;_WINDOWS;NOMINMAX;WIN32;WIN32_LEAN_AND_MEAN;WINVER=0x0600;_DEBUG;ANGLE_DISABLE_TRACE;ANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL1;ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <RuntimeTypeInfo>false</RuntimeTypeInfo>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <WarningLevel>Level4</WarningLevel>
+ </ClCompile>
+ <Lib>
+ <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Lib>
+ <Link>
+ <AdditionalDependencies>kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <FixedBaseAddress>false</FixedBaseAddress>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ImportLibrary>$(OutDir)lib\$(TargetName).lib</ImportLibrary>
+ <MapFileName>$(OutDir)$(TargetName).map</MapFileName>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <Culture>0x0409</Culture>
+ <PreprocessorDefinitions>ANGLE_DISABLE_TRACE;ANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL1;ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4530;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MinimalRebuild>false</MinimalRebuild>
+ <Optimization>MaxSpeed</Optimization>
+ <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;_HAS_EXCEPTIONS=0;_WIN32_WINNT=0x0600;_WINDOWS;NOMINMAX;WIN32;WIN32_LEAN_AND_MEAN;WINVER=0x0600;NDEBUG;ANGLE_DISABLE_TRACE;ANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL1;ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <RuntimeTypeInfo>false</RuntimeTypeInfo>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <WarningLevel>Level4</WarningLevel>
+ </ClCompile>
+ <Lib>
+ <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Lib>
+ <Link>
+ <AdditionalDependencies>kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <FixedBaseAddress>false</FixedBaseAddress>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ImportLibrary>$(OutDir)lib\$(TargetName).lib</ImportLibrary>
+ <MapFileName>$(OutDir)$(TargetName).map</MapFileName>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <Culture>0x0409</Culture>
+ <PreprocessorDefinitions>ANGLE_DISABLE_TRACE;ANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL1;ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") };%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <None Include="..\..\src\angle.gyp"/>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\src\src\angle.gyp">
+ <FileType>Document</FileType>
+ <Command>call call cmd \C "echo|set \p=#define COMMIT_HASH > common\commit.h & (git rev-parse --short=12 HEAD >> common\commit.h) || (echo badf00dbad00 >> common\commit.h)" > NUL</Command>
+ <Message>Generating commit ID header...</Message>
+ <Outputs>..\..\src\common\commit.h</Outputs>
+ </CustomBuild>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
+ <ImportGroup Label="ExtensionTargets"/>
+</Project>
diff --git a/projects/src/commit_id.vcxproj.filters b/projects/src/commit_id.vcxproj.filters
new file mode 100644
index 0000000..7b01142
--- /dev/null
+++ b/projects/src/commit_id.vcxproj.filters
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="..">
+ <UniqueIdentifier>{739DB09A-CC57-A953-A6CF-F64FA08E4FA7}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="..\..">
+ <UniqueIdentifier>{739DB09A-CC57-A953-A6CF-F64FA08E4FA7}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="..\..\src">
+ <UniqueIdentifier>{8CDEE807-BC53-E450-C8B8-4DEBB66742D4}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\..\src\angle.gyp">
+ <Filter>..\..\src</Filter>
+ </None>
+ </ItemGroup>
+</Project>
diff --git a/projects/src/libEGL.vcxproj b/projects/src/libEGL.vcxproj
index 9280289..92f6209 100644
--- a/projects/src/libEGL.vcxproj
+++ b/projects/src/libEGL.vcxproj
@@ -124,8 +124,9 @@
<ClInclude Include="..\..\src\common\event_tracer.h"/>
<ClInclude Include="..\..\src\common\RefCountObject.h"/>
<ClInclude Include="..\..\src\common\version.h"/>
- <ClInclude Include="..\..\src\common\system.h"/>
<ClInclude Include="..\..\src\common\utilities.h"/>
+ <ClInclude Include="..\..\src\common\system.h"/>
+ <ClInclude Include="..\..\src\common\commit.h"/>
<ClInclude Include="..\..\src\common\debug.h"/>
<ClInclude Include="..\..\src\common\angleutils.h"/>
</ItemGroup>
@@ -149,6 +150,10 @@
<Project>{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
+ <ProjectReference Include="commit_id.vcxproj">
+ <Project>{3B7F5656-177F-52EE-26B3-D6A75368D0A9}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
<ImportGroup Label="ExtensionTargets"/>
diff --git a/projects/src/libEGL.vcxproj.filters b/projects/src/libEGL.vcxproj.filters
index e88f47b..23199f6 100644
--- a/projects/src/libEGL.vcxproj.filters
+++ b/projects/src/libEGL.vcxproj.filters
@@ -69,12 +69,15 @@
<ClInclude Include="..\..\src\common\version.h">
<Filter>..\..\src\common</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\common\system.h">
+ <ClInclude Include="..\..\src\common\utilities.h">
<Filter>..\..\src\common</Filter>
</ClInclude>
<ClCompile Include="..\..\src\common\event_tracer.cpp">
<Filter>..\..\src\common</Filter>
</ClCompile>
+ <ClInclude Include="..\..\src\common\system.h">
+ <Filter>..\..\src\common</Filter>
+ </ClInclude>
<ClCompile Include="..\..\src\common\RefCountObject.cpp">
<Filter>..\..\src\common</Filter>
</ClCompile>
@@ -84,7 +87,7 @@
<ClCompile Include="..\..\src\common\utilities.cpp">
<Filter>..\..\src\common</Filter>
</ClCompile>
- <ClInclude Include="..\..\src\common\utilities.h">
+ <ClInclude Include="..\..\src\common\commit.h">
<Filter>..\..\src\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\common\debug.h">
diff --git a/projects/src/libGLESv2.vcxproj b/projects/src/libGLESv2.vcxproj
index 6d1f414..44b96d7 100644
--- a/projects/src/libGLESv2.vcxproj
+++ b/projects/src/libGLESv2.vcxproj
@@ -260,10 +260,11 @@
<ClInclude Include="..\..\src\common\RefCountObject.h"/>
<ClInclude Include="..\..\src\common\mathutil.h"/>
<ClInclude Include="..\..\src\common\event_tracer.h"/>
+ <ClInclude Include="..\..\src\common\commit.h"/>
<ClInclude Include="..\..\src\common\debug.h"/>
<ClInclude Include="..\..\src\common\version.h"/>
- <ClInclude Include="..\..\src\common\utilities.h"/>
<ClInclude Include="..\..\src\common\system.h"/>
+ <ClInclude Include="..\..\src\common\utilities.h"/>
<ClInclude Include="..\..\src\common\angleutils.h"/>
<ClInclude Include="..\..\src\third_party\murmurhash\MurmurHash3.h"/>
</ItemGroup>
@@ -361,6 +362,10 @@
<Project>{19386E01-D811-FA3B-9F1E-122BB0C0E9F5}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
+ <ProjectReference Include="commit_id.vcxproj">
+ <Project>{3B7F5656-177F-52EE-26B3-D6A75368D0A9}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
<ProjectReference Include="preprocessor.vcxproj">
<Project>{C7BAF548-697D-2DCB-9DF3-9D1506A7B444}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
diff --git a/projects/src/libGLESv2.vcxproj.filters b/projects/src/libGLESv2.vcxproj.filters
index 4bad93f..949eae5 100644
--- a/projects/src/libGLESv2.vcxproj.filters
+++ b/projects/src/libGLESv2.vcxproj.filters
@@ -708,6 +708,9 @@
<ClCompile Include="..\..\src\common\event_tracer.cpp">
<Filter>..\..\src\common</Filter>
</ClCompile>
+ <ClInclude Include="..\..\src\common\commit.h">
+ <Filter>..\..\src\common</Filter>
+ </ClInclude>
<ClCompile Include="..\..\src\common\RefCountObject.cpp">
<Filter>..\..\src\common</Filter>
</ClCompile>
@@ -726,10 +729,10 @@
<ClInclude Include="..\..\src\common\version.h">
<Filter>..\..\src\common</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\common\utilities.h">
+ <ClInclude Include="..\..\src\common\system.h">
<Filter>..\..\src\common</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\common\system.h">
+ <ClInclude Include="..\..\src\common\utilities.h">
<Filter>..\..\src\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\common\angleutils.h">
diff --git a/projects/src/translator.vcxproj b/projects/src/translator.vcxproj
index 6b6ae34..5914590 100644
--- a/projects/src/translator.vcxproj
+++ b/projects/src/translator.vcxproj
@@ -120,6 +120,7 @@
<ClInclude Include="..\..\src\common\RefCountObject.h"/>
<ClInclude Include="..\..\src\common\mathutil.h"/>
<ClInclude Include="..\..\src\common\event_tracer.h"/>
+ <ClInclude Include="..\..\src\common\commit.h"/>
<ClInclude Include="..\..\src\common\system.h"/>
<ClInclude Include="..\..\src\common\debug.h"/>
<ClInclude Include="..\..\src\common\version.h"/>
@@ -133,7 +134,6 @@
<ClInclude Include="..\..\src\compiler\translator\FlagStd140Structs.h"/>
<ClInclude Include="..\..\src\compiler\translator\MapLongVariableNames.h"/>
<ClInclude Include="..\..\src\compiler\translator\PoolAlloc.h"/>
- <ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h"/>
<ClInclude Include="..\..\src\compiler\translator\BuiltInFunctionEmulator.h"/>
<ClInclude Include="..\..\src\compiler\translator\ValidateOutputs.h"/>
<ClInclude Include="..\..\src\compiler\translator\UnfoldShortCircuit.h"/>
@@ -161,6 +161,7 @@
<ClInclude Include="..\..\src\compiler\translator\ShaderVariable.h"/>
<ClInclude Include="..\..\src\compiler\translator\Pragma.h"/>
<ClInclude Include="..\..\src\compiler\translator\intermediate.h"/>
+ <ClInclude Include="..\..\src\compiler\translator\InitializeParseContext.h"/>
<ClInclude Include="..\..\src\compiler\translator\TranslatorHLSL.h"/>
<ClInclude Include="..\..\src\compiler\translator\OutputESSL.h"/>
<ClInclude Include="..\..\src\compiler\translator\RenameFunction.h"/>
@@ -175,7 +176,7 @@
<ClInclude Include="..\..\src\compiler\translator\BlockLayoutEncoder.h"/>
<ClInclude Include="..\..\src\compiler\translator\MMap.h"/>
<ClInclude Include="..\..\src\compiler\translator\OutputHLSL.h"/>
- <ClInclude Include="..\..\src\compiler\translator\InitializeParseContext.h"/>
+ <ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h"/>
<ClInclude Include="..\..\src\compiler\translator\VariableInfo.h"/>
<ClInclude Include="..\..\src\compiler\translator\glslang_tab.h"/>
<ClInclude Include="..\..\src\compiler\translator\ExtensionBehavior.h"/>
diff --git a/projects/src/translator.vcxproj.filters b/projects/src/translator.vcxproj.filters
index 20e420f..620c6d1 100644
--- a/projects/src/translator.vcxproj.filters
+++ b/projects/src/translator.vcxproj.filters
@@ -57,6 +57,9 @@
<ClCompile Include="..\..\src\common\event_tracer.cpp">
<Filter>..\..\src\common</Filter>
</ClCompile>
+ <ClInclude Include="..\..\src\common\commit.h">
+ <Filter>..\..\src\common</Filter>
+ </ClInclude>
<ClInclude Include="..\..\src\common\system.h">
<Filter>..\..\src\common</Filter>
</ClInclude>
@@ -135,9 +138,6 @@
<ClInclude Include="..\..\src\compiler\translator\PoolAlloc.h">
<Filter>..\..\src\compiler\translator</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h">
- <Filter>..\..\src\compiler\translator</Filter>
- </ClInclude>
<ClInclude Include="..\..\src\compiler\translator\BuiltInFunctionEmulator.h">
<Filter>..\..\src\compiler\translator</Filter>
</ClInclude>
@@ -264,6 +264,9 @@
<ClCompile Include="..\..\src\compiler\translator\VariablePacker.cpp">
<Filter>..\..\src\compiler\translator</Filter>
</ClCompile>
+ <ClInclude Include="..\..\src\compiler\translator\InitializeParseContext.h">
+ <Filter>..\..\src\compiler\translator</Filter>
+ </ClInclude>
<ClInclude Include="..\..\src\compiler\translator\TranslatorHLSL.h">
<Filter>..\..\src\compiler\translator</Filter>
</ClInclude>
@@ -351,7 +354,7 @@
<ClCompile Include="..\..\src\compiler\translator\SymbolTable.cpp">
<Filter>..\..\src\compiler\translator</Filter>
</ClCompile>
- <ClInclude Include="..\..\src\compiler\translator\InitializeParseContext.h">
+ <ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h">
<Filter>..\..\src\compiler\translator</Filter>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\DirectiveHandler.cpp">
diff --git a/projects/src/translator_static.vcxproj b/projects/src/translator_static.vcxproj
index b80a2bc..468c422 100644
--- a/projects/src/translator_static.vcxproj
+++ b/projects/src/translator_static.vcxproj
@@ -120,6 +120,7 @@
<ClInclude Include="..\..\src\common\RefCountObject.h"/>
<ClInclude Include="..\..\src\common\mathutil.h"/>
<ClInclude Include="..\..\src\common\event_tracer.h"/>
+ <ClInclude Include="..\..\src\common\commit.h"/>
<ClInclude Include="..\..\src\common\system.h"/>
<ClInclude Include="..\..\src\common\debug.h"/>
<ClInclude Include="..\..\src\common\version.h"/>
@@ -133,7 +134,6 @@
<ClInclude Include="..\..\src\compiler\translator\FlagStd140Structs.h"/>
<ClInclude Include="..\..\src\compiler\translator\MapLongVariableNames.h"/>
<ClInclude Include="..\..\src\compiler\translator\PoolAlloc.h"/>
- <ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h"/>
<ClInclude Include="..\..\src\compiler\translator\BuiltInFunctionEmulator.h"/>
<ClInclude Include="..\..\src\compiler\translator\ValidateOutputs.h"/>
<ClInclude Include="..\..\src\compiler\translator\UnfoldShortCircuit.h"/>
@@ -161,6 +161,7 @@
<ClInclude Include="..\..\src\compiler\translator\ShaderVariable.h"/>
<ClInclude Include="..\..\src\compiler\translator\Pragma.h"/>
<ClInclude Include="..\..\src\compiler\translator\intermediate.h"/>
+ <ClInclude Include="..\..\src\compiler\translator\InitializeParseContext.h"/>
<ClInclude Include="..\..\src\compiler\translator\TranslatorHLSL.h"/>
<ClInclude Include="..\..\src\compiler\translator\OutputESSL.h"/>
<ClInclude Include="..\..\src\compiler\translator\RenameFunction.h"/>
@@ -175,7 +176,7 @@
<ClInclude Include="..\..\src\compiler\translator\BlockLayoutEncoder.h"/>
<ClInclude Include="..\..\src\compiler\translator\MMap.h"/>
<ClInclude Include="..\..\src\compiler\translator\OutputHLSL.h"/>
- <ClInclude Include="..\..\src\compiler\translator\InitializeParseContext.h"/>
+ <ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h"/>
<ClInclude Include="..\..\src\compiler\translator\VariableInfo.h"/>
<ClInclude Include="..\..\src\compiler\translator\glslang_tab.h"/>
<ClInclude Include="..\..\src\compiler\translator\ExtensionBehavior.h"/>
diff --git a/projects/src/translator_static.vcxproj.filters b/projects/src/translator_static.vcxproj.filters
index 20e420f..620c6d1 100644
--- a/projects/src/translator_static.vcxproj.filters
+++ b/projects/src/translator_static.vcxproj.filters
@@ -57,6 +57,9 @@
<ClCompile Include="..\..\src\common\event_tracer.cpp">
<Filter>..\..\src\common</Filter>
</ClCompile>
+ <ClInclude Include="..\..\src\common\commit.h">
+ <Filter>..\..\src\common</Filter>
+ </ClInclude>
<ClInclude Include="..\..\src\common\system.h">
<Filter>..\..\src\common</Filter>
</ClInclude>
@@ -135,9 +138,6 @@
<ClInclude Include="..\..\src\compiler\translator\PoolAlloc.h">
<Filter>..\..\src\compiler\translator</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h">
- <Filter>..\..\src\compiler\translator</Filter>
- </ClInclude>
<ClInclude Include="..\..\src\compiler\translator\BuiltInFunctionEmulator.h">
<Filter>..\..\src\compiler\translator</Filter>
</ClInclude>
@@ -264,6 +264,9 @@
<ClCompile Include="..\..\src\compiler\translator\VariablePacker.cpp">
<Filter>..\..\src\compiler\translator</Filter>
</ClCompile>
+ <ClInclude Include="..\..\src\compiler\translator\InitializeParseContext.h">
+ <Filter>..\..\src\compiler\translator</Filter>
+ </ClInclude>
<ClInclude Include="..\..\src\compiler\translator\TranslatorHLSL.h">
<Filter>..\..\src\compiler\translator</Filter>
</ClInclude>
@@ -351,7 +354,7 @@
<ClCompile Include="..\..\src\compiler\translator\SymbolTable.cpp">
<Filter>..\..\src\compiler\translator</Filter>
</ClCompile>
- <ClInclude Include="..\..\src\compiler\translator\InitializeParseContext.h">
+ <ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h">
<Filter>..\..\src\compiler\translator</Filter>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\DirectiveHandler.cpp">
diff --git a/src/angle.gypi b/src/angle.gypi
index 28e81c6..832559b 100644
--- a/src/angle.gypi
+++ b/src/angle.gypi
@@ -17,6 +17,32 @@
'conditions':
[
[
+ 'OS=="win"',
+ {
+ 'target_defaults':
+ {
+ 'msvs_cygwin_shell': 0,
+ },
+ 'targets':
+ [
+ {
+ 'target_name': 'commit_id',
+ 'type': 'none',
+ 'actions':
+ [
+ {
+ 'action_name': 'Generate Commit ID Header',
+ 'message': 'Generating commit ID header...',
+ 'inputs': [],
+ 'outputs': ['common/commit.h'],
+ 'action': ['cmd /C "echo|set /p=#define COMMIT_HASH > common/commit.h & (git rev-parse --short=12 HEAD >> common/commit.h) || (echo badf00dbad00 >> common/commit.h)" > NUL'],
+ }
+ ] #actions
+ }
+ ] # targets
+ },
+ ],
+ [
'angle_post_build_script!=0 and OS=="win"',
{
'target_defaults':
diff --git a/src/common/version.h b/src/common/version.h
index b941f94..e29ab57 100644
--- a/src/common/version.h
+++ b/src/common/version.h
@@ -1,12 +1,12 @@
-#define MAJOR_VERSION 2
+#include "commit.h"
+
+#define MAJOR_VERSION 3
#define MINOR_VERSION 0
-#define BUILD_VERSION 0
-#define BUILD_REVISION 2018
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
-#define REVISION_STRING MACRO_STRINGIFY(BUILD_REVISION)
-#define VERSION_STRING MACRO_STRINGIFY(MAJOR_VERSION) "." MACRO_STRINGIFY(MINOR_VERSION) "." MACRO_STRINGIFY(BUILD_VERSION) "." MACRO_STRINGIFY(BUILD_REVISION)
+#define COMMIT_STRING MACRO_STRINGIFY(COMMIT_HASH)
+#define COMMIT_STRING_LEN sizeof(COMMIT_STRING)
-#define VERSION_DWORD ((MAJOR_VERSION << 24) | (MINOR_VERSION << 16) | BUILD_REVISION)
+#define VERSION_STRING MACRO_STRINGIFY(MAJOR_VERSION) "." MACRO_STRINGIFY(MINOR_VERSION) "." COMMIT_STRING
diff --git a/src/libEGL.gypi b/src/libEGL.gypi
index 0323e6e..1cc49c0 100644
--- a/src/libEGL.gypi
+++ b/src/libEGL.gypi
@@ -12,7 +12,7 @@
{
'target_name': 'libEGL',
'type': 'shared_library',
- 'dependencies': ['libGLESv2'],
+ 'dependencies': [ 'libGLESv2', 'commit_id' ],
'include_dirs':
[
'.',
diff --git a/src/libEGL/libEGL.rc b/src/libEGL/libEGL.rc
index 5d1f32f..f041568 100644
--- a/src/libEGL/libEGL.rc
+++ b/src/libEGL/libEGL.rc
@@ -54,8 +54,8 @@
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION MAJOR_VERSION,MINOR_VERSION,BUILD_VERSION,BUILD_REVISION
- PRODUCTVERSION MAJOR_VERSION,MINOR_VERSION,BUILD_VERSION,BUILD_REVISION
+ FILEVERSION MAJOR_VERSION,MINOR_VERSION,0,0
+ PRODUCTVERSION MAJOR_VERSION,MINOR_VERSION,0,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
diff --git a/src/libGLESv2.gypi b/src/libGLESv2.gypi
index 662db97..3b0d040 100644
--- a/src/libGLESv2.gypi
+++ b/src/libGLESv2.gypi
@@ -22,7 +22,7 @@
{
'target_name': 'libGLESv2',
'type': 'shared_library',
- 'dependencies': [ 'translator_static' ],
+ 'dependencies': [ 'translator_static', 'commit_id' ],
'include_dirs':
[
'.',
diff --git a/src/libGLESv2/ProgramBinary.cpp b/src/libGLESv2/ProgramBinary.cpp
index fa307da..005e319 100644
--- a/src/libGLESv2/ProgramBinary.cpp
+++ b/src/libGLESv2/ProgramBinary.cpp
@@ -1640,9 +1640,19 @@
return false;
}
- int version = 0;
- stream.read(&version);
- if (version != VERSION_DWORD)
+ int majorVersion = 0;
+ int minorVersion = 0;
+ stream.read(&majorVersion);
+ stream.read(&minorVersion);
+ if (majorVersion != MAJOR_VERSION || minorVersion != MINOR_VERSION)
+ {
+ infoLog.append("Invalid program binary version.");
+ return false;
+ }
+
+ unsigned char commitString[COMMIT_STRING_LEN];
+ stream.read(commitString, COMMIT_STRING_LEN);
+ if (memcmp(commitString, COMMIT_STRING, sizeof(unsigned char) * COMMIT_STRING_LEN) != 0)
{
infoLog.append("Invalid program binary version.");
return false;
@@ -1858,7 +1868,9 @@
BinaryOutputStream stream;
stream.write(GL_PROGRAM_BINARY_ANGLE);
- stream.write(VERSION_DWORD);
+ stream.write(MAJOR_VERSION);
+ stream.write(MINOR_VERSION);
+ stream.write(COMMIT_STRING, COMMIT_STRING_LEN);
stream.write(ANGLE_COMPILE_OPTIMIZATION_LEVEL);
for (unsigned int i = 0; i < MAX_VERTEX_ATTRIBS; ++i)
diff --git a/src/libGLESv2/libGLESv2.rc b/src/libGLESv2/libGLESv2.rc
index 0ad21e4..1e205d5 100644
--- a/src/libGLESv2/libGLESv2.rc
+++ b/src/libGLESv2/libGLESv2.rc
@@ -54,8 +54,8 @@
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION MAJOR_VERSION,MINOR_VERSION,BUILD_VERSION,BUILD_REVISION
- PRODUCTVERSION MAJOR_VERSION,MINOR_VERSION,BUILD_VERSION,BUILD_REVISION
+ FILEVERSION MAJOR_VERSION,MINOR_VERSION,0,0
+ PRODUCTVERSION MAJOR_VERSION,MINOR_VERSION,0,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L