summaryrefslogtreecommitdiff
path: root/build.cmd
diff options
context:
space:
mode:
authorDick van den Brink <d_vandenbrink@outlook.com>2015-04-26 19:36:42 +0200
committerDick van den Brink <d_vandenbrink@outlook.com>2015-04-26 19:36:42 +0200
commitc574d1c69ca8a9cc9222e42ca66eedcd6af3e9de (patch)
tree60c04f8e6c02292ff6e0056fb90156cfb09dd266 /build.cmd
parent8a53f74af4170701b809c4454fc54bdf3bc531d3 (diff)
downloadcoreclr-c574d1c69ca8a9cc9222e42ca66eedcd6af3e9de.tar.gz
coreclr-c574d1c69ca8a9cc9222e42ca66eedcd6af3e9de.tar.bz2
coreclr-c574d1c69ca8a9cc9222e42ca66eedcd6af3e9de.zip
Allow building with VS2015 installed
Previous it was required to have VS2013 but now VS2015 can also be used. The default is still 2013 though. On a machine with both version installed it is possible to force VS2013/VS2015 with a parameter. Note: Still some work has to be done to make compilation successfull on VS2015.
Diffstat (limited to 'build.cmd')
-rw-r--r--build.cmd26
1 files changed, 18 insertions, 8 deletions
diff --git a/build.cmd b/build.cmd
index 8f8393cb5c..414186a945 100644
--- a/build.cmd
+++ b/build.cmd
@@ -6,6 +6,10 @@ set __BuildArch=x64
set __BuildType=Debug
set __BuildOS=Windows_NT
+:: Default to VS2013
+set __VSVersion=VS2013
+set __VSProductVersion=120
+
:: Set the various build properties here so that CMake and MSBuild can pick them up
set "__ProjectDir=%~dp0"
:: remove trailing slash
@@ -30,6 +34,9 @@ if /i "%1" == "clean" (set __CleanBuild=1&shift&goto Arg_Loop)
if /i "%1" == "linuxmscorlib" (set __MscorlibOnly=1&set __BuildOS=Linux&shift&goto Arg_Loop)
if /i "%1" == "osxmscorlib" (set __MscorlibOnly=1&set __BuildOS=OSX&shift&goto Arg_Loop)
+if /i "%1" == "vs2013" (set __VSVersion=%1&set __VSProductVersion=120&shift&goto Arg_Loop)
+if /i "%1" == "vs2015" (set __VSVersion=%1&set __VSProductVersion=140&shift&goto Arg_Loop)
+
echo Invalid commandline argument: %1
goto Usage
@@ -79,25 +86,27 @@ goto CheckVS
:CheckVS
:: Check presence of VS
-if defined VS120COMNTOOLS goto CheckVSExistence
+if defined VS%__VSProductVersion%COMNTOOLS goto CheckVSExistence
echo Visual Studio 2013 Community (free) is a pre-requisite to build this repository.
echo See: https://github.com/dotnet/coreclr/wiki/Developer-Guide#prerequisites
goto :eof
:CheckVSExistence
-:: Does VS 2013 really exist?
-if exist "%VS120COMNTOOLS%\..\IDE\devenv.exe" goto CheckMSBuild
+:: Does VS 2013 or VS 2015 really exist?
+if exist "!VS%__VSProductVersion%COMNTOOLS!\..\IDE\devenv.exe" goto CheckMSBuild
echo Visual Studio 2013 Community (free) is a pre-requisite to build this repository.
echo See: https://github.com/dotnet/coreclr/wiki/Developer-Guide#prerequisites
goto :eof
-:CheckMSBuild
+:CheckMSBuild
:: Note: We've disabled node reuse because it causes file locking issues.
:: The issue is that we extend the build with our own targets which
:: means that that rebuilding cannot successfully delete the task
:: assembly.
+if /i "%__VSVersion%" =="vs2015" goto MSBuild14
set _msbuildexe="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe"
+:MSBuild14
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. Please see https://github.com/dotnet/coreclr/wiki/Developer%%20Guide for build instructions. && exit /b 1
@@ -111,7 +120,7 @@ echo Commencing build of native components for %__BuildOS%.%__BuildArch%.%__Buil
echo.
:: Set the environment for the native build
-call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
+call "!VS%__VSProductVersion%COMNTOOLS!\..\..\VC\vcvarsall.bat" x86_amd64
if exist "%VSINSTALLDIR%DIA SDK" goto GenVSSolution
echo Error: DIA SDK is missing at "%VSINSTALLDIR%DIA SDK". ^
@@ -127,7 +136,7 @@ goto :eof
:GenVSSolution
:: Regenerate the VS solution
pushd "%__IntermediatesDir%"
-call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" "%__ProjectDir%"
+call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion%
popd
:BuildComponents
@@ -157,7 +166,7 @@ set Platform=
if defined __MscorlibOnly set __AdditionalMSBuildArgs=/p:BuildNugetPackage=false
:: Set the environment for the managed build
-call "%VS120COMNTOOLS%\VsDevCmd.bat"
+call "!VS%__VSProductVersion%COMNTOOLS!\VsDevCmd.bat"
echo Commencing build of mscorlib for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.
set "__MScorlibBuildLog=%__LogsDir%\MScorlib_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
@@ -202,11 +211,12 @@ goto :eof
:Usage
echo.
echo Usage:
-echo %0 BuildArch BuildType [clean] where:
+echo %0 BuildArch BuildType [clean] [vsversion] where:
echo.
echo BuildArch can be: x64
echo BuildType can be: Debug, Release
echo Clean - optional argument to force a clean build.
+echo VSVersion - optional argument to use VS2013 or VS2015 (default VS2013)
echo linuxmscorlib - Build mscorlib for Linux
echo osxmscorlib - Build mscorlib for OS X
exit /b 1