Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
Add support for Visual Studio 2015.
Browse files Browse the repository at this point in the history
  • Loading branch information
Underground78 committed Nov 15, 2015
1 parent 06b68e9 commit 4bd179d
Show file tree
Hide file tree
Showing 20 changed files with 171 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -13,6 +13,7 @@
/.cov/*
/.git-rewrite
/bin
/bin15
/build.user.bat
/contrib/[Aa][Ss]tyle.exe
/contrib/cov-int
Expand All @@ -29,6 +30,7 @@
/src/mpc-hc/mpcresources/tx.exe
/src/mpc-hc/res/mpc-hc.exe.manifest
/src/MPCTestAPI/bin
/src/MPCTestAPI/bin15
/src/thirdparty/DoctorDump/obj
/src/thirdparty/LAVFilters/obj
ipch
23 changes: 19 additions & 4 deletions build.bat
Expand Up @@ -56,6 +56,7 @@ FOR %%G IN (%ARG%) DO (
IF /I "%%G" == "Debug" SET "BUILDCFG=Debug" & SET /A ARGBC+=1 & SET "NO_INST=True"
IF /I "%%G" == "Release" SET "BUILDCFG=Release" & SET /A ARGBC+=1
IF /I "%%G" == "VS2013" SET "COMPILER=VS2013" & SET /A ARGCOMP+=1
IF /I "%%G" == "VS2015" SET "COMPILER=VS2015" & SET /A ARGCOMP+=1
IF /I "%%G" == "Packages" SET "PACKAGES=True" & SET /A VALID+=1
IF /I "%%G" == "Installer" SET "INSTALLER=True" & SET /A VALID+=1
IF /I "%%G" == "7z" SET "ZIP=True" & SET /A VALID+=1
Expand Down Expand Up @@ -91,9 +92,15 @@ IF /I "%ZIP%" == "True" IF "%NO_ZIP%" == "True" GOTO UnsupportedSwitch
IF /I "%MPCHC_LITE%" == "True" IF "%NO_LITE%" == "True" GOTO UnsupportedSwitch
IF /I "%CLEAN%" == "LAVFilters" IF "%NO_LAV%" == "True" GOTO UnsupportedSwitch

IF NOT DEFINED VS120COMNTOOLS GOTO MissingVar
SET "TOOLSET=%VS120COMNTOOLS%..\..\VC\vcvarsall.bat"
SET "BIN_DIR=bin"
IF /I "%COMPILER%" == "VS2015" (
IF NOT DEFINED VS140COMNTOOLS GOTO MissingVar
SET "TOOLSET=%VS140COMNTOOLS%..\..\VC\vcvarsall.bat"
SET "BIN_DIR=bin15"
) ELSE (
IF NOT DEFINED VS120COMNTOOLS GOTO MissingVar
SET "TOOLSET=%VS120COMNTOOLS%..\..\VC\vcvarsall.bat"
SET "BIN_DIR=bin"
)

IF EXIST "%FILE_DIR%signinfo.txt" (
IF /I "%INSTALLER%" == "True" SET "SIGN=True"
Expand Down Expand Up @@ -345,6 +352,10 @@ IF DEFINED MPCHC_LITE (

CALL :SubCopyDXDll %MPCHC_COPY_DX_DLL_ARGS%

IF /I "%COMPILER%" == "VS2015" (
SET MPCHC_INNO_DEF=%MPCHC_INNO_DEF% /DVS2015
)

CALL "%COMMON%" :SubDetectInnoSetup

IF NOT DEFINED InnoSetupPath (
Expand Down Expand Up @@ -398,6 +409,10 @@ IF /I "%BUILDCFG%" == "Debug" (
SET "VS_OUT_DIR=%VS_OUT_DIR%_Debug"
)

IF /I "%COMPILER%" == "VS2015" (
SET "PCKG_NAME=%PCKG_NAME%.%COMPILER%"
)

IF EXIST "%PCKG_NAME%.7z" DEL "%PCKG_NAME%.7z"
IF EXIST "%PCKG_NAME%.pdb.7z" DEL "%PCKG_NAME%.pdb.7z"
IF EXIST "%PCKG_NAME%" RD /Q /S "%PCKG_NAME%"
Expand Down Expand Up @@ -477,7 +492,7 @@ EXIT /B
TITLE %~nx0 Help
ECHO.
ECHO Usage:
ECHO %~nx0 [Clean^|Build^|Rebuild] [x86^|x64^|Both] [Main^|Resources^|MPCHC^|IconLib^|Translations^|Filters^|API^|All] [Debug^|Release] [Lite] [Packages^|Installer^|7z] [LAVFilters] [VS2013] [Analyze]
ECHO %~nx0 [Clean^|Build^|Rebuild] [x86^|x64^|Both] [Main^|Resources^|MPCHC^|IconLib^|Translations^|Filters^|API^|All] [Debug^|Release] [Lite] [Packages^|Installer^|7z] [LAVFilters] [VS2013^|VS2015] [Analyze]
ECHO.
ECHO Notes: You can also prefix the commands with "-", "--" or "/".
ECHO Debug only applies to mpc-hc.sln.
Expand Down
11 changes: 10 additions & 1 deletion distrib/mpc-hc_setup.iss
Expand Up @@ -29,6 +29,7 @@
#endif

; If you want to compile the 64-bit version define "x64build" (uncomment the define below or use build.bat)
;#define VS2015
;#define x64Build
;#define MPCHC_LITE

Expand Down Expand Up @@ -60,7 +61,11 @@
#define app_vername = app_name + " " + app_ver
#define quick_launch "{userappdata}\Microsoft\Internet Explorer\Quick Launch"

#define base_bindir = "..\bin"
#if defined(VS2015)
#define base_bindir = "..\bin15"
#else
#define base_bindir = "..\bin"
#endif

#ifdef x64Build
#define bindir = AddBackslash(base_bindir) + "mpc-hc_x64"
Expand Down Expand Up @@ -94,6 +99,10 @@
#endif
#endif

#if defined(VS2015)
#define OutFilename = OutFilename + ".VS2015"
#endif

#if MPC_NIGHTLY_RELEASE
#define FullAppNameVer = app_vername + " " + "(" + str(MPCHC_HASH) + ")"
#else
Expand Down
5 changes: 5 additions & 0 deletions docs/Compilation.txt
Expand Up @@ -10,6 +10,11 @@ Part A: Preparing the Visual Studio environment
2. Make sure you install all available updates from Microsoft Update
3. Install the DirectX SDK (June 2010) -> http://go.microsoft.com/fwlink/?LinkID=71193

Visual Studio 2015
1. Install Visual C++ 2015, part of Visual Studio 2015 (any edition will work fine)
2. Make sure you install all available updates from Microsoft Update
3. Install the DirectX SDK (June 2010) -> http://go.microsoft.com/fwlink/?LinkID=71193


Part B: Preparing the GCC environment
NOTES:
Expand Down
12 changes: 4 additions & 8 deletions src/MPCTestAPI/MPCTestAPI.vcxproj
Expand Up @@ -67,14 +67,10 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\$(Configuration)_$(Platform)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\$(Configuration)_$(Platform)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\obj\$(Configuration)_$(Platform)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\obj\$(Configuration)_$(Platform)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\$(Configuration)_$(Platform)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\$(Configuration)_$(Platform)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\obj\$(Configuration)_$(Platform)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\obj\$(Configuration)_$(Platform)\</IntDir>
<OutDir>$(SolutionDir)bin\$(Configuration)_$(Platform)\</OutDir>
<IntDir>$(SolutionDir)bin\obj\$(Configuration)_$(Platform)\</IntDir>
<OutDir Condition="'$(PlatformToolsetVersion)'=='140'">$(SolutionDir)bin15\$(Configuration)_$(Platform)\</OutDir>
<IntDir Condition="'$(PlatformToolsetVersion)'=='140'">$(SolutionDir)bin15\obj\$(Configuration)_$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down
6 changes: 5 additions & 1 deletion src/MPCTestAPI/MPCTestAPIDlg.cpp
@@ -1,5 +1,5 @@
/*
* (C) 2008-2014 see Authors.txt
* (C) 2008-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
Expand Down Expand Up @@ -164,7 +164,11 @@ BOOL CRegisterCopyDataDlg::OnInitDialog()

// TODO: Add extra initialization here

#if (_MSC_VER == 1900)
m_strMPCPath = _T("..\\..\\..\\..\\bin15\\");
#else
m_strMPCPath = _T("..\\..\\..\\..\\bin\\");
#endif
#if defined(_WIN64)
m_strMPCPath += _T("mpc-hc_x64");
#else
Expand Down
9 changes: 4 additions & 5 deletions src/MathLibFix/MathLibFix.cpp
@@ -1,5 +1,5 @@
/*
* (C) 2014 see Authors.txt
* (C) 2014-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
Expand All @@ -24,12 +24,11 @@

void WorkAroundMathLibraryBug()
{
#ifdef _WIN64
#if defined(_WIN64) && _MSC_VER == 1800
// Temporary disable the use of FMA3 to work around a bug affecting the x64 math library
// See http://connect.microsoft.com/VisualStudio/feedback/details/811093
// The issue is fixed in Visual Studio 2015, the work-around is to be removed
// when we stop supporting Visual Studio 2013
_set_FMA3_enable(0);
#if (_MSC_FULL_VER > 180021005)
#pragma message("WARNING: Check if bug http://connect.microsoft.com/VisualStudio/feedback/details/811093 is fixed")
#endif
#endif
}
6 changes: 6 additions & 0 deletions src/common.props
Expand Up @@ -3,10 +3,16 @@
<PropertyGroup>
<IntDir>$(SolutionDir)bin\obj\$(Configuration)_$(PlatformName)\$(ProjectName)\</IntDir>
<OutDir>$(SolutionDir)bin\lib\$(Configuration)_$(PlatformName)\</OutDir>
<IntDir Condition="'$(PlatformToolsetVersion)'=='140'">$(SolutionDir)bin15\obj\$(Configuration)_$(PlatformName)\$(ProjectName)\</IntDir>
<OutDir Condition="'$(PlatformToolsetVersion)'=='140'">$(SolutionDir)bin15\lib\$(Configuration)_$(PlatformName)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Filter|Win32'">$(SolutionDir)bin\Filters_x86_Debug\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Filter|x64'">$(SolutionDir)bin\Filters_x64_Debug\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release Filter|Win32'">$(SolutionDir)bin\Filters_x86\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release Filter|x64'">$(SolutionDir)bin\Filters_x64\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Filter|Win32' And '$(PlatformToolsetVersion)'=='140'">$(SolutionDir)bin15\Filters_x86_Debug\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Filter|x64' And '$(PlatformToolsetVersion)'=='140'">$(SolutionDir)bin15\Filters_x64_Debug\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release Filter|Win32' And '$(PlatformToolsetVersion)'=='140'">$(SolutionDir)bin15\Filters_x86\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release Filter|x64' And '$(PlatformToolsetVersion)'=='140'">$(SolutionDir)bin15\Filters_x64\</OutDir>
<LinkIncremental Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Debug Filter' Or '$(Configuration)'=='Debug Lite'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)'=='Release' Or '$(Configuration)'=='Release Filter' Or '$(Configuration)'=='Release Lite'">false</LinkIncremental>
</PropertyGroup>
Expand Down
11 changes: 10 additions & 1 deletion src/filters/transform/VSFilter/installer/vsfilter_setup.iss
Expand Up @@ -26,6 +26,7 @@

; If you want to compile the 64-bit version define "x64Build" (uncomment the define below or use build.bat)
#define sse_required
;#define VS2015
;#define x64Build


Expand All @@ -43,7 +44,11 @@
#define app_vername = app_name + " " + app_version
#define quick_launch "{userappdata}\Microsoft\Internet Explorer\Quick Launch"

#define base_bindir = AddBackslash(top_dir) + "bin"
#if defined(VS2015)
#define base_bindir = AddBackslash(top_dir) + "bin15"
#else
#define base_bindir = AddBackslash(top_dir) + "bin"
#endif

#ifdef x64Build
#define bindir = AddBackslash(base_bindir) + "Filters_x64"
Expand All @@ -63,6 +68,10 @@
#define FullAppNameVer = app_vername
#endif

#if defined(VS2015)
#define FullAppNameVer = FullAppNameVer + " VS2015"
#endif

#if MPC_NIGHTLY_RELEASE
#define FullAppNameVer = FullAppNameVer + " " + str(MPC_VERSION_NIGHTLY)
#endif
Expand Down
6 changes: 5 additions & 1 deletion src/mpc-hc/AboutDlg.cpp
Expand Up @@ -94,7 +94,11 @@ BOOL CAboutDlg::OnInitDialog()
#error Compiler is not supported!
#endif
#elif defined(_MSC_VER)
#if (_MSC_VER == 1800) // 2013
#if (_MSC_VER == 1900) // 2015
#if (_MSC_FULL_VER == 190023026)
m_MPCCompiler = _T("MSVC 2015");
#endif
#elif (_MSC_VER == 1800) // 2013
#if (_MSC_FULL_VER == 180040629)
m_MPCCompiler = _T("MSVC 2013 Update 5");
#elif (_MSC_FULL_VER == 180031101)
Expand Down
12 changes: 12 additions & 0 deletions src/mpc-hc/CrashReporterDialog/CrashReporterDialog.vcxproj
Expand Up @@ -50,6 +50,18 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Lite|x64'">
<OutDir>$(SolutionDir)bin\mpc-hc_x64 Lite\CrashReporter\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32' And '$(PlatformToolsetVersion)'=='140'">
<OutDir>$(SolutionDir)bin15\mpc-hc_x86\CrashReporter\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Lite|Win32' And '$(PlatformToolsetVersion)'=='140'">
<OutDir>$(SolutionDir)bin15\mpc-hc_x86 Lite\CrashReporter\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' And '$(PlatformToolsetVersion)'=='140'">
<OutDir>$(SolutionDir)bin15\mpc-hc_x64\CrashReporter\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Lite|x64' And '$(PlatformToolsetVersion)'=='140'">
<OutDir>$(SolutionDir)bin15\mpc-hc_x64 Lite\CrashReporter\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
Expand Down

0 comments on commit 4bd179d

Please sign in to comment.