diff options
author | RJ Ryan <rryan@mixxx.org> | 2017-01-17 00:56:11 -0800 |
---|---|---|
committer | RJ Ryan <rryan@mixxx.org> | 2017-01-18 21:10:08 -0800 |
commit | c5b373f664f43eb37ec95391d68c7fb1874424d5 (patch) | |
tree | c5645fd37d3687dbf9293224d171ed232181f3a5 /build/appveyor | |
parent | cf77eb7d67bfd75460721c94f3d537235689d7d3 (diff) |
Build Mixxx on Appveyor with Visual Studio 2015.
Uses an x86 and x64 environment built from https://github.com/mixxxdj/buildserver/commit/3ddf42e4e06badf569b319981cae4a53559275a0 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.
Diffstat (limited to 'build/appveyor')
-rw-r--r-- | build/appveyor/build_mixxx.bat | 172 | ||||
-rw-r--r-- | build/appveyor/install_buildenv.bat | 10 |
2 files changed, 135 insertions, 47 deletions
diff --git a/build/appveyor/build_mixxx.bat b/build/appveyor/build_mixxx.bat index e916383c6f..6922f29357 100644 --- a/build/appveyor/build_mixxx.bat +++ b/build/appveyor/build_mixxx.bat @@ -1,61 +1,149 @@ -@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- -REM set multiprocessor to build faster (together with scons -j4) -set CL=/MP /FS /EHsc +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=0 machine=%MACHINE_TYPE% qtdir=%QTDIR% hss1394=1 mediafoundation=1 opus=1 localecompare=1 optimize=fastbuild virtualize=0 test=1 qt_sqlite_plugin=0 mssdk_dir="%MSSDK_DIR%" build_number_in_title_bar=0 bundle_pdbs=1 -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 +IF ERRORLEVEL 1 ( +echo ============================== +echo. +echo Building Mixxx failed. +echo. +REM For debugging, print the configuration log. +echo Printing config.log: +type config.log +ENDLOCAL +exit /b 1 +) else ( +echo Mixxx built successfully +ENDLOCAL +) diff --git a/build/appveyor/install_buildenv.bat b/build/appveyor/install_buildenv.bat index e4ed2c4bf7..c1df2b8426 100644 --- a/build/appveyor/install_buildenv.bat +++ b/build/appveyor/install_buildenv.bat @@ -1,12 +1,12 @@ -REM @ECHO OFF +@ECHO OFF SET BUILDENVBASEDIR=C:\MIXXX-BUILDSERVER -REM Build envs to install. You can specify more than one separated by spaces (no quotes) -SET BUILDENVS=2.0-%1-%2-minimal - REM precompiled compressed build env base URL -SET BASEURL=https://downloads.mixxx.org/builds/appveyor/environments/2.0 +SET BASEURL=%1 + +REM Build envs to install. You can specify more than one separated by spaces (no quotes) +SET BUILDENVS=%2 REM --------------------------- |