Fixes MSVC projects and adds git version generator tool
authorChris Moeller <kode54@gmail.com>
Fri, 20 Jul 2012 04:59:13 +0000 (21:59 -0700)
committerGregory Maxwell <greg@xiph.org>
Fri, 20 Jul 2012 12:48:50 +0000 (08:48 -0400)
celt/celt.vcxproj
celt/celt.vcxproj.filters
silk/float/silk_float.vcxproj
silk/silk_common.vcxproj
src/opus.vcxproj
win32/config.h
win32/genversion.bat [new file with mode: 0644]

index 2356d01..3f4508e 100644 (file)
   </ImportGroup>\r
   <PropertyGroup Label="UserMacros" />\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <CustomBuildBeforeTargets>\r
+    </CustomBuildBeforeTargets>\r
+  </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
       <Optimization>Disabled</Optimization>\r
       <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <AdditionalIncludeDirectories>../win32;../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
       <GenerateDebugInformation>true</GenerateDebugInformation>\r
     </Link>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
     <ClCompile>\r
       </PrecompiledHeader>\r
       <WarningLevel>Level3</WarningLevel>\r
       <Optimization>Disabled</Optimization>\r
-      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <AdditionalIncludeDirectories>../win32;../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
       <GenerateDebugInformation>true</GenerateDebugInformation>\r
     </Link>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
     <ClCompile>\r
       <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
       <OptimizeReferences>true</OptimizeReferences>\r
     </Link>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
     <ClCompile>\r
       <Optimization>MaxSpeed</Optimization>\r
       <FunctionLevelLinking>true</FunctionLevelLinking>\r
       <IntrinsicFunctions>true</IntrinsicFunctions>\r
-      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;WIN64;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <AdditionalIncludeDirectories>../win32;../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <FloatingPointModel>Fast</FloatingPointModel>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
       <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
       <OptimizeReferences>true</OptimizeReferences>\r
     </Link>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
-    <ClInclude Include="..\..\win32\config.h" />\r
+    <ClInclude Include="..\win32\config.h" />\r
     <ClInclude Include="arch.h" />\r
     <ClInclude Include="bands.h" />\r
     <ClInclude Include="celt.h" />\r
-    <ClInclude Include="celt_header.h" />\r
-    <ClInclude Include="celt_types.h" />\r
     <ClInclude Include="cwrs.h" />\r
     <ClInclude Include="ecintrin.h" />\r
     <ClInclude Include="entcode.h" />\r
index 66e4fc5..2773bae 100644 (file)
     <ClInclude Include="celt.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="celt_header.h">\r
-      <Filter>Header Files</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="celt_types.h">\r
-      <Filter>Header Files</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="cwrs.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
@@ -90,7 +84,7 @@
     <ClInclude Include="vq.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\..\win32\config.h">\r
+    <ClInclude Include="..\win32\config.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
   </ItemGroup>\r
index fff1302..e25aad5 100644 (file)
@@ -66,7 +66,9 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <CustomBuildBeforeTargets>Compile</CustomBuildBeforeTargets>\r
+  </PropertyGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
     <ClCompile>\r
       <PrecompiledHeader>\r
@@ -75,6 +77,7 @@
       <Optimization>Disabled</Optimization>\r
       <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <AdditionalIncludeDirectories>../;../fixed;../../win32;../../celt;../../include</AdditionalIncludeDirectories>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
     <Lib>\r
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
     </Lib>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\..\win32\genversion.bat" "$(ProjectDir)..\..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
     <ClCompile>\r
       </PrecompiledHeader>\r
       <WarningLevel>Level3</WarningLevel>\r
       <Optimization>Disabled</Optimization>\r
-      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <AdditionalIncludeDirectories>../;../fixed;../../win32;../../celt;../../include</AdditionalIncludeDirectories>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
     <Lib>\r
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
     </Lib>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\..\win32\genversion.bat" "$(ProjectDir)..\..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
     <ClCompile>\r
     <Lib>\r
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
     </Lib>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\..\win32\genversion.bat" "$(ProjectDir)..\..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
     <ClCompile>\r
       <Optimization>MaxSpeed</Optimization>\r
       <FunctionLevelLinking>true</FunctionLevelLinking>\r
       <IntrinsicFunctions>true</IntrinsicFunctions>\r
-      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;WIN64;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <AdditionalIncludeDirectories>../;../fixed;../../win32;../../celt;../../include</AdditionalIncludeDirectories>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FloatingPointModel>Fast</FloatingPointModel>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
     <Lib>\r
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
     </Lib>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\..\win32\genversion.bat" "$(ProjectDir)..\..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
     <ClCompile Include="apply_sine_window_FLP.c" />\r
