Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2017-07-30 14:51:08 +0300
committerKacper Michajłow <kasper93@gmail.com>2017-07-30 20:14:00 +0300
commit0c921bc5ed83faa7e13061ef74dc3ac452807837 (patch)
treecbb480cc97039f66689049456ed4706632a17f96
parent3635f6e75fdd9baf74a5a114eff11defe86b617c (diff)
Add new define for installer with D3DCompiler version.
Fixes installer build after 3e5afbc869f00f11d5b8349156185719814dbaf3 Add some asserts to not forget to update defines when neccessery. Add environment varaible to control Windows SDK build. Switch to 8.1 SDK. Add wrapper for VersionHelpers.h
-rwxr-xr-xbuild.bat19
-rw-r--r--common.bat9
-rw-r--r--distrib/mpc-hc_setup.iss4
-rw-r--r--docs/Compilation.md2
-rw-r--r--include/mpc-hc_config.h8
-rw-r--r--include/version.h1
-rw-r--r--src/DSUtil/DSUtil.vcxproj1
-rw-r--r--src/DSUtil/DSUtil.vcxproj.filters3
-rw-r--r--src/DSUtil/VersionHelpersInternal.h36
-rw-r--r--src/filters/renderer/VideoRenderers/PixelShaderCompiler.cpp5
-rw-r--r--src/filters/renderer/VideoRenderers/RenderersSettings.cpp3
-rw-r--r--src/mpc-hc/AppSettings.cpp2
-rw-r--r--src/mpc-hc/FileAssoc.cpp2
-rw-r--r--src/mpc-hc/MainFrm.cpp2
-rw-r--r--src/mpc-hc/MouseTouch.h2
-rw-r--r--src/mpc-hc/PPageFormats.cpp2
-rw-r--r--src/mpc-hc/PPageTweaks.cpp2
-rw-r--r--src/platform.props3
18 files changed, 82 insertions, 24 deletions
diff --git a/build.bat b/build.bat
index 06e6b4598..53bef2035 100755
--- a/build.bat
+++ b/build.bat
@@ -109,6 +109,8 @@ IF EXIST "%FILE_DIR%signinfo.txt" (
IF /I "%ZIP%" == "True" SET "SIGN=True"
)
+REM Set version for DX libraries
+CALL "%COMMON%" :SubParseConfig
:Start
REM Check if the %LOG_DIR% folder exists otherwise MSBuild will fail
@@ -145,9 +147,9 @@ IF %ERRORLEVEL% NEQ 0 ENDLOCAL & EXIT /B
IF /I "%PPLATFORM%" == "Win32" (SET ARCH=x86) ELSE (SET ARCH=amd64)
IF /I "%COMPILER%" == "VS2017" (
- CALL "%TOOLSET%" -no_logo -arch=%ARCH%
+ CALL "%TOOLSET%" -no_logo -arch=%ARCH% -winsdk=%MPCHC_WINSDK_VER%
) ELSE (
- CALL "%TOOLSET%" %ARCH%
+ CALL "%TOOLSET%" %ARCH% %MPCHC_WINSDK_VER%
)
IF %ERRORLEVEL% NEQ 0 GOTO MissingVar
@@ -333,10 +335,10 @@ EXIT /B
:SubCopyDXDll
IF /I "%BUILDCFG%" == "Debug" EXIT /B
PUSHD "%BIN_DIR%"
-COPY /Y /V "%WindowsSdkDir%\Redist\D3D\%~1\d3dcompiler_47.dll" "mpc-hc_%~1%~2" >NUL
-IF %ERRORLEVEL% NEQ 0 CALL "%COMMON%" :SubMsg "ERROR" "Problem when copying %WindowsSdkDir%\Redist\D3D\%~1\d3dcompiler_47.dll" & EXIT /B
-EXPAND "%DXSDK_DIR%\Redist\Jun2010_d3dx9_43_%~1.cab" -F:d3dx9_43.dll "mpc-hc_%~1%~2"
-IF %ERRORLEVEL% NEQ 0 CALL "%COMMON%" :SubMsg "ERROR" "Problem when extracting Jun2010_d3dx9_43_%~1.cab" & EXIT /B
+COPY /Y /V "%WindowsSdkDir%\Redist\D3D\%~1\d3dcompiler_%MPC_D3D_COMPILER_VERSION%.dll" "mpc-hc_%~1%~2" >NUL
+IF %ERRORLEVEL% NEQ 0 CALL "%COMMON%" :SubMsg "ERROR" "Problem when copying %WindowsSdkDir%\Redist\D3D\%~1\d3dcompiler_%MPC_D3D_COMPILER_VERSION%.dll" & EXIT /B
+EXPAND "%DXSDK_DIR%\Redist\Jun2010_d3dx9_%MPC_DX_SDK_NUMBER%_%~1.cab" -F:d3dx9_%MPC_DX_SDK_NUMBER%.dll "mpc-hc_%~1%~2"
+IF %ERRORLEVEL% NEQ 0 CALL "%COMMON%" :SubMsg "ERROR" "Problem when extracting Jun2010_d3dx9_%MPC_DX_SDK_NUMBER%_%~1.cab" & EXIT /B
POPD
EXIT /B
@@ -458,8 +460,8 @@ IF /I "%NAME%" == "MPC-HC" (
COPY /Y /V "%VS_OUT_DIR%\%LAVFILTERSDIR%\*.dll" "%PCKG_NAME%\%LAVFILTERSDIR%" >NUL
COPY /Y /V "%VS_OUT_DIR%\%LAVFILTERSDIR%\*.manifest" "%PCKG_NAME%\%LAVFILTERSDIR%" >NUL
)
- COPY /Y /V "%VS_OUT_DIR%\d3dcompiler_47.dll" "%PCKG_NAME%\d3dcompiler_47.dll" >NUL
- COPY /Y /V "%VS_OUT_DIR%\d3dx9_43.dll" "%PCKG_NAME%\d3dx9_43.dll" >NUL
+ COPY /Y /V "%VS_OUT_DIR%\d3dcompiler_%MPC_D3D_COMPILER_VERSION%.dll" "%PCKG_NAME%\d3dcompiler_%MPC_D3D_COMPILER_VERSION%.dll" >NUL
+ COPY /Y /V "%VS_OUT_DIR%\d3dx9_%MPC_DX_SDK_NUMBER%.dll" "%PCKG_NAME%\d3dx9_%MPC_DX_SDK_NUMBER%.dll" >NUL
IF NOT EXIST "%PCKG_NAME%\Shaders" MD "%PCKG_NAME%\Shaders"
COPY /Y /V "..\src\mpc-hc\res\shaders\external\*.hlsl" "%PCKG_NAME%\Shaders" >NUL
IF /I "%BUILDCFG%" NEQ "Debug" IF /I "%BUILDCFG%" NEQ "Debug Lite" IF EXIST "%VS_OUT_DIR%\CrashReporter\crashrpt.dll" (
@@ -519,7 +521,6 @@ EXIT /B
:MissingVar
-COLOR 0C
TITLE Compiling MPC-HC %COMPILER% [ERROR]
ECHO Not all build dependencies were found.
ECHO.
diff --git a/common.bat b/common.bat
index e824fe6de..a12d02966 100644
--- a/common.bat
+++ b/common.bat
@@ -46,6 +46,13 @@ FOR %%G IN (%~1) DO (SET FOUND=%%~$PATH:G)
IF NOT DEFINED FOUND EXIT /B 1
EXIT /B
+:SubParseConfig
+REM Parses mpc-hc_confg.h for MPC* defines
+FOR /F "tokens=2,3" %%A IN ('FINDSTR /R /C:"define MPC" "include\mpc-hc_config.h"') DO (
+ IF NOT DEFINED %%A SET "%%A=%%B"
+)
+EXIT /B
+
:SubGetVersion
REM Get the version
IF NOT EXIST "include\version_rev.h" SET "FORCE_VER_UPDATE=True"
@@ -107,7 +114,7 @@ FOR /F "tokens=2*" %%A IN (
EXIT /B
:SubVSPath
-FOR /f "delims=" %%A IN ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationPath -latest -requires Microsoft.Component.MSBuild Microsoft.VisualStudio.Component.VC.ATLMFC Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP') DO SET MPCHC_VS_PATH=%%A
+FOR /f "delims=" %%A IN ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationPath -latest -requires Microsoft.Component.MSBuild Microsoft.VisualStudio.Component.VC.ATLMFC Microsoft.VisualStudio.Component.VC.Tools.x86.x64') DO SET "MPCHC_VS_PATH=%%A"
EXIT /B
:SubMsg
diff --git a/distrib/mpc-hc_setup.iss b/distrib/mpc-hc_setup.iss
index 8af1cb316..1ed800ba6 100644
--- a/distrib/mpc-hc_setup.iss
+++ b/distrib/mpc-hc_setup.iss
@@ -251,7 +251,7 @@ Source: {#bindir}\{#lavfiltersdir}\*.dll; DestDir: {app}\{#lavfiltersdir};
Source: {#bindir}\{#lavfiltersdir}\*.ax; DestDir: {app}\{#lavfiltersdir}; Components: main; Flags: ignoreversion
Source: {#bindir}\{#lavfiltersdir}\*.manifest; DestDir: {app}\{#lavfiltersdir}; Components: main; Flags: ignoreversion
#endif
-Source: {#bindir}\D3DCompiler_{#MPC_DX_SDK_NUMBER}.dll; DestDir: {app}; Components: main; Flags: ignoreversion
+Source: {#bindir}\d3dcompiler_{#MPC_D3D_COMPILER_VERSION}.dll; DestDir: {app}; Components: main; Flags: ignoreversion
Source: {#bindir}\d3dx9_{#MPC_DX_SDK_NUMBER}.dll; DestDir: {app}; Components: main; Flags: ignoreversion
Source: {#bindir}\mpciconlib.dll; DestDir: {app}; Components: mpciconlib; Flags: ignoreversion
Source: {#bindir}\{#mpchc_exe}; DestDir: {app}; Components: main; Flags: ignoreversion
@@ -261,10 +261,10 @@ Source: ..\docs\Changelog.txt; DestDir: {app}; Components: main
Source: ..\docs\Readme.txt; DestDir: {app}; Components: main; Flags: ignoreversion
Source: ..\src\mpc-hc\res\shaders\external\*.hlsl; DestDir: {app}\Shaders; Components: main; Flags: ignoreversion
#ifexist AddBackslash(crashreporter_dir) + "crashrpt.dll"
+Source: {#crashreporter_dir}\CrashReporterDialog.dll; DestDir: {app}\CrashReporter; Components: main; Flags: ignoreversion
Source: {#crashreporter_dir}\crashrpt.dll; DestDir: {app}\CrashReporter; Components: main; Flags: ignoreversion
Source: {#crashreporter_dir}\dbghelp.dll; DestDir: {app}\CrashReporter; Components: main; Flags: ignoreversion
Source: {#crashreporter_dir}\sendrpt.exe; DestDir: {app}\CrashReporter; Components: main; Flags: ignoreversion
-Source: {#crashreporter_dir}\CrashReporterDialog.dll; DestDir: {app}\CrashReporter; Components: main; Flags: ignoreversion
#endif
diff --git a/docs/Compilation.md b/docs/Compilation.md
index e70afcee2..c57b99f63 100644
--- a/docs/Compilation.md
+++ b/docs/Compilation.md
@@ -12,7 +12,7 @@ Choose `Use Git from the Windows command prompt`. This isn't mandatory, so if yo
### Visual Studio 2017 or 2015
1. Install Visual C++, part of Visual Studio (any edition will work fine).
- Make sure to select **Windows 10 SDK (10.0.10586.0)** and **MFC and ATL support** during installation.
+ Make sure to select **Windows 8.1 SDK** and **MFC and ATL support** during installation.
2. Make sure you have installed all available updates from Microsoft Update
3. Install the DirectX SDK (June 2010) → <https://go.microsoft.com/fwlink/?LinkID=71193>
diff --git a/include/mpc-hc_config.h b/include/mpc-hc_config.h
index 70d152efe..4beef2590 100644
--- a/include/mpc-hc_config.h
+++ b/include/mpc-hc_config.h
@@ -1,6 +1,6 @@
#ifndef ISPP_INVOKED
/*
- * (C) 2013-2016 see Authors.txt
+ * (C) 2013-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -55,6 +55,12 @@
#define MPC_DX_SDK_MONTH _T("June")
#define MPC_DX_SDK_YEAR 2010
+// Used in the installer
#define MPC_DX_SDK_NUMBER 43
+#define MPC_D3D_COMPILER_VERSION 47
+#ifndef ISPP_INVOKED
+// Used in build scripts
+#define MPCHC_WINSDK_VER 8.1
+#endif
#endif // MPC_HC_CONFIG_H
diff --git a/include/version.h b/include/version.h
index 09def11f5..3d8c47f10 100644
--- a/include/version.h
+++ b/include/version.h
@@ -24,7 +24,6 @@
everything for every revision. It's currently used in mpcresources, mpciconlib
and VideoRenderers projects.
* MPC_VERSION_ARCH is currently used in VSFilter only.
- * MPC_DX_SDK_NUMBER is used in the installer.
*/
#endif // ISPP_INVOKED
diff --git a/src/DSUtil/DSUtil.vcxproj b/src/DSUtil/DSUtil.vcxproj
index 992583072..3300ece70 100644
--- a/src/DSUtil/DSUtil.vcxproj
+++ b/src/DSUtil/DSUtil.vcxproj
@@ -92,6 +92,7 @@
<ClInclude Include="text.h" />
<ClInclude Include="vd.h" />
<ClInclude Include="vd_asm.h" />
+ <ClInclude Include="VersionHelpersInternal.h" />
<ClInclude Include="WinapiFunc.h" />
<ClInclude Include="WinAPIUtils.h" />
</ItemGroup>
diff --git a/src/DSUtil/DSUtil.vcxproj.filters b/src/DSUtil/DSUtil.vcxproj.filters
index 99177b902..8e2926087 100644
--- a/src/DSUtil/DSUtil.vcxproj.filters
+++ b/src/DSUtil/DSUtil.vcxproj.filters
@@ -139,5 +139,8 @@
<ClInclude Include="ISOLang.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="VersionHelpersInternal.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/src/DSUtil/VersionHelpersInternal.h b/src/DSUtil/VersionHelpersInternal.h
new file mode 100644
index 000000000..e18efe880
--- /dev/null
+++ b/src/DSUtil/VersionHelpersInternal.h
@@ -0,0 +1,36 @@
+/*
+* (C) 2017 see Authors.txt
+*
+* This file is part of MPC-HC.
+*
+* MPC-HC is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 3 of the License, or
+* (at your option) any later version.
+*
+* MPC-HC is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
+#pragma once
+
+#include <VersionHelpers.h>
+
+// Remove once newer SDK is used
+#ifndef _WIN32_WINNT_WINTHRESHOLD
+
+#define _WIN32_WINNT_WINTHRESHOLD 0x0A00
+
+VERSIONHELPERAPI
+IsWindows10OrGreater()
+{
+ return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINTHRESHOLD), LOBYTE(_WIN32_WINNT_WINTHRESHOLD), 0);
+}
+
+#endif
diff --git a/src/filters/renderer/VideoRenderers/PixelShaderCompiler.cpp b/src/filters/renderer/VideoRenderers/PixelShaderCompiler.cpp
index 164730b83..ea0a4139e 100644
--- a/src/filters/renderer/VideoRenderers/PixelShaderCompiler.cpp
+++ b/src/filters/renderer/VideoRenderers/PixelShaderCompiler.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2016 see Authors.txt
+ * (C) 2006-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -22,6 +22,7 @@
#include "stdafx.h"
#include "PixelShaderCompiler.h"
#include "../../../mpc-hc/resource.h"
+#include <mpc-hc_config.h>
#include <d3d9.h>
CPixelShaderCompiler::CPixelShaderCompiler(IDirect3DDevice9* pD3DDev, bool fStaySilent)
@@ -31,6 +32,8 @@ CPixelShaderCompiler::CPixelShaderCompiler(IDirect3DDevice9* pD3DDev, bool fStay
, m_pD3DDev(pD3DDev)
, m_Cache(pD3DDev)
{
+ static_assert(D3D_COMPILER_VERSION == MPC_D3D_COMPILER_VERSION,
+ "MPC_D3D_COMPILER_VERSION define used in the installer needs to be updated.");
m_hDll = LoadLibrary(D3DCOMPILER_DLL);
if (m_hDll) {
diff --git a/src/filters/renderer/VideoRenderers/RenderersSettings.cpp b/src/filters/renderer/VideoRenderers/RenderersSettings.cpp
index 7d6f0103a..135bcc62c 100644
--- a/src/filters/renderer/VideoRenderers/RenderersSettings.cpp
+++ b/src/filters/renderer/VideoRenderers/RenderersSettings.cpp
@@ -23,6 +23,7 @@
#include "RenderersSettings.h"
#include "../../../mpc-hc/AppSettings.h"
#include "../../../mpc-hc/mplayerc.h"
+#include <mpc-hc_config.h>
#include <d3d9.h>
#include <d3d10.h>
#include <dxgi.h>
@@ -125,7 +126,7 @@ LONGLONG CRenderersData::GetPerfCounter() const
HINSTANCE CRenderersData::GetD3X9Dll()
{
// D3DX9 v43 is the latest available and will not get any update. We support only this specific version.
- static_assert(D3DX_SDK_VERSION == 43, "Different D3DX9 version?");
+ static_assert(D3DX_SDK_VERSION == MPC_DX_SDK_NUMBER, "Different D3DX9 version?");
if (m_hD3DX9Dll == nullptr) {
m_strD3DX9Version.Format(_T("d3dx9_%u.dll"), D3DX_SDK_VERSION);
m_hD3DX9Dll = LoadLibrary(m_strD3DX9Version);
diff --git a/src/mpc-hc/AppSettings.cpp b/src/mpc-hc/AppSettings.cpp
index 1cac947e1..b96cdc575 100644
--- a/src/mpc-hc/AppSettings.cpp
+++ b/src/mpc-hc/AppSettings.cpp
@@ -33,7 +33,7 @@
#include "moreuuids.h"
#include "mplayerc.h"
#include "../thirdparty/sanear/sanear/src/Factory.h"
-#include <VersionHelpers.h>
+#include <VersionHelpersInternal.h>
#include <mvrInterfaces.h>
#pragma warning(push)
diff --git a/src/mpc-hc/FileAssoc.cpp b/src/mpc-hc/FileAssoc.cpp
index 8c4578de1..032d7318a 100644
--- a/src/mpc-hc/FileAssoc.cpp
+++ b/src/mpc-hc/FileAssoc.cpp
@@ -20,7 +20,7 @@
*/
#include "stdafx.h"
-#include <VersionHelpers.h>
+#include <VersionHelpersInternal.h>
#include "mplayerc.h"
#include "FileAssoc.h"
#include "resource.h"
diff --git a/src/mpc-hc/MainFrm.cpp b/src/mpc-hc/MainFrm.cpp
index 01f0748c2..dde0edbfc 100644
--- a/src/mpc-hc/MainFrm.cpp
+++ b/src/mpc-hc/MainFrm.cpp
@@ -100,7 +100,7 @@
#include <dvdevcod.h>
#include <dvdmedia.h>
#include <strsafe.h>
-#include <VersionHelpers.h>
+#include <VersionHelpersInternal.h>
#include <initguid.h>
#include <qnetwork.h>
diff --git a/src/mpc-hc/MouseTouch.h b/src/mpc-hc/MouseTouch.h
index e7c669ba3..29eec186b 100644
--- a/src/mpc-hc/MouseTouch.h
+++ b/src/mpc-hc/MouseTouch.h
@@ -22,7 +22,7 @@
#include <map>
#include <unordered_set>
-#include <VersionHelpers.h>
+#include <VersionHelpersInternal.h>
#include "EventDispatcher.h"
diff --git a/src/mpc-hc/PPageFormats.cpp b/src/mpc-hc/PPageFormats.cpp
index 5c287324b..0db398f1c 100644
--- a/src/mpc-hc/PPageFormats.cpp
+++ b/src/mpc-hc/PPageFormats.cpp
@@ -20,7 +20,7 @@
*/
#include "stdafx.h"
-#include <VersionHelpers.h>
+#include <VersionHelpersInternal.h>
#include "mplayerc.h"
#include "PPageFormats.h"
#include "FileAssoc.h"
diff --git a/src/mpc-hc/PPageTweaks.cpp b/src/mpc-hc/PPageTweaks.cpp
index 2d9aa6440..5012150a6 100644
--- a/src/mpc-hc/PPageTweaks.cpp
+++ b/src/mpc-hc/PPageTweaks.cpp
@@ -20,7 +20,7 @@
*/
#include "stdafx.h"
-#include <VersionHelpers.h>
+#include <VersionHelpersInternal.h>
#include "mplayerc.h"
#include "PPageTweaks.h"
#include "MainFrm.h"
diff --git a/src/platform.props b/src/platform.props
index 8d444bca0..19d7b3e23 100644
--- a/src/platform.props
+++ b/src/platform.props
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
- <WindowsTargetPlatformVersion>10.0.10586.0</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion Condition="'$(MPCHC_WINSDK_VER)' == ''">8.1</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion Condition="'$(MPCHC_WINSDK_VER)' != ''">$(MPCHC_WINSDK_VER)</WindowsTargetPlatformVersion>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset>
</PropertyGroup>