Skip to content

Commit

Permalink
Build Mixxx on Appveyor with Visual Studio 2015.
Browse files Browse the repository at this point in the history
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
rryan committed Jan 17, 2017
1 parent 868f19f commit cde14d2
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 53 deletions.
11 changes: 2 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
version: '{branch}-{build}'
skip_tags: true
max_jobs: 1
image: Visual Studio 2013
image: Visual Studio 2015
init:
- git config --global core.autocrlf input
# Uncomment the following line to show RDP info at beginning of job
Expand Down Expand Up @@ -32,20 +32,13 @@ cache:
- C:\mixxx-buildserver
install:
- cd %TEMP%
- echo *** Downloading and installing scons
# SF.net download currently broken from EC2 to some mirrors, so hosting scons myself
# - curl -fsS -L -o scons-2.5.1.zip http://prdownloads.sourceforge.net/scons/scons-2.5.1.zip
- curl -fsS -L -o scons-2.5.1.zip https://downloads.mixxx.org/builds/appveyor/environments/2.0/scons-2.5.1.zip
- 7z x scons-2.5.1.zip
- cd scons-2.5.1
- python setup.py install
- echo *** Downloading precompiled build environment if not in build-cache
- cd %APPVEYOR_BUILD_FOLDER%
- build\appveyor\install_buildenv.bat %platform% %configuration%
before_build:
- cd %APPVEYOR_BUILD_FOLDER%
build_script:
- build\appveyor\build_mixxx.bat %platform% %configuration%
- build\appveyor\build_mixxx.bat %platform% %configuration% c:\mixxx-buildserver\2.1-%platform%-%configuration%-static-20170117-3ddf42e4e06badf569b319981cae4a53559275a0
test_script:
- echo *** Testing
# Calling mixxx-test under bash to have standard output
Expand Down
173 changes: 131 additions & 42 deletions build/appveyor/build_mixxx.bat
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
)
5 changes: 3 additions & 2 deletions build/appveyor/install_buildenv.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ REM @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
SET BUILDENVS=2.1-%1-%2-static-20170117-3ddf42e4e06badf569b319981cae4a53559275a0

REM precompiled compressed build env base URL
SET BASEURL=https://downloads.mixxx.org/builds/appveyor/environments/2.0
SET BASEURL=https://downloads.mixxx.org/builds/appveyor/environments/2.1

REM ---------------------------

Expand Down Expand Up @@ -36,6 +36,7 @@ CD %BUILDENVBASEDIR%
echo ..Downloading %1.zip
curl -fsS -L -o %1.zip %BASEURL%/%1.zip
echo ..unzipping %1.zip
7z l %1.zip
7z x %1.zip
DEL %1.zip
GOTO ENDFUNC
Expand Down

0 comments on commit cde14d2

Please sign in to comment.