shithub: opus-tools

Download patch

ref: 3fa112896912c18b69b6ca0ed5d27838e3f34739
parent: 1dc81121352225cc2c8a1c50038a600eac0eecfc
author: Ricardo Constantino (:RiCON) <wiiaboo@gmail.com>
date: Tue Jul 26 18:21:51 EDT 2016

VS2015: Use simple project to run genversion.bat.

Avoids trying to create and replace version.h more than once which
led to file-locking errors with multicore builds.

Signed-off-by: Ralph Giles <giles@thaumas.net>

--- /dev/null
+++ b/win32/VS2015/generate_version.vcxproj
@@ -1,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Any|Win32">
+      <Configuration>Any</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA}</ProjectGuid>
+    <RootNamespace>generate_version</RootNamespace>
+    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Any|Win32'" Label="Configuration">
+    <ConfigurationType>Utility</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Any|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Any|Win32'">
+    <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Any|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+    </ClCompile>
+    <Link>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+    <CustomBuildStep>
+      <Command>"$(ProjectDir)..\..\win32\genversion.bat" "$(ProjectDir)..\..\win32\version.h" PACKAGE_VERSION</Command>
+    </CustomBuildStep>
+    <CustomBuildStep>
+      <Message>Generating version.h</Message>
+    </CustomBuildStep>
+    <CustomBuildStep>
+      <TreatOutputAsContent>false</TreatOutputAsContent>
+    </CustomBuildStep>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <CustomBuild Include="..\genversion.bat">
+      <FileType>Document</FileType>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Any|Win32'">"$(ProjectDir)..\genversion.bat" "$(ProjectDir)..\version.h" PACKAGE_VERSION</Command>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Any|Win32'">Generating version.h</Message>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Any|Win32'">$(ProjectDir)..\version.h</Outputs>
+    </CustomBuild>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
--- a/win32/VS2015/opus-tools.sln
+++ b/win32/VS2015/opus-tools.sln
@@ -4,11 +4,22 @@
 VisualStudioVersion = 14.0.25420.1
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opusdec", "opusdec.vcxproj", "{F2434089-C12F-D049-6D5E-19E75E1C68D2}"
+	ProjectSection(ProjectDependencies) = postProject
+		{77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA} = {77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA}
+	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opusenc", "opusenc.vcxproj", "{02C9F2A5-2FE3-B16A-D0E1-FCAAEFC3B855}"
+	ProjectSection(ProjectDependencies) = postProject
+		{77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA} = {77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA}
+	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opusinfo", "opusinfo.vcxproj", "{BE460D7E-0DD8-81AC-FC4D-AB960C097EFE}"
+	ProjectSection(ProjectDependencies) = postProject
+		{77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA} = {77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA}
+	EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "generate_version", "generate_version.vcxproj", "{77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
@@ -41,6 +52,14 @@
 		{BE460D7E-0DD8-81AC-FC4D-AB960C097EFE}.Release|Win32.Build.0 = Release|Win32
 		{BE460D7E-0DD8-81AC-FC4D-AB960C097EFE}.Release|x64.ActiveCfg = Release|x64
 		{BE460D7E-0DD8-81AC-FC4D-AB960C097EFE}.Release|x64.Build.0 = Release|x64
+		{77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA}.Debug|Win32.ActiveCfg = Any|Win32
+		{77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA}.Debug|Win32.Build.0 = Any|Win32
+		{77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA}.Debug|x64.ActiveCfg = Any|Win32
+		{77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA}.Debug|x64.Build.0 = Any|Win32
+		{77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA}.Release|Win32.ActiveCfg = Any|Win32
+		{77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA}.Release|Win32.Build.0 = Any|Win32
+		{77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA}.Release|x64.ActiveCfg = Any|Win32
+		{77C41C23-C4D0-4B86-9E1B-16BCD80FC0CA}.Release|x64.Build.0 = Any|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
--- a/win32/VS2015/opusdec.vcxproj
+++ b/win32/VS2015/opusdec.vcxproj
@@ -131,8 +131,10 @@
       <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
-      <Command>"$(ProjectDir)..\genversion.bat" "$(ProjectDir)..\version.h" PACKAGE_VERSION</Command>
-      <Message>Generating version.h</Message>
+      <Command>
+      </Command>
+      <Message>
+      </Message>
     </PreBuildEvent>
     <CustomBuildStep>
       <Command>
@@ -159,8 +161,10 @@
       <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
-      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" PACKAGE_VERSION</Command>
-      <Message>Generating version.h</Message>
+      <Command>
+      </Command>
+      <Message>
+      </Message>
     </PreBuildEvent>
     <CustomBuildStep>
       <Command>
@@ -191,8 +195,10 @@
       <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
-      <Command>"$(ProjectDir)..\genversion.bat" "$(ProjectDir)..\version.h" PACKAGE_VERSION</Command>
-      <Message>Generating version.h</Message>
+      <Command>
+      </Command>
+      <Message>
+      </Message>
     </PreBuildEvent>
     <CustomBuildStep>
       <Command>
@@ -222,8 +228,10 @@
       <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
-      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" PACKAGE_VERSION</Command>
-      <Message>Generating version.h</Message>
+      <Command>
+      </Command>
+      <Message>
+      </Message>
     </PreBuildEvent>
     <CustomBuildStep>
       <Command>
--- a/win32/VS2015/opusenc.vcxproj
+++ b/win32/VS2015/opusenc.vcxproj
@@ -133,8 +133,10 @@
       <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
-      <Command>"$(ProjectDir)..\genversion.bat" "$(ProjectDir)..\version.h" PACKAGE_VERSION</Command>
-      <Message>Generating version.h</Message>
+      <Command>
+      </Command>
+      <Message>
+      </Message>
     </PreBuildEvent>
     <CustomBuildStep>
       <Command>
@@ -161,8 +163,10 @@
       <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
-      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" PACKAGE_VERSION</Command>
-      <Message>Generating version.h</Message>
+      <Command>
+      </Command>
+      <Message>
+      </Message>
     </PreBuildEvent>
     <CustomBuildStep>
       <Command>
@@ -193,8 +197,10 @@
       <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
-      <Command>"$(ProjectDir)..\genversion.bat" "$(ProjectDir)..\version.h" PACKAGE_VERSION</Command>
-      <Message>Generating version.h</Message>
+      <Command>
+      </Command>
+      <Message>
+      </Message>
     </PreBuildEvent>
     <CustomBuildStep>
       <Command>
@@ -224,8 +230,10 @@
       <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
-      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" PACKAGE_VERSION</Command>
-      <Message>Generating version.h</Message>
+      <Command>
+      </Command>
+      <Message>
+      </Message>
     </PreBuildEvent>
     <CustomBuildStep>
       <Command>
--- a/win32/VS2015/opusinfo.vcxproj
+++ b/win32/VS2015/opusinfo.vcxproj
@@ -134,8 +134,10 @@
       <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
-      <Command>"$(ProjectDir)..\genversion.bat" "$(ProjectDir)..\version.h" PACKAGE_VERSION</Command>
-      <Message>Generating version.h</Message>
+      <Command>
+      </Command>
+      <Message>
+      </Message>
     </PreBuildEvent>
     <CustomBuildStep>
       <Command>
@@ -162,8 +164,10 @@
       <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
-      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" PACKAGE_VERSION</Command>
-      <Message>Generating version.h</Message>
+      <Command>
+      </Command>
+      <Message>
+      </Message>
     </PreBuildEvent>
     <CustomBuildStep>
       <Command>
@@ -194,8 +198,10 @@
       <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
-      <Command>"$(ProjectDir)..\genversion.bat" "$(ProjectDir)..\version.h" PACKAGE_VERSION</Command>
-      <Message>Generating version.h</Message>
+      <Command>
+      </Command>
+      <Message>
+      </Message>
     </PreBuildEvent>
     <CustomBuildStep>
       <Command>
@@ -225,8 +231,10 @@
       <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
     </Link>
     <PreBuildEvent>
-      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" PACKAGE_VERSION</Command>
-      <Message>Generating version.h</Message>
+      <Command>
+      </Command>
+      <Message>
+      </Message>
     </PreBuildEvent>
     <CustomBuildStep>
       <Command>