Skip to content

Commit

Permalink
project: Convert to using custom yasm build customization.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Apr 3, 2017
1 parent 42814f2 commit 4fc7dcf
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 164 deletions.
7 changes: 2 additions & 5 deletions SMP/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,9 @@ before_build:
}
# Download and install yasm integration
- ps: (New-Object Net.WebClient).DownloadFile('http://www.tortall.net/projects/yasm/releases/vsyasm-1.3.0-win64.zip', "$pwd\yasm.zip")
- ps: (New-Object Net.WebClient).DownloadFile('https://github.com/ShiftMediaProject/VSYASM/releases/download/0.1/VSYASM.zip', "$pwd\yasm.zip")
- ps: Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory("$pwd\yasm.zip", "$pwd\TempYASMUnpack")
- ps: New-Item -ItemType Directory -Force -Path "$env:VCINSTALLDIR\bin\"
- ps: Move-Item -Force "TempYASMUnpack\*.exe" "$env:VCINSTALLDIR\bin\"
- ps: (Get-Content "$pwd\TempYASMUnpack\vsyasm.props") -replace '\$\(Platform\)', 'win$(PlatformArchitecture)' | Set-Content "$pwd\TempYASMUnpack\vsyasm.props"
- ps: Copy-Item -Force "TempYASMUnpack\*.*" "$env:VCTargetsPath\BuildCustomizations"
- cmd: call ".\TempYASMUnpack\install_script.bat"
# Additional yasm location in order to fix gitlink error
- ps: if ($env:MSVC_VER -ne 15) { Copy-Item -Force "TempYASMUnpack\*.*" "$env:VCTargetsPath\..\BuildCustomizations" }

