Skip to content

Instantly share code, notes, and snippets.

@nerrons
Created January 16, 2019 15:20
Show Gist options
  • Save nerrons/d3321c55fea136f550c7ed8514e0d8b3 to your computer and use it in GitHub Desktop.
Save nerrons/d3321c55fea136f550c7ed8514e0d8b3 to your computer and use it in GitHub Desktop.
build.bat for windows
@echo off
SETLOCAL
REM Clean up after old builds.
del /q /f *.exe
rmdir /s /q dist32
rmdir /s /q dist64
REM this can be either release or debug. For development you want to use debug
set BUILD_TYPE=debug
REM This determines if you build a 32bit or 64bit version of mixxx.
REM 32bit = i386, 64bit = amd64
set ARCHITECTURE=amd64
REM set this to the folder where you built the dependencies
set WINLIB_PATH=D:\mixxx-stuff\winlib64-23-fast
SET BIN_DIR=%WINLIB_PATH%\bin
REM make sure the Qt version matches the version in WINLIB_PATH.
set QT_VERSION=5.12.0
SET QTDIR=%WINLIB_PATH%\Qt-%QT_VERSION%
if "%ARCHITECTURE%" == "i386" (
set TARGET_MACHINE=x86
set VCVARS_ARCH=x86
) else (
set TARGET_MACHINE=amd64
set VCVARS_ARCH=x86_amd64
)
REM Adjust to your environment
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\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.
set CL=/MP /FS /EHsc
set PATH=%BIN_DIR%;%PATH%
REM Set the -j value to the number of CPU cores (not HT "virtual" cores but physical cores) you have
scons -j8 toolchain=msvs winlib=%WINLIB_PATH% build=%BUILD_TYPE% staticlibs=1 staticqt=1 verbose=0 machine=%TARGET_MACHINE% qtdir=%QTDIR% hss1394=1 mediafoundation=1 opus=1 localecompare=1 optimize=portable virtualize=0 test=1 qt_sqlite_plugin=0 build_number_in_title_bar=0 bundle_pdbs=1
ENDLOCAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment