Skip to content

Commit

Permalink
[WIN32] adapt BuildSetup.bat to build XBMC with vs2013
Browse files Browse the repository at this point in the history
  • Loading branch information
wsoltys committed May 27, 2014
1 parent db712dd commit b9553a4
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 31 deletions.
41 changes: 11 additions & 30 deletions project/Win32BuildSetup/BuildSetup.bat
Expand Up @@ -19,7 +19,6 @@ rem Config
rem If you get an error that Visual studio was not found, SET your path for VSNET main executable.
rem -------------------------------------------------------------
rem CONFIG START
SET comp=vs2010
SET target=dx
SET buildmode=ask
SET promptlevel=prompt
Expand All @@ -28,7 +27,6 @@ SET exitcode=0
SET useshell=rxvt
SET BRANCH=na
FOR %%b in (%1, %2, %3, %4, %5) DO (
IF %%b==vs2010 SET comp=vs2010
IF %%b==dx SET target=dx
IF %%b==gl SET target=gl
IF %%b==clean SET buildmode=clean
Expand All @@ -39,39 +37,22 @@ FOR %%b in (%1, %2, %3, %4, %5) DO (
)

SET buildconfig=Release (DirectX)
IF %target%==gl SET buildconfig=Release (OpenGL)
set WORKSPACE=%CD%\..\..

IF %comp%==vs2010 (
REM look for MSBuild.exe in .NET Framework 4.x
FOR /F "tokens=3* delims= " %%A IN ('REG QUERY HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0 /v MSBuildToolsPath') DO SET NET=%%AMSBuild.exe
IF NOT EXIST "!NET!" (
FOR /F "tokens=3* delims= " %%A IN ('REG QUERY HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0 /v MSBuildToolsPath') DO SET NET=%%AMSBuild.exe
)

IF EXIST "!NET!" (
set msbuildemitsolution=1
set OPTS_EXE="..\VS2010Express\XBMC for Windows.sln" /t:Build /p:Configuration="%buildconfig%"
set CLEAN_EXE="..\VS2010Express\XBMC for Windows.sln" /t:Clean /p:Configuration="%buildconfig%"
) ELSE (
IF EXIST "%VS100COMNTOOLS%\..\IDE\devenv.com" (
set NET="%VS100COMNTOOLS%\..\IDE\devenv.com"
) ELSE IF EXIST "%VS100COMNTOOLS%\..\IDE\devenv.exe" (
set NET="%VS100COMNTOOLS%\..\IDE\devenv.exe"
) ELSE IF "%VS100COMNTOOLS%"=="" (
set NET="%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe"
) ELSE IF EXIST "%VS100COMNTOOLS%\..\IDE\VCExpress.exe" (
set NET="%VS100COMNTOOLS%\..\IDE\VCExpress.exe"
)
REM look for MSBuild.exe delivered with Visual Studio 2013
FOR /F "tokens=2,* delims= " %%A IN ('REG QUERY HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0 /v MSBuildToolsRoot') DO SET MSBUILDROOT=%%B
SET NET="%MSBUILDROOT%12.0\bin\MSBuild.exe"

set OPTS_EXE="..\VS2010Express\XBMC for Windows.sln" /build "%buildconfig%"
set CLEAN_EXE="..\VS2010Express\XBMC for Windows.sln" /clean "%buildconfig%"
)
)
IF EXIST "!NET!" (
set msbuildemitsolution=1
set OPTS_EXE="..\VS2010Express\XBMC for Windows.sln" /t:Build /p:Configuration="%buildconfig%" /property:VCTargetsPath="%MSBUILDROOT%Microsoft.Cpp\v4.0\V120"
set CLEAN_EXE="..\VS2010Express\XBMC for Windows.sln" /t:Clean /p:Configuration="%buildconfig%" /property:VCTargetsPath="%MSBUILDROOT%Microsoft.Cpp\v4.0\V120"
)

IF NOT EXIST %NET% (
set DIETEXT=Visual Studio .NET 2010 Express was not found.
goto DIE
set DIETEXT=MSBuild was not found.
goto DIE
)

set EXE= "..\VS2010Express\XBMC\%buildconfig%\XBMC.exe"
Expand Down Expand Up @@ -249,7 +230,7 @@ IF %comp%==vs2010 (
xcopy ..\..\sounds BUILD_WIN32\Xbmc\sounds /E /Q /I /Y /EXCLUDE:exclude.txt > NUL

ECHO ------------------------------------------------------------
call buildpvraddons.bat %NET%
call buildpvraddons.bat
IF %errorlevel%==1 (
set DIETEXT="failed to build pvr addons"
goto DIE
Expand Down
29 changes: 28 additions & 1 deletion project/Win32BuildSetup/buildpvraddons.bat
Expand Up @@ -15,8 +15,34 @@ SET GIT_URL=git://github.com/opdenkamp/%LIBNAME%.git
SET SOURCE_DIR=%TMP_DIR%\%SOURCE%
SET BUILT_ADDONS_DIR=%SOURCE_DIR%\addons

rem ***********************************************************************
rem workaround to use vs2010 for pvr addons until they are switch to vs2013
REM look for MSBuild.exe in .NET Framework 4.x
FOR /F "tokens=3* delims= " %%A IN ('REG QUERY HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0 /v MSBuildToolsPath') DO SET OLDNET=%%AMSBuild.exe
IF NOT EXIST "!OLDNET!" (
FOR /F "tokens=3* delims= " %%A IN ('REG QUERY HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0 /v MSBuildToolsPath') DO SET OLDNET=%%AMSBuild.exe
)

IF EXIST "!OLDNET!" (
set msbuildemitsolution=1
set OPTS_EXE="..\VS2010Express\XBMC for Windows.sln" /t:Build /p:Configuration="%buildconfig%"
set CLEAN_EXE="..\VS2010Express\XBMC for Windows.sln" /t:Clean /p:Configuration="%buildconfig%"
) ELSE (
IF EXIST "%VS100COMNTOOLS%\..\IDE\devenv.com" (
set OLDNET="%VS100COMNTOOLS%\..\IDE\devenv.com"
) ELSE IF EXIST "%VS100COMNTOOLS%\..\IDE\devenv.exe" (
set OLDNET="%VS100COMNTOOLS%\..\IDE\devenv.exe"
) ELSE IF "%VS100COMNTOOLS%"=="" (
set OLDNET="%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe"
) ELSE IF EXIST "%VS100COMNTOOLS%\..\IDE\VCExpress.exe" (
set OLDNET="%VS100COMNTOOLS%\..\IDE\VCExpress.exe"
)
)
rem *************************************************************************

REM check if MSBuild.exe is used because it requires different command line switches
IF "%msbuildemitsolution%" == "1" (
rem set OPTS_EXE=%SOURCE_DIR%\project\VS2010Express\xbmc-pvr-addons.sln /t:Build /p:Configuration="Release" /property:VCTargetsPath="%MSBUILDROOT%Microsoft.Cpp\v4.0\V120"
set OPTS_EXE=%SOURCE_DIR%\project\VS2010Express\xbmc-pvr-addons.sln /t:Build /p:Configuration="Release"
) ELSE (
set OPTS_EXE=%SOURCE_DIR%\project\VS2010Express\xbmc-pvr-addons.sln /build Release
Expand Down Expand Up @@ -62,7 +88,8 @@ CD "%CUR_DIR%"

REM build xbmc-pvr-addons.sln
ECHO Building PVR addons
%1 %OPTS_EXE%
rem "%MSBUILDROOT%12.0\bin\MSBuild.exe" %OPTS_EXE%
%OLDNET% %OPTS_EXE%

IF %errorlevel%==1 (
goto fail
Expand Down

0 comments on commit b9553a4

Please sign in to comment.