index a63b2c3..87eca60 100644 (file)
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <CustomBuildBeforeTargets>\r
+    </CustomBuildBeforeTargets>\r
+  </PropertyGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
     <ClCompile>\r
       <PrecompiledHeader>\r
@@ -75,6 +78,7 @@
       <Optimization>Disabled</Optimization>\r
       <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <AdditionalIncludeDirectories>fixed;float;../win32;../celt;../include</AdditionalIncludeDirectories>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
     <Lib>\r
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
     </Lib>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
     <ClCompile>\r
       </PrecompiledHeader>\r
       <WarningLevel>Level3</WarningLevel>\r
       <Optimization>Disabled</Optimization>\r
-      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <AdditionalIncludeDirectories>fixed;float;../win32;../celt;../include</AdditionalIncludeDirectories>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
     <Lib>\r
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
     </Lib>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
     <ClCompile>\r
       <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <AdditionalIncludeDirectories>fixed;float;../win32;../celt;../include</AdditionalIncludeDirectories>\r
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FloatingPointModel>Fast</FloatingPointModel>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
     <Lib>\r
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
     </Lib>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
     <ClCompile>\r
       <Optimization>MaxSpeed</Optimization>\r
       <FunctionLevelLinking>true</FunctionLevelLinking>\r
       <IntrinsicFunctions>true</IntrinsicFunctions>\r
-      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;WIN64;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <AdditionalIncludeDirectories>fixed;float;../win32;../celt;../include</AdditionalIncludeDirectories>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FloatingPointModel>Fast</FloatingPointModel>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
     <Lib>\r
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
     </Lib>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
     <ClCompile Include="A2NLSF.c" />\r
index 1eeba0b..9aa3dcb 100644 (file)
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
     <LinkIncremental>false</LinkIncremental>\r
+    <CustomBuildBeforeTargets>\r
+    </CustomBuildBeforeTargets>\r
   </PropertyGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
     <ClCompile>\r
       <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <AdditionalIncludeDirectories>../silk;../celt;../win32;../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
       <WarningLevel>Level3</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <Optimization>Disabled</Optimization>\r
       <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration)$(PlatformArchitecture);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
       <AdditionalDependencies>celt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
     </Link>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
     <ClCompile>\r
-      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <AdditionalIncludeDirectories>../silk;../celt;../win32;../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
       <WarningLevel>Level3</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <Optimization>Disabled</Optimization>\r
       <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration)$(PlatformArchitecture);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
       <AdditionalDependencies>celt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
     </Link>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
     <ClCompile>\r
       <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration)$(PlatformArchitecture);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
       <LinkStatus>false</LinkStatus>\r
     </Link>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
     <ClCompile>\r
-      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <AdditionalIncludeDirectories>../silk;../celt;../win32;../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
       <WarningLevel>Level3</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <FloatingPointModel>Fast</FloatingPointModel>\r
     </ClCompile>\r
     <Link>\r
       <GenerateDebugInformation>false</GenerateDebugInformation>\r
       <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration)$(PlatformArchitecture);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
       <LinkStatus>false</LinkStatus>\r
     </Link>\r
+    <PreBuildEvent>\r
+      <Command>"$(ProjectDir)..\win32\genversion.bat" "$(ProjectDir)..\win32\version.h" OPUS_VERSION</Command>\r
+      <Message>Generating version.h</Message>\r
+    </PreBuildEvent>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <CustomBuildStep>\r
+      <Outputs>\r
+      </Outputs>\r
+    </CustomBuildStep>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
     <ClCompile Include="opus.c" />\r
index f41dda3..4b8cb6d 100644 (file)
@@ -19,6 +19,6 @@
 #pragma warning(disable : 4996)/* This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. */
 #endif
 
-#define OPUS_VERSION "0.9.11 win32"
+#include "version.h"
 
 #endif CONFIG_H
diff --git a/win32/genversion.bat b/win32/genversion.bat
new file mode 100644 (file)
index 0000000..9bc6917
--- /dev/null
@@ -0,0 +1,17 @@
+@echo off
+
+for /f %%v in ('git describe --tags --match "v*"') do set version=%%v
+
+set version_out=#define %2 "%version%"
+
+echo %version_out% > %1_temp
+
+echo n | comp %1_temp %1 > NUL 2> NUL
+
+if not errorlevel 1 goto exit
+
+copy /y %1_temp %1
+
+:exit
+
+del %1_temp