Expand Down
198 changes: 65 additions & 133 deletions SMP/libxvidcore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\vsyasm.props" />
<Import Project="$(VCTargetsPath)\BuildCustomizations\yasm.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
Expand Down Expand Up @@ -252,8 +252,9 @@ mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\xvid.txt</Command>
</PostBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir)\..\src</IncludePaths>
<Defines>WINDOWS;%(Defines)</Defines>
<IncludePaths>$(ProjectDir)\..\src;%(IncludePaths)</IncludePaths>
<PreprocessorDefinitions>WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<GenerateDebugInformation>true</GenerateDebugInformation>
</YASM>
<PreBuildEvent>
<Command>if exist $(OutDir)\include\xvid.h (
Expand Down Expand Up @@ -299,9 +300,9 @@ mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\xvid.txt</Command>
</PostBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir)\..\src</IncludePaths>
<Defines>WINDOWS;ARCH_IS_X86_64;NO_PREFIX;%(Defines)</Defines>
<AdditionalOptions>-DNO_PREFIX %(AdditionalOptions)</AdditionalOptions>
<IncludePaths>$(ProjectDir)\..\src;%(IncludePaths)</IncludePaths>
<PreprocessorDefinitions>WINDOWS;ARCH_IS_X86_64;NO_PREFIX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<GenerateDebugInformation>true</GenerateDebugInformation>
</YASM>
<PreBuildEvent>
<Command>if exist $(OutDir)\include\xvid.h (
Expand Down Expand Up @@ -352,10 +353,9 @@ mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\xvid.txt</Command>
</PostBuildEvent>
<YASM>
<ErrorFile>
</ErrorFile>
<IncludePaths>$(ProjectDir)\..\src</IncludePaths>
<Defines>WINDOWS;%(Defines)</Defines>
<IncludePaths>$(ProjectDir)\..\src;%(IncludePaths)</IncludePaths>
<PreprocessorDefinitions>WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<GenerateDebugInformation>true</GenerateDebugInformation>
</YASM>
<PreBuildEvent>
<Command>if exist $(OutDir)\include\xvid.h (
Expand Down Expand Up @@ -405,9 +405,9 @@ mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\xvid.txt</Command>
</PostBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir)\..\src</IncludePaths>
<Defines>WINDOWS;ARCH_IS_X86_64;NO_PREFIX;%(Defines)</Defines>
<AdditionalOptions>-DNO_PREFIX %(AdditionalOptions)</AdditionalOptions>
<IncludePaths>$(ProjectDir)\..\src;%(IncludePaths)</IncludePaths>
<PreprocessorDefinitions>WINDOWS;ARCH_IS_X86_64;NO_PREFIX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<GenerateDebugInformation>true</GenerateDebugInformation>
</YASM>
<PreBuildEvent>
<Command>if exist $(OutDir)\include\xvid.h (
Expand Down Expand Up @@ -466,8 +466,8 @@ mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\xvid.txt</Command>
</PostBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir)\..\src</IncludePaths>
<Defines>WINDOWS;%(Defines)</Defines>
<IncludePaths>$(ProjectDir)\..\src;%(IncludePaths)</IncludePaths>
<PreprocessorDefinitions>WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</YASM>
<PreBuildEvent>
<Command>if exist $(OutDir)\include\xvid.h (
Expand Down Expand Up @@ -526,8 +526,8 @@ mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\xvid.txt</Command>
</PostBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir)\..\src</IncludePaths>
<Defines>WINDOWS;%(Defines)</Defines>
<IncludePaths>$(ProjectDir)\..\src;%(IncludePaths)</IncludePaths>
<PreprocessorDefinitions>WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</YASM>
<PreBuildEvent>
<Command>if exist $(OutDir)\include\xvid.h (
Expand Down Expand Up @@ -586,9 +586,8 @@ mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\xvid.txt</Command>
</PostBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir)\..\src</IncludePaths>
<Defines>WINDOWS;ARCH_IS_X86_64;NO_PREFIX;%(Defines)</Defines>
<AdditionalOptions>-DNO_PREFIX %(AdditionalOptions)</AdditionalOptions>
<IncludePaths>$(ProjectDir)\..\src;%(IncludePaths)</IncludePaths>
<PreprocessorDefinitions>WINDOWS;ARCH_IS_X86_64;NO_PREFIX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</YASM>
<PreBuildEvent>
<Command>if exist $(OutDir)\include\xvid.h (
Expand Down Expand Up @@ -647,9 +646,8 @@ mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\xvid.txt</Command>
</PostBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir)\..\src</IncludePaths>
<Defines>WINDOWS;ARCH_IS_X86_64;NO_PREFIX;%(Defines)</Defines>
<AdditionalOptions>-DNO_PREFIX %(AdditionalOptions)</AdditionalOptions>
<IncludePaths>$(ProjectDir)\..\src;%(IncludePaths)</IncludePaths>
<PreprocessorDefinitions>WINDOWS;ARCH_IS_X86_64;NO_PREFIX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</YASM>
<PreBuildEvent>
<Command>if exist $(OutDir)\include\xvid.h (
Expand Down Expand Up @@ -712,8 +710,8 @@ mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\xvid.txt</Command>
</PostBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir)\..\src</IncludePaths>
<Defines>WINDOWS;%(Defines)</Defines>
<IncludePaths>$(ProjectDir)\..\src;%(IncludePaths)</IncludePaths>
<PreprocessorDefinitions>WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</YASM>
<PreBuildEvent>
<Command>if exist $(OutDir)\include\xvid.h (
Expand Down Expand Up @@ -775,8 +773,8 @@ mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\xvid.txt</Command>
</PostBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir)\..\src</IncludePaths>
<Defines>WINDOWS;ARCH_IS_X86_64;NO_PREFIX;%(Defines)</Defines>
<IncludePaths>$(ProjectDir)\..\src;%(IncludePaths)</IncludePaths>
<PreprocessorDefinitions>WINDOWS;ARCH_IS_X86_64;NO_PREFIX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</YASM>
<PreBuildEvent>
<Command>if exist $(OutDir)\include\xvid.h (
Expand Down Expand Up @@ -879,120 +877,54 @@ del /f /q $(OutDir)\licenses\xvid.txt
</ItemGroup>
<ItemGroup>
<None Include="..\build\generic\libxvidcore.def" />
<YASM Include="..\src\bitstream\x86_asm\cbp_mmx.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\bitstream\x86_asm\cbp_sse2.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\dct\x86_asm\fdct_mmx_ffmpeg.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\dct\x86_asm\fdct_mmx_skal.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\dct\x86_asm\fdct_sse2_skal.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\dct\x86_asm\idct_3dne.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\dct\x86_asm\idct_mmx.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\dct\x86_asm\idct_sse2_dmitry.asm">
<FileType>Document</FileType>
</YASM>
<None Include="..\src\image\x86_asm\colorspace_mmx.inc" />
</ItemGroup>
<ItemGroup>
<Text Include="readme.txt" />
</ItemGroup>
<ItemGroup>
<YASM Include="..\src\bitstream\x86_asm\cbp_mmx.asm" />
<YASM Include="..\src\bitstream\x86_asm\cbp_sse2.asm" />
<YASM Include="..\src\dct\x86_asm\fdct_mmx_ffmpeg.asm" />
<YASM Include="..\src\dct\x86_asm\fdct_mmx_skal.asm" />
<YASM Include="..\src\dct\x86_asm\fdct_sse2_skal.asm" />
<YASM Include="..\src\dct\x86_asm\idct_3dne.asm" />
<YASM Include="..\src\dct\x86_asm\idct_mmx.asm" />
<YASM Include="..\src\dct\x86_asm\idct_sse2_dmitry.asm" />
<YASM Include="..\src\image\x86_asm\colorspace_mmx.inc" />
<YASM Include="..\src\image\x86_asm\colorspace_rgb_mmx.asm">
<FileType>Document</FileType>
<IncludePaths>$(ProjectDir)\..\src\image\x86_asm;%(IncludePaths)</IncludePaths>
</YASM>
<YASM Include="..\src\image\x86_asm\colorspace_yuv_mmx.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\image\x86_asm\colorspace_yuv_mmx.asm" />
<YASM Include="..\src\image\x86_asm\colorspace_yuyv_mmx.asm">
<FileType>Document</FileType>
<IncludePaths>$(ProjectDir)\..\src\image\x86_asm;%(IncludePaths)</IncludePaths>
</YASM>
<YASM Include="..\src\image\x86_asm\deintl_sse.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\image\x86_asm\gmc_mmx.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\image\x86_asm\interpolate8x8_3dn.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\image\x86_asm\interpolate8x8_3dne.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\image\x86_asm\interpolate8x8_mmx.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\image\x86_asm\interpolate8x8_xmm.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\image\x86_asm\postprocessing_mmx.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\image\x86_asm\postprocessing_sse2.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\image\x86_asm\qpel_mmx.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\image\x86_asm\reduced_mmx.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\motion\x86_asm\sad_3dn.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\motion\x86_asm\sad_3dne.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\motion\x86_asm\sad_mmx.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\motion\x86_asm\sad_sse2.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\motion\x86_asm\sad_xmm.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\plugins\x86_asm\plugin_ssim-a.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\quant\x86_asm\quantize_h263_3dne.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\quant\x86_asm\quantize_h263_mmx.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\quant\x86_asm\quantize_mpeg_mmx.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\quant\x86_asm\quantize_mpeg_xmm.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\utils\x86_asm\cpuid.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\utils\x86_asm\interlacing_mmx.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\utils\x86_asm\mem_transfer_3dne.asm">
<FileType>Document</FileType>
</YASM>
<YASM Include="..\src\utils\x86_asm\mem_transfer_mmx.asm">
<FileType>Document</FileType>
</YASM>
</ItemGroup>
<ItemGroup>
<Text Include="readme.txt" />
<YASM Include="..\src\image\x86_asm\deintl_sse.asm" />
<YASM Include="..\src\image\x86_asm\gmc_mmx.asm" />
<YASM Include="..\src\image\x86_asm\interpolate8x8_3dn.asm" />
<YASM Include="..\src\image\x86_asm\interpolate8x8_3dne.asm" />
<YASM Include="..\src\image\x86_asm\interpolate8x8_mmx.asm" />
<YASM Include="..\src\image\x86_asm\interpolate8x8_xmm.asm" />
<YASM Include="..\src\image\x86_asm\postprocessing_mmx.asm" />
<YASM Include="..\src\image\x86_asm\postprocessing_sse2.asm" />
<YASM Include="..\src\image\x86_asm\qpel_mmx.asm" />
<YASM Include="..\src\image\x86_asm\reduced_mmx.asm" />
<YASM Include="..\src\motion\x86_asm\sad_3dn.asm" />
<YASM Include="..\src\motion\x86_asm\sad_3dne.asm" />
<YASM Include="..\src\motion\x86_asm\sad_mmx.asm" />
<YASM Include="..\src\motion\x86_asm\sad_sse2.asm" />
<YASM Include="..\src\motion\x86_asm\sad_xmm.asm" />
<YASM Include="..\src\plugins\x86_asm\plugin_ssim-a.asm" />
<YASM Include="..\src\quant\x86_asm\quantize_h263_3dne.asm" />
<YASM Include="..\src\quant\x86_asm\quantize_h263_mmx.asm" />
<YASM Include="..\src\quant\x86_asm\quantize_mpeg_mmx.asm" />
<YASM Include="..\src\quant\x86_asm\quantize_mpeg_xmm.asm" />
<YASM Include="..\src\utils\x86_asm\cpuid.asm" />
<YASM Include="..\src\utils\x86_asm\interlacing_mmx.asm" />
<YASM Include="..\src\utils\x86_asm\mem_transfer_3dne.asm" />
<YASM Include="..\src\utils\x86_asm\mem_transfer_mmx.asm" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\vsyasm.targets" />
<Import Project="$(VCTargetsPath)\BuildCustomizations\yasm.targets" />
</ImportGroup>
</Project>
12 changes: 6 additions & 6 deletions SMP/libxvidcore.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,13 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\src\image\x86_asm\colorspace_mmx.inc">
<Filter>Source Files\image\x86_asm</Filter>
</None>
<None Include="..\build\generic\libxvidcore.def">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Text Include="readme.txt" />
</ItemGroup>
<ItemGroup>
<YASM Include="..\src\bitstream\x86_asm\cbp_mmx.asm">
<Filter>Source Files\bitstream\x86_asm</Filter>
Expand All @@ -348,6 +348,9 @@
<YASM Include="..\src\dct\x86_asm\idct_sse2_dmitry.asm">
<Filter>Source Files\dct\x86_asm</Filter>
</YASM>
<YASM Include="..\src\image\x86_asm\colorspace_mmx.inc">
<Filter>Source Files\image\x86_asm</Filter>
</YASM>
<YASM Include="..\src\image\x86_asm\colorspace_rgb_mmx.asm">
<Filter>Source Files\image\x86_asm</Filter>
</YASM>
Expand Down Expand Up @@ -430,7 +433,4 @@
<Filter>Source Files\utils\x86_asm</Filter>
</YASM>
</ItemGroup>
<ItemGroup>
<Text Include="readme.txt" />
</ItemGroup>
</Project>
24 changes: 4 additions & 20 deletions SMP/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,9 @@ Choose whichever project configuration meets your requirements.

*** Building with YASM ***

In order to build xvid using msvc you must first download and install YASM.
YASM is required to compile all xvid assembly files.
In order to build gmp using msvc you must first download and install YASM.
YASM is required to compile all gmp assembly files.

1) Download yasm for Visual Studio from here:
http://yasm.tortall.net/Download.html
1) Visual Studio YASM integration can be downloaded from https://github.com/ShiftMediaProject/VSYASM/releases/latest

Currently only up to VS2010 in supported on the web page so just download that.

2) Follow the instructions found within the downloaded archive for installing YASM
Note: With newer version of VS the BuildCustomization path should be the version specific to the VS version you are using.
so for instance the path for Visual Studio 2013 is:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations
and the path for Visual Studio 2015 would be:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations
and the path for Visual Studio 2017 would be:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations

The exact location can vary based on installation paths and can be found within Visual Studio in $(VCTargetsPath) macro

3) In order to use version 1.3.0 of vsyasm you will also have to fix a error in the distributed build customizations
a) Open vsyasm.props
b) Replace the 1 occurrence of $(Platform) with win$(PlatformArchitecture)
2) Once downloaded simply follow the install instructions included in the download.

0 comments on commit 4fc7dcf

Please sign in to comment.