-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build Mixxx on Appveyor with Visual Studio 2015.
Uses an x86 and x64 environment built from mixxxdj/buildserver@3ddf42e which is a combination of work by @Pegasus-RPG, @JosepMaJAZ, @sblaisot and myself. All dependencies are linked statically. SCons is now present in the bin directory of the environment, so we don't need to install it anymore.
- Loading branch information
Showing
3 changed files
with
136 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,150 @@ | ||
@echo off | ||
@echo on | ||
SETLOCAL | ||
|
||
REM set this to the folder where you build the dependencies | ||
set WINLIB_PATH64D=C:\mixxx-buildserver\2.0-x64-debug-minimal | ||
set WINLIB_PATH64R=C:\mixxx-buildserver\2.0-x64-release-minimal | ||
set WINLIB_PATH32D=C:\mixxx-buildserver\2.0-x86-debug-minimal | ||
set WINLIB_PATH32R=C:\mixxx-buildserver\2.0-x86-release-minimal | ||
REM ================================== | ||
REM Path setup and initial checks | ||
REM ================================== | ||
|
||
IF "%ProgramW6432%" =="" ( | ||
SET PROGRAMFILES_PATH=%ProgramFiles% | ||
) else ( | ||
REM doublequote the whole SET command prevents an error with parentheses | ||
SET "PROGRAMFILES_PATH=%ProgramFiles(x86)%" | ||
) | ||
|
||
rem ====== Edit to suit your environment ========= | ||
SET VCVERSION=140 | ||
SET "MSVC_PATH=%PROGRAMFILES_PATH%\Microsoft Visual Studio 14.0\VC" | ||
SET "BUILDTOOLS_PATH=%PROGRAMFILES_PATH%\Microsoft Visual C++ Build Tools" | ||
set "MSSDK_DIR=%PROGRAMFILES_PATH%\Microsoft SDKs\Windows\v7.1A" | ||
|
||
REM XP Compatibility requires the v7.1A SDK | ||
set MSSDK_DIR="c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A" | ||
set "MSSDK_DIR=%PROGRAMFILES_PATH%\Microsoft SDKs\Windows\v7.1A" | ||
|
||
if NOT EXIST "%MSSDK_DIR%" ( | ||
echo. | ||
echo Could not find "%MSSDK_DIR%". | ||
echo Edit the build_mixxx.bat file and/or install the required software | ||
echo https://www.microsoft.com/en-us/download/details.aspx?id=8279 | ||
exit /b 1 | ||
) | ||
|
||
IF EXIST "%MSVC_PATH%" ( | ||
SET "BUILDTOOLS_PATH=%MSVC_PATH%" | ||
SET BUILDTOOLS_SCRIPT=vcvarsall.bat | ||
|
||
REM Check whether we have a 64-bit compiler available. | ||
IF EXIST "%MSVC_PATH%\VC\bin\amd64\cl.exe" ( | ||
SET COMPILER_X86=amd64_x86 | ||
SET COMPILER_X64=amd64 | ||
) ELSE ( | ||
SET COMPILER_X86=x86 | ||
SET COMPILER_X64=x86_amd64 | ||
) | ||
|
||
) ELSE ( | ||
IF EXIST "%BUILDTOOLS_PATH%" ( | ||
SET BUILDTOOLS_SCRIPT=vcbuildtools.bat | ||
|
||
SET COMPILER_X86=amd64_x86 | ||
SET COMPILER_X64=amd64 | ||
) ELSE ( | ||
echo. | ||
echo Could not find "%MSVC_PATH%" nor "%BUILDTOOLS_PATH%". | ||
echo Edit the build_environment.bat file and/or install the required software | ||
echo http://landinghub.visualstudio.com/visual-cpp-build-tools | ||
echo https://www.microsoft.com/en-us/download/details.aspx?id=8279 | ||
exit /b 1 | ||
) | ||
REM END EXIST BUILDTOOLS | ||
) | ||
REM END EXIST VISUALSTUDIO | ||
|
||
IF "%2"=="" ( | ||
echo "Usage: build_mixxx.bat <bitwidth> <buildtype>" | ||
REM ================================== | ||
REM Parameter reading and variable setup | ||
REM ================================== | ||
REM ^ is the escape character. | ||
if "%3" == "" ( | ||
echo Missing parameters. Usage: ^(Note: keep same case and order^) | ||
echo. | ||
echo build_mixxx.bat x64^|x86 debug^|release ^<winlib-path^> | ||
echo. | ||
echo Example: build_mixxx.bat x64 release c:\mixxx\environments\msvc15-static-x86-release | ||
exit /b 1 | ||
) | ||
|
||
set MACHINE_X86="%1" == "x86" | ||
set CONFIG_RELEASE="%2" == "release" | ||
set WINLIB_DIR=%3 | ||
|
||
SET BIN_DIR=%WINLIB_DIR%\bin | ||
SET LIB_DIR=%WINLIB_DIR%\lib | ||
SET INCLUDE_DIR=%WINLIB_DIR%\include | ||
set QT_VERSION=4.8.7 | ||
SET QTDIR=%WINLIB_DIR%\Qt-%QT_VERSION% | ||
|
||
if NOT EXIST "%BIN_DIR%\scons.py" ( | ||
echo. | ||
echo "For example : .\build.bat x64 release" | ||
exit /B 1 | ||
echo You need to obtain and copy SCons to the folder: | ||
echo %BIN_DIR% | ||
exit /b 1 | ||
) | ||
|
||
set ARCHITECTURE=%1 | ||
set BUILD_TYPE=%2 | ||
if NOT EXIST "%QTDIR%" ( | ||
echo. | ||
echo Could not find Qt %QT_VERSION% at "%QT_DIR%". | ||
exit /b 1 | ||
) | ||
|
||
if "%ARCHITECTURE%" == "x86" set res32=T | ||
if "%ARCHITECTURE%" == "x32" set res32=T | ||
REM Everyting prepared. Setup the compiler. | ||
if %MACHINE_X86% ( | ||
call "%BUILDTOOLS_PATH%\%BUILDTOOLS_SCRIPT%" %COMPILER_X86% | ||
) else ( | ||
call "%BUILDTOOLS_PATH%\%BUILDTOOLS_SCRIPT%" %COMPILER_X64% | ||
) | ||
|
||
REM Now build Mixxx. | ||
|
||
if "%res32%" == "T" ( | ||
set TARGET_MACHINE=x86 | ||
set VCVARS_ARCH=x86 | ||
set DISTDIR=dist32 | ||
if "%BUILD_TYPE%" == "release" ( | ||
set WINLIB_PATH=%WINLIB_PATH32R% | ||
) else ( | ||
set WINLIB_PATH=%WINLIB_PATH32D% | ||
) | ||
echo "****************************" | ||
echo "** Building 32 bits Mixxx **" | ||
echo "****************************" | ||
if %CONFIG_RELEASE% ( | ||
set BUILD_TYPE=release | ||
) else ( | ||
set TARGET_MACHINE=amd64 | ||
set VCVARS_ARCH=x86_amd64 | ||
set DISTDIR=dist64 | ||
if "%BUILD_TYPE%" == "release" ( | ||
set WINLIB_PATH=%WINLIB_PATH64R% | ||
) else ( | ||
set WINLIB_PATH=%WINLIB_PATH64D% | ||
) | ||
echo "****************************" | ||
echo "** Building 64 bits Mixxx **" | ||
echo "****************************" | ||
set BUILD_TYPE=debug | ||
) | ||
|
||
if %MACHINE_X86% ( | ||
set MACHINE_TYPE=x86 | ||
set DISTDIR=dist32 | ||
) else ( | ||
set MACHINE_TYPE=x86_64 | ||
set DISTDIR=dist64 | ||
) | ||
|
||
REM Clean up after old builds. | ||
REM del /q /f *.exe *.msi 2>NUL | ||
REM rmdir /s /q %DISTDIR% | ||
|
||
call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %VCVARS_ARCH% | ||
rem /MP Use all CPU cores. | ||
rem /FS force synchronous PDB writes (prevents PDB corruption with /MP) | ||
rem /EHsc Do not handle SEH in try / except blocks. | ||
rem /Zc:threadSafeInit- disable C++11 magic static support (Bug #1653368) | ||
set CXXFLAGS=/MP /FS /EHsc /Zc:threadSafeInit- | ||
set CFLAGS=/MP /FS /EHsc /Zc:threadSafeInit- | ||
|
||
set OLDPATH=%PATH% | ||
set PATH=%BIN_DIR%;%PATH% | ||
scons.py mixxx makerelease toolchain=msvs winlib=%WINLIB_DIR% build=%BUILD_TYPE% staticlibs=1 staticqt=1 debug_assertions_fatal=1 verbose=1 machine=%MACHINE_TYPE% qtdir=%QTDIR% hss1394=1 mediafoundation=1 opus=1 localecompare=1 optimize=portable virtualize=0 test=1 qt_sqlite_plugin=0 mssdk_dir="%MSSDK_DIR%" build_number_in_title_bar=0 bundle_pdbs=1 | ||
set PATH=%OLDPATH% | ||
|
||
REM set multiprocessor to build faster (together with scons -j4) | ||
set CL=/MP /FS /EHsc | ||
REM For debugging, print the configuration log. | ||
type config.log | ||
|
||
scons mixxx makerelease verbose=0 winlib=%WINLIB_PATH% qtdir=%WINLIB_PATH%\build\qt-everywhere-opensource-src-4.8.6 hss1394=1 mediafoundation=1 opus=1 localecompare=1 optimize=portable build=%BUILD_TYPE% machine=%TARGET_MACHINE% toolchain=msvs virtualize=0 test=1 qt_sqlite_plugin=0 mssdk_dir=%MSSDK_DIR% build_number_in_title_bar=0 bundle_pdbs=1 | ||
echo ============================== | ||
echo. | ||
IF ERRORLEVEL 1 ( | ||
echo Building Mixxx failed. | ||
ENDLOCAL | ||
exit /b 1 | ||
) else ( | ||
echo Mixxx built successfully | ||
ENDLOCAL | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters