From 512ff2fc4c30b9f9ca4f55abebcc5d040a8e3af0 Mon Sep 17 00:00:00 2001 From: JosepMaJAZ Date: Sun, 12 Apr 2020 23:25:47 +0200 Subject: [PATCH 1/7] Build environment cleanup: - Updated gitignore with current versions and several other corrections - Update lame target platform from v120 to v141 to ensure compilation. - removed the now unused build_qt4.bat and another mention of QT4 on create_environment.bat --- .gitignore | 58 ++++++++------ .../vc_solution/vc9_lame_lame.vcxproj | 18 ++--- .../vc_solution/vc9_lame_mp3rtp.vcxproj | 18 ++--- .../vc_solution/vc9_lame_mp3x.vcxproj | 18 ++--- .../vc_solution/vc9_libmp3lame.vcxproj | 18 ++--- .../vc_solution/vc9_libmp3lame_dll.vcxproj | 18 ++--- .../vc_solution/vc9_mpglib.vcxproj | 18 ++--- build_qt4.bat | 80 ------------------- create_environment.bat | 14 ++-- 9 files changed, 96 insertions(+), 164 deletions(-) delete mode 100644 build_qt4.bat diff --git a/.gitignore b/.gitignore index cc3165c53..d69ef05e1 100644 --- a/.gitignore +++ b/.gitignore @@ -22,8 +22,10 @@ ipch/ *.bak # Root bin, include and lib folders -/x64/ -/Win32/ +/include/ +/lib/ +/Qt-5.*/ +/mkspecs/ # Per-project build folders /build/**/vc14/x86/ @@ -33,19 +35,21 @@ ipch/ /build/**/protobuf-2.6.1/vsprojects/include/ /build/**/protobuf-2.6.1/vsprojects/x64/ /build/**/protobuf-2.6.1/vsprojects/Win32/ -/build/**/CMakeFiles/ -CMakeCache.txt -cmake_install.cmake -cmake_uninstall.cmake +/build/lame-3.99.5/obj/ +/build/lame-3.99.5/output/ +/build/openssl-1.0.2h/MINFO +/build/openssl-1.0.2h/Makefile /build/openssl-1.0.2h/tmp*/ /build/openssl-1.0.2h/out*/ /build/openssl-1.0.2h/inc*/ +/build/openssl-1.0.2h/ms/uptable.asm +/build/openssl-1.0.2h/ms/version32.rc /build/openssl-1.0.2h/ms/libeay32.def /build/openssl-1.0.2h/ms/nt.mak /build/openssl-1.0.2h/ms/ntdll.mak /build/openssl-1.0.2h/ms/ssleay32.def -/build/openssl-1.0.2h/opensslconf.h -/build/openssl-1.0.2h/buildinf.h +/build/openssl-1.0.2h/crypto/opensslconf.h +/build/openssl-1.0.2h/crypto/buildinf.h /build/**/x64/Release/ /build/**/x64/Debug/ /build/**/Win32/Release/ @@ -54,24 +58,32 @@ cmake_uninstall.cmake /build/**/x86/Debug/ /build/**/Debug_dynamic/ /build/**/Release_dynamic/ -qt4fix.rej.txt +/build/libshout-2.4.1/**/*.rej +/build/libsndfile-1.0.26/x64/ +/build/libsndfile-1.0.26/Win32/Release/ +/build/libsndfile-1.0.26/Win32/Debug/ +/build/libsndfile-1.0.26/src/ALAC/x64 +/build/libsndfile-1.0.26/src/ALAC/Win32 +/build/libsndfile-1.0.26/src/G72x/x64 +/build/libsndfile-1.0.26/src/G72x/Win32 +/build/libsndfile-1.0.26/src/GSM610/x64 +/build/libsndfile-1.0.26/src/GSM610/Win32 + #CMake generated files -/build/taglib-1.10/x64/ -/build/taglib-1.10/Win32/ +/build/**/CMakeFiles/ +CMakeCache.txt +cmake_install.cmake +cmake_uninstall.cmake +/build/taglib-1.11.1/x64/ +/build/taglib-1.11.1/Win32/ /build/chromaprint-1.3.1/x64/ /build/chromaprint-1.3.1/Win32/ +/build/qtkeychain-0.9.1/x64/ +/build/qtkeychain-0.9.1/Win32/ # Exclude external packages that have to be obtained from other sources /build/qt-everywhere-opensource-src-4.8.7/ -/build/pa_stable_v19_20140130/src/hostapi/asio/ASIOSDK - -# Visual C++ cache files and other generic files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb \ No newline at end of file +/build/pa_stable_v190600_20161030/src/hostapi/asio/ASIOSDK +/build/QT5/ +/qt-everywhere-src-5.14.2.zip +/qt-everywhere-src-5.14.2.tar.xz diff --git a/build/lame-3.99.5/vc_solution/vc9_lame_lame.vcxproj b/build/lame-3.99.5/vc_solution/vc9_lame_lame.vcxproj index 15298f73a..8ae905ce1 100644 --- a/build/lame-3.99.5/vc_solution/vc9_lame_lame.vcxproj +++ b/build/lame-3.99.5/vc_solution/vc9_lame_lame.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -42,42 +42,42 @@ Application - v120 + v141 false Application - v120 + v141 false Application - v120 + v141 false Application - v120 + v141 false Application - v120 + v141 false Application - v120 + v141 false Application - v120 + v141 false Application - v120 + v141 false diff --git a/build/lame-3.99.5/vc_solution/vc9_lame_mp3rtp.vcxproj b/build/lame-3.99.5/vc_solution/vc9_lame_mp3rtp.vcxproj index 225965234..326af5925 100644 --- a/build/lame-3.99.5/vc_solution/vc9_lame_mp3rtp.vcxproj +++ b/build/lame-3.99.5/vc_solution/vc9_lame_mp3rtp.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -42,42 +42,42 @@ Application - v120 + v141 false Application - v120 + v141 false Application - v120 + v141 false Application - v120 + v141 false Application - v120 + v141 false Application - v120 + v141 false Application - v120 + v141 false Application - v120 + v141 false diff --git a/build/lame-3.99.5/vc_solution/vc9_lame_mp3x.vcxproj b/build/lame-3.99.5/vc_solution/vc9_lame_mp3x.vcxproj index 7cc5d3527..85343fc56 100644 --- a/build/lame-3.99.5/vc_solution/vc9_lame_mp3x.vcxproj +++ b/build/lame-3.99.5/vc_solution/vc9_lame_mp3x.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -42,49 +42,49 @@ Application - v120 + v141 false MultiByte Application - v120 + v141 false MultiByte Application - v120 + v141 false MultiByte Application - v120 + v141 false MultiByte Application - v120 + v141 false MultiByte Application - v120 + v141 false MultiByte Application - v120 + v141 false MultiByte Application - v120 + v141 false MultiByte diff --git a/build/lame-3.99.5/vc_solution/vc9_libmp3lame.vcxproj b/build/lame-3.99.5/vc_solution/vc9_libmp3lame.vcxproj index 9e1dddf66..4c23c876e 100644 --- a/build/lame-3.99.5/vc_solution/vc9_libmp3lame.vcxproj +++ b/build/lame-3.99.5/vc_solution/vc9_libmp3lame.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -42,42 +42,42 @@ StaticLibrary - v120_xp + v141 false StaticLibrary - v120_xp + v141 false StaticLibrary - v120_xp + v141 false StaticLibrary - v120_xp + v141 false StaticLibrary - v120_xp + v141 false StaticLibrary - v120_xp + v141 false StaticLibrary - v120_xp + v141 false StaticLibrary - v120_xp + v141 false diff --git a/build/lame-3.99.5/vc_solution/vc9_libmp3lame_dll.vcxproj b/build/lame-3.99.5/vc_solution/vc9_libmp3lame_dll.vcxproj index 90d57fc36..51c6a2d85 100644 --- a/build/lame-3.99.5/vc_solution/vc9_libmp3lame_dll.vcxproj +++ b/build/lame-3.99.5/vc_solution/vc9_libmp3lame_dll.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -42,42 +42,42 @@ DynamicLibrary - v120_xp + v141 false DynamicLibrary - v120_xp + v141 false DynamicLibrary - v120_xp + v141 false DynamicLibrary - v120_xp + v141 false DynamicLibrary - v120_xp + v141 false DynamicLibrary - v120_xp + v141 false DynamicLibrary - v120_xp + v141 false DynamicLibrary - v120_xp + v141 false diff --git a/build/lame-3.99.5/vc_solution/vc9_mpglib.vcxproj b/build/lame-3.99.5/vc_solution/vc9_mpglib.vcxproj index ae287d3da..268e385e7 100644 --- a/build/lame-3.99.5/vc_solution/vc9_mpglib.vcxproj +++ b/build/lame-3.99.5/vc_solution/vc9_mpglib.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -42,42 +42,42 @@ StaticLibrary - v120_xp + v141 false StaticLibrary - v120_xp + v141 false StaticLibrary - v120_xp + v141 false StaticLibrary - v120_xp + v141 false StaticLibrary - v120_xp + v141 false StaticLibrary - v120_xp + v141 false StaticLibrary - v120_xp + v141 false StaticLibrary - v120_xp + v141 false diff --git a/build_qt4.bat b/build_qt4.bat deleted file mode 100644 index 81059b524..000000000 --- a/build_qt4.bat +++ /dev/null @@ -1,80 +0,0 @@ -SETLOCAL -echo. -echo ---- Building Qt4 ---- -SET QT4_PATH=qt-everywhere-opensource-src-4.8.7 -SET VALRETURN=0 - -if %MACHINE_X86% ( - set PLATFORM=Win32 -) else ( - set PLATFORM=x64 -) - -if %CONFIG_RELEASE% ( - set CONFIG=-release -) else ( - set CONFIG=-debug -) - -cd build\%QT4_PATH% -IF ERRORLEVEL 1 ( -echo could not find QT4 on %CD%\build\%QT4_PATH% - SET VALRETURN=1 - goto END -) - -REM Needed so stuff (like uic.exe) can find our zlibwapi.dll at run time -set PATH=%PATH%;%LIB_DIR% - -REM patch Qt 4.8.7 to build on MSVC 2015. -%BIN_DIR%\patch.exe -N -p1 --verbose -i %CD%\..\qt-4.8.7-win.patch -r %CD%\..\qt4fix.rej.txt -REM ERRORLEVEL 2 since it will report errorlevel 1 when already applied -IF ERRORLEVEL 2 ( - SET VALRETURN=1 - goto END -) - -REM nmake distclean or nmake confclean are not present in the Makefile, so we delete these files and hope it rebuilds. -del .qmake.cache -del config.log -del /S /Q mkspecs/modules/*.pri \ -del /S /Q mkspecs/modules-inst/*.pri - -echo Building... -REM We link against the system SQLite so that Mixxx can link with and use the -REM same instance of the SQLite library in our binary (for example, so we -REM can install custom functions). -REM NOTE(rryan): By setting -system-sqlite, -system-zlib is set as well. -set QT_COMMON=-opensource -confirm-license -platform win32-msvc2015 -mp -system-sqlite -qt-sql-sqlite -system-zlib -ltcg -fast -D _USING_V110_SDK71_ -D SQLITE_ENABLE_FTS3 -D SQLITE_ENABLE_FTS3_PARENTHESIS -D ZLIB_WINAPI -no-phonon -no-phonon-backend -no-multimedia -no-qt3support -no-dsp -no-vcproj -no-webkit -nomake demos -nomake examples -nomake tests - -if %STATIC_LIBS% ( -configure.exe %CONFIG% %QT_COMMON% -static -openssl-linked OPENSSL_LIBS="-luser32 -ladvapi32 -lgdi32 -lcrypt32 -lssleay32 -llibeay32" -) else ( -configure.exe %CONFIG% %QT_COMMON% -shared -openssl -) -IF ERRORLEVEL 1 ( - SET VALRETURN=1 - goto END -) - -rem /K keeps building things not affected by errors -nmake /nologo -IF ERRORLEVEL 1 ( - SET VALRETURN=1 - goto END -) - -rem Note, we do not run nmake clean because it deletes files we need (e.g. compiled translations). - -REM Don't copy binaries or DLLs or includes since we refer to them from QTDIR and the include files refer to the Qt source tree. -REM %XCOPY% bin\*.exe %BIN_DIR% -REM %XCOPY% lib\*.dll %LIB_DIR% -REM %XCOPY% lib\*.lib %LIB_DIR% -REM %XCOPY% include\* %INCLUDE_DIR% - -:END -cd %ROOT_DIR% -REM the GOTO command resets the errorlevel and the endlocal resets the local environment, -REM so I have to use this workaround -ENDLOCAL & SET VALRETURN=%VALRETURN% -exit /b %VALRETURN% \ No newline at end of file diff --git a/create_environment.bat b/create_environment.bat index 31d8b5968..5d5ba0420 100644 --- a/create_environment.bat +++ b/create_environment.bat @@ -72,16 +72,16 @@ ENDLOCAL exit /b 1 ) -echo Copying Qt4 +REM echo Copying Qt4 REM Note that using xcopy to copy Qt can run into "Insufficient memory" errors REM due to path lengths growing larger than 254 characters. -%ROBOCOPY% qt-everywhere-opensource-src-4.8.7 "%ENVIRONMENT_PATH%\build\qt-everywhere-opensource-src-4.8.7" +REM %ROBOCOPY% qt-everywhere-opensource-src-4.8.7 "%ENVIRONMENT_PATH%\build\qt-everywhere-opensource-src-4.8.7" REM robocopy errorlevel 1 means files were copied. -IF ERRORLEVEL 2 ( -echo Copying Qt 4.8.7 failed. -ENDLOCAL -exit /b 1 -) +REM IF ERRORLEVEL 2 ( +REM echo Copying Qt 4.8.7 failed. +REM ENDLOCAL +REM exit /b 1 +REM ) echo Copying Qt5 REM Note that using xcopy to copy Qt can run into "Insufficient memory" errors From 2c92d732c8a2114d04784a13aebd858d1f10bda8 Mon Sep 17 00:00:00 2001 From: JosepMaJAZ Date: Sun, 12 Apr 2020 23:29:48 +0200 Subject: [PATCH 2/7] Build environment fixes: - libsndfile solution was compiled in release mode when asked for debug - openssl set an erroneous target for debug - do not try to copy the dll for projects that don't generate dlls (rubberband and libsndfile). --- build/libsndfile-1.0.26/libsndfile.sln | 16 ++++++++-------- build_libsndfile.bat | 3 ++- build_openssl.bat | 6 +++--- build_rubberband.bat | 3 ++- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/build/libsndfile-1.0.26/libsndfile.sln b/build/libsndfile-1.0.26/libsndfile.sln index 41bb061ce..92711e2bd 100644 --- a/build/libsndfile-1.0.26/libsndfile.sln +++ b/build/libsndfile-1.0.26/libsndfile.sln @@ -24,32 +24,32 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {D2CF083B-3A1A-492E-89D1-87EB84BD2CE6}.Static-Debug|Win32.ActiveCfg = Static-Debug|Win32 {D2CF083B-3A1A-492E-89D1-87EB84BD2CE6}.Static-Debug|Win32.Build.0 = Static-Debug|Win32 - {D2CF083B-3A1A-492E-89D1-87EB84BD2CE6}.Static-Debug|x64.ActiveCfg = Static-Release|x64 - {D2CF083B-3A1A-492E-89D1-87EB84BD2CE6}.Static-Debug|x64.Build.0 = Static-Release|x64 + {D2CF083B-3A1A-492E-89D1-87EB84BD2CE6}.Static-Debug|x64.ActiveCfg = Static-Debug|x64 + {D2CF083B-3A1A-492E-89D1-87EB84BD2CE6}.Static-Debug|x64.Build.0 = Static-Debug|x64 {D2CF083B-3A1A-492E-89D1-87EB84BD2CE6}.Static-Release|Win32.ActiveCfg = Static-Release|Win32 {D2CF083B-3A1A-492E-89D1-87EB84BD2CE6}.Static-Release|Win32.Build.0 = Static-Release|Win32 {D2CF083B-3A1A-492E-89D1-87EB84BD2CE6}.Static-Release|x64.ActiveCfg = Static-Release|x64 {D2CF083B-3A1A-492E-89D1-87EB84BD2CE6}.Static-Release|x64.Build.0 = Static-Release|x64 {074CC78C-C03A-453C-9E5B-4842639AEF33}.Static-Debug|Win32.ActiveCfg = Static-Debug|Win32 {074CC78C-C03A-453C-9E5B-4842639AEF33}.Static-Debug|Win32.Build.0 = Static-Debug|Win32 - {074CC78C-C03A-453C-9E5B-4842639AEF33}.Static-Debug|x64.ActiveCfg = Static-Release|x64 - {074CC78C-C03A-453C-9E5B-4842639AEF33}.Static-Debug|x64.Build.0 = Static-Release|x64 + {074CC78C-C03A-453C-9E5B-4842639AEF33}.Static-Debug|x64.ActiveCfg = Static-Debug|x64 + {074CC78C-C03A-453C-9E5B-4842639AEF33}.Static-Debug|x64.Build.0 = Static-Debug|x64 {074CC78C-C03A-453C-9E5B-4842639AEF33}.Static-Release|Win32.ActiveCfg = Static-Release|Win32 {074CC78C-C03A-453C-9E5B-4842639AEF33}.Static-Release|Win32.Build.0 = Static-Release|Win32 {074CC78C-C03A-453C-9E5B-4842639AEF33}.Static-Release|x64.ActiveCfg = Static-Release|x64 {074CC78C-C03A-453C-9E5B-4842639AEF33}.Static-Release|x64.Build.0 = Static-Release|x64 {D15B959A-92E6-4329-B9E1-14CFF1F13F59}.Static-Debug|Win32.ActiveCfg = Static-Debug|Win32 {D15B959A-92E6-4329-B9E1-14CFF1F13F59}.Static-Debug|Win32.Build.0 = Static-Debug|Win32 - {D15B959A-92E6-4329-B9E1-14CFF1F13F59}.Static-Debug|x64.ActiveCfg = Static-Release|x64 - {D15B959A-92E6-4329-B9E1-14CFF1F13F59}.Static-Debug|x64.Build.0 = Static-Release|x64 + {D15B959A-92E6-4329-B9E1-14CFF1F13F59}.Static-Debug|x64.ActiveCfg = Static-Debug|x64 + {D15B959A-92E6-4329-B9E1-14CFF1F13F59}.Static-Debug|x64.Build.0 = Static-Debug|x64 {D15B959A-92E6-4329-B9E1-14CFF1F13F59}.Static-Release|Win32.ActiveCfg = Static-Release|Win32 {D15B959A-92E6-4329-B9E1-14CFF1F13F59}.Static-Release|Win32.Build.0 = Static-Release|Win32 {D15B959A-92E6-4329-B9E1-14CFF1F13F59}.Static-Release|x64.ActiveCfg = Static-Release|x64 {D15B959A-92E6-4329-B9E1-14CFF1F13F59}.Static-Release|x64.Build.0 = Static-Release|x64 {9E03D88F-0366-4CD2-A5A6-398983FBF489}.Static-Debug|Win32.ActiveCfg = Static-Debug|Win32 {9E03D88F-0366-4CD2-A5A6-398983FBF489}.Static-Debug|Win32.Build.0 = Static-Debug|Win32 - {9E03D88F-0366-4CD2-A5A6-398983FBF489}.Static-Debug|x64.ActiveCfg = Static-Release|x64 - {9E03D88F-0366-4CD2-A5A6-398983FBF489}.Static-Debug|x64.Build.0 = Static-Release|x64 + {9E03D88F-0366-4CD2-A5A6-398983FBF489}.Static-Debug|x64.ActiveCfg = Static-Debug|x64 + {9E03D88F-0366-4CD2-A5A6-398983FBF489}.Static-Debug|x64.Build.0 = Static-Debug|x64 {9E03D88F-0366-4CD2-A5A6-398983FBF489}.Static-Release|Win32.ActiveCfg = Static-Release|Win32 {9E03D88F-0366-4CD2-A5A6-398983FBF489}.Static-Release|Win32.Build.0 = Static-Release|Win32 {9E03D88F-0366-4CD2-A5A6-398983FBF489}.Static-Release|x64.ActiveCfg = Static-Release|x64 diff --git a/build_libsndfile.bat b/build_libsndfile.bat index 1868961f5..26944587f 100644 --- a/build_libsndfile.bat +++ b/build_libsndfile.bat @@ -38,7 +38,8 @@ copy %PLATFORM%\%CONFIG%\g72x.lib %LIB_DIR% copy %LIB_OUTPUT_PATH%\libsndfile.lib %LIB_DIR% copy %PLATFORM%\%CONFIG%\libsndfile.pdb %LIB_DIR% -IF NOT %STATIC_LIBS% ( copy %PLATFORM%\%CONFIG%\libsndfile.dll %LIB_DIR% ) +REM Always building it statically. +REM IF NOT %STATIC_LIBS% ( copy %PLATFORM%\%CONFIG%\libsndfile.dll %LIB_DIR% ) copy src\sndfile.h %INCLUDE_DIR% diff --git a/build_openssl.bat b/build_openssl.bat index ffd5d04f0..1fc99ed9d 100644 --- a/build_openssl.bat +++ b/build_openssl.bat @@ -54,9 +54,9 @@ set OPENSSL_TARGETS=out32 if NOT %STATIC_LIBS% ( set OPENSSL_TARGETS=%OPENSSL_TARGETS%dll ) -if NOT %CONFIG_RELEASE% ( -set OPENSSL_TARGETS=%OPENSSL_TARGETS%.dbg -) +REM if NOT %CONFIG_RELEASE% ( +REM set OPENSSL_TARGETS=%OPENSSL_TARGETS%.dbg +REM ) copy /b %OPENSSL_TARGETS%\libeay32.lib %LIB_DIR% copy /b %OPENSSL_TARGETS%\ssleay32.lib %LIB_DIR% diff --git a/build_rubberband.bat b/build_rubberband.bat index b366e98a2..843b17b4b 100644 --- a/build_rubberband.bat +++ b/build_rubberband.bat @@ -34,7 +34,8 @@ IF ERRORLEVEL 1 ( copy %OUTPUT_PLATFORM%\%CONFIG%\rubberband.lib %LIB_DIR% copy %OUTPUT_PLATFORM%\%CONFIG%\rubberband.pdb %LIB_DIR% -if NOT %STATIC_LIBS% ( copy %OUTPUT_PLATFORM%\%CONFIG%\rubberband.dll %LIB_DIR% ) +REM Always building it statically +REM if NOT %STATIC_LIBS% ( copy %OUTPUT_PLATFORM%\%CONFIG%\rubberband.dll %LIB_DIR% ) md %INCLUDE_DIR%\rubberband copy rubberband\*.h %INCLUDE_DIR%\rubberband\ From c21b7077085dc215bdf227fd645c41fd3ccf3fc8 Mon Sep 17 00:00:00 2001 From: JosepMaJAZ Date: Sun, 12 Apr 2020 23:47:18 +0200 Subject: [PATCH 3/7] Build environment improvements: - Added the compiler detection code on build_environment that was added to mixxx/build/appveyor/build_mixxx.cmd - Added multithreaded compiler settings. - Fixed QT5 download check (was checking for the tar.xz but was downloading the zip). - Implemented one-step decompression of tar.xz. Note: This should not be executed on a windows powershell but plain command prompt. If it is problematic, we can revert to the .zip download. - Copying zlibwapi.dll to QT bin dir if building dynamically. --- build_environment.bat | 130 ++++++++++++++++++++++++++---------------- build_qt5.bat | 53 +++++++++-------- 2 files changed, 110 insertions(+), 73 deletions(-) diff --git a/build_environment.bat b/build_environment.bat index c4244023a..52aff5883 100644 --- a/build_environment.bat +++ b/build_environment.bat @@ -1,5 +1,5 @@ @echo off -SETLOCAL +SETLOCAL ENABLEDELAYEDEXPANSION REM ================================== REM Path setup and initial checks @@ -14,10 +14,8 @@ SET INCLUDE_DIR=%ROOT_DIR%\include\ SET BUILD_DIR=%CD%\build\ IF "%ProgramW6432%" =="" ( -SET OS_IS_64BIT=0==1 SET PROGRAMFILES_PATH=%ProgramFiles% ) else ( -SET OS_IS_64BIT=1==1 REM doublequote the whole SET command prevents an error with parentheses SET "PROGRAMFILES_PATH=%ProgramFiles(x86)%" ) @@ -25,64 +23,63 @@ SET "PROGRAMFILES_PATH=%ProgramFiles(x86)%" rem ====== Edit to suit your environment ========= SET VCVERSION=141 +SET PARAM_VCVARSVER=14.1 SET PLATFORM_TOOLSET=v%VCVERSION% REM The Windows SDK version in use. SET WINDOWS_TARGET_PLATFORM_VERSION=10.0.17134.0 +SET MSVCREDIST_VERSION=14.15.26706 +REM SET WINDOWS_TARGET_PLATFORM_VERSION=10.0.18362.0 +REM SET MSVCREDIST_VERSION=14.16.27012 REM Allow overriding MSSDKS_PATH from outside this script. IF "%MSSDKS_PATH%" == "" ( set "MSSDKS_PATH=%PROGRAMFILES_PATH%\Windows Kits" ) -REM Allow overriding MSVC_PATH from outside this script. +REM Allow overriding BUILDTOOLS_PATH from outside this script. IF "%MSVC_PATH%" == "" ( - SET "MSVC_PATH=%PROGRAMFILES_PATH%\Microsoft Visual Studio\2017\Community\VC" + if "%BUILDTOOLS_PATH%" == "" ( + SET "BUILDTOOLS_PATH=%PROGRAMFILES_PATH%\Microsoft Visual Studio\2017\BuildTools\VC" + ) +) ELSE ( + SET "BUILDTOOLS_PATH=%PROGRAMFILES_PATH%\Microsoft Visual Studio\2017\Community\VC" ) - -REM Allow overriding BUILDTOOLS_PATH from outside this script. -if "%BUILDTOOLS_PATH%" == "" ( - SET "BUILDTOOLS_PATH=%PROGRAMFILES_PATH%\Microsoft Visual Studio\2017\BuildTools\VC" +IF EXIST "%BUILDTOOLS_PATH%" ( +echo Building with preconfigured path at: "%BUILDTOOLS_PATH%" +) ELSE ( +call :function_get_product +IF ERRORLEVEL 1 ( +echo. +echo Could not find "%BUILDTOOLS_PATH%" and the detection of product didn't work +echo Edit the %~nx0 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 Allow overriding CMAKEDIR from outside this script. -if "%CMAKEDIR%" == "" ( - SET "CMAKEDIR=%CD%\build\cmake-3.12.2-win32-x86\bin" +REM END NO PRODUCT ) +REM END EXIST BUILDTOOLS_PATH -REM Verify paths. -IF EXIST "%MSVC_PATH%" ( -echo Using Visual Studio 2017 Community Edition to build. -SET "BUILDTOOLS_PATH=%MSVC_PATH%" SET BUILDTOOLS_SCRIPT=Auxiliary\Build\vcvarsall.bat +SET PATH_REDIST=%BUILDTOOLS_PATH%\Redist\MSVC\%MSVCREDIST_VERSION% REM Check whether we have a 64-bit compiler available. -REM NOTE(rryan): Temporarily disabled because the build doesn't work with a 64-bit compiler. -rem IF EXIST "%MSVC_PATH%\bin\amd64\cl.exe" ( -SET COMPILER_X86=amd64_x86 -SET COMPILER_X64=amd64 -rem ) ELSE ( -rem SET COMPILER_X86=x86 -rem SET COMPILER_X64=x86_amd64 -rem ) - +call :function_has_64bit +IF ERRORLEVEL 1 ( +echo Using 32-bit compiler. +SET COMPILER_X86=x86 +SET COMPILER_X64=x86_amd64 ) ELSE ( -IF EXIST "%BUILDTOOLS_PATH%" ( -echo Using Visual Studio 2017 Build Tools to build. -SET BUILDTOOLS_SCRIPT=Auxiliary\Build\vcvarsall.bat - +echo Using 64-bit compiler. 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 Allow overriding CMAKEDIR from outside this script. +if "%CMAKEDIR%" == "" ( + SET "CMAKEDIR=%CD%\build\cmake-3.12.2-win32-x86\bin" ) -REM END EXIST VISUALSTUDIO if NOT EXIST "%CMAKEDIR%" ( set "CMAKEDIROLD=%CMAKEDIR%" @@ -229,6 +226,8 @@ rem /FS force synchronous PDB writes (prevents PDB corruption with /MP) rem /Zi write PDBs rem /DEBUG moves debug information from the .o files to the .pdb during link. set _CL_=/MP /FS /EHsc /Zi %RUNTIME_FLAG% +set CXXFLAGS=/MP /FS /EHsc +set CFLAGS=/MP /FS /EHsc set _LINK_=/DEBUG rem PlatformToolset: Over-ride the platform toolset of solutions with this value. rem RuntimeLibrary: Over-ride the runtime library with this value. @@ -266,9 +265,9 @@ SET XCOPY=xcopy /S /Y /I REM Everyting prepared. Setup the compiler. if %MACHINE_X86% ( - call "%BUILDTOOLS_PATH%\%BUILDTOOLS_SCRIPT%" %COMPILER_X86% + call "%BUILDTOOLS_PATH%\%BUILDTOOLS_SCRIPT%" %COMPILER_X86% -vcvars_ver=%PARAM_VCVARSVER% ) else ( - call "%BUILDTOOLS_PATH%\%BUILDTOOLS_SCRIPT%" %COMPILER_X64% + call "%BUILDTOOLS_PATH%\%BUILDTOOLS_SCRIPT%" %COMPILER_X64% -vcvars_ver=%PARAM_VCVARSVER% ) REM The Visual C++ compiler (cl.exe) recognizes certain environment variables, specifically LIB, LIBPATH, PATH, and INCLUDE @@ -323,7 +322,6 @@ SET /A TASKNUM=1 REM build_rubberband.bat depends on fftw3 REM build_chromaprint.bat depends on fftw3 REM build_taglib.bat depends on zlib - REM build_qt4.bat depends on sqlite3, zlib, openssl REM build_qt5.bat depends on sqlite3, zlib, openssl REM build_qtkeychain.bat depends on qt5 FOR %%G IN ( @@ -377,16 +375,16 @@ ENDLOCAL REM Copy runtime installers for release builds and debug runtime DLLs for debug builds. -%XCOPY% "%BUILDTOOLS_PATH%\Redist\MSVC\14.15.26706\vc_redist.x64.exe" %ROOT_DIR% -%XCOPY% "%BUILDTOOLS_PATH%\Redist\MSVC\14.15.26706\vc_redist.x86.exe" %ROOT_DIR% +%XCOPY% "%PATH_REDIST%\vc_redist.x64.exe" %ROOT_DIR% +%XCOPY% "%PATH_REDIST%\vc_redist.x86.exe" %ROOT_DIR% if %CONFIG_RELEASE% ( - %XCOPY% "%BUILDTOOLS_PATH%\Redist\MSVC\14.15.26706\%MACHINE_X%\Microsoft.VC%VCVERSION%.CRT\*.dll" %LIB_DIR% - %XCOPY% "%BUILDTOOLS_PATH%\Redist\MSVC\14.15.26706\%MACHINE_X%\Microsoft.VC%VCVERSION%.CXXAMP\*.dll" %LIB_DIR% - %XCOPY% "%BUILDTOOLS_PATH%\Redist\MSVC\14.15.26706\%MACHINE_X%\Microsoft.VC%VCVERSION%.OpenMP\*.dll" %LIB_DIR% + %XCOPY% "%PATH_REDIST%\%MACHINE_X%\Microsoft.VC%VCVERSION%.CRT\*.dll" %LIB_DIR% + %XCOPY% "%PATH_REDIST%\%MACHINE_X%\Microsoft.VC%VCVERSION%.CXXAMP\*.dll" %LIB_DIR% + %XCOPY% "%PATH_REDIST%\%MACHINE_X%\Microsoft.VC%VCVERSION%.OpenMP\*.dll" %LIB_DIR% ) else ( - %XCOPY% "%BUILDTOOLS_PATH%\Redist\MSVC\14.15.26706\debug_nonredist\%MACHINE_X%\Microsoft.VC%VCVERSION%.DebugCRT\*.dll" %LIB_DIR% - %XCOPY% "%BUILDTOOLS_PATH%\Redist\MSVC\14.15.26706\debug_nonredist\%MACHINE_X%\Microsoft.VC%VCVERSION%.DebugCXXAMP\*.dll" %LIB_DIR% - %XCOPY% "%BUILDTOOLS_PATH%\Redist\MSVC\14.15.26706\debug_nonredist\%MACHINE_X%\Microsoft.VC%VCVERSION%.DebugOpenMP\*.dll" %LIB_DIR% + %XCOPY% "%PATH_REDIST%\debug_nonredist\%MACHINE_X%\Microsoft.VC%VCVERSION%.DebugCRT\*.dll" %LIB_DIR% + %XCOPY% "%PATH_REDIST%\debug_nonredist\%MACHINE_X%\Microsoft.VC%VCVERSION%.DebugCXXAMP\*.dll" %LIB_DIR% + %XCOPY% "%PATH_REDIST%\debug_nonredist\%MACHINE_X%\Microsoft.VC%VCVERSION%.DebugOpenMP\*.dll" %LIB_DIR% ) echo. echo. @@ -394,3 +392,35 @@ echo Everything was built successfully echo. ENDLOCAL +EXIT /b 0 + +:function_get_product +FOR %%Y IN (2019,2017) DO ( + FOR %%P IN (Community,Professional,Enterprise) DO ( + SET "LOCAL_VS_PATH=%PROGRAMFILES_PATH%\Microsoft Visual Studio\%%Y\%%P\VC" + IF EXIST "!LOCAL_VS_PATH!" ( + SET "BUILDTOOLS_PATH=!LOCAL_VS_PATH!" + ECHO Using Visual Studio %%Y %%P at: !LOCAL_VS_PATH! + EXIT /B 0 + ) + ) + REM FOR + SET "LOCAL_BT_PATH=%PROGRAMFILES_PATH%\Microsoft Visual Studio\%%Y\BuildTools\VC" + IF EXIST "!LOCAL_BT_PATH!" ( + SET "BUILDTOOLS_PATH=!LOCAL_BT_PATH!" + ECHO Using BuildTools %%Y at: !LOCAL_BT_PATH! + EXIT /B 0 + ) + REM BT +) +REM FOR +EXIT /B 1 + +:function_has_64bit +FOR /F %%G IN ('dir "%BUILDTOOLS_PATH%\Tools\MSVC\%PARAM_VCVARSVER%*" /b /ad-h /o-n') DO ( + set "LOCAL_64_CL=%BUILDTOOLS_PATH%\Tools\MSVC\%%G\bin\Hostx64\x64\cl.exe" + if EXIST "!LOCAL_64_CL!" ( + EXIT /B 0 + ) +) +EXIT /B 1 \ No newline at end of file diff --git a/build_qt5.bat b/build_qt5.bat index a62ab8d23..c936837a0 100644 --- a/build_qt5.bat +++ b/build_qt5.bat @@ -10,19 +10,7 @@ set QT_PATCH=2 REM Qt5 paths can get really long. We use an abbreviated folder name to prevent hitting REM Windows path length limits. SET QTSHORTDIR=QT%QT_MAJOR% - -REM remove old built files -rd /s /q build\%QTSHORTDIR% - set QTDIR=qt-everywhere-src-%QT_MAJOR%.%QT_MINOR%.%QT_PATCH% -if not exist %QTDIR%.tar.xz ( - echo --- Downloading Qt5 --- - bitsadmin /transfer downloadQt5 /download http://download.qt.io/official_releases/qt/%QT_MAJOR%.%QT_MINOR%/%QT_MAJOR%.%QT_MINOR%.%QT_PATCH%/single/%QTDIR%.zip %CD%\%QTDIR%.zip -) - -REM 7z requires separate extraction steps for the xz compression and the tar archive -7za x -obuild %QTDIR%.zip -move build\%QTDIR% build\%QTSHORTDIR% SET VALRETURN=0 @@ -38,18 +26,34 @@ if %CONFIG_RELEASE% ( set CONFIG=-debug ) -cd build\%QTSHORTDIR% -IF ERRORLEVEL 1 ( -echo could not find QT5 on %CD%\build\%QTSHORTDIR% - SET VALRETURN=1 - goto END + +if %DELETE_OLD% ( + REM remove old built files + rd /s /q build\%QTSHORTDIR% ) -REM Apply workaround for QTBUG-61342. -%BIN_DIR%\patch.exe -N -p0 --verbose -i %CD%\..\QTBUG-61342.patch -r %CD%\..\QTBUG-61342.rej.txt -IF ERRORLEVEL 1 ( - SET VALRETURN=1 - goto END +if not exist %CD%\build\%QTSHORTDIR% ( + if exist %CD%\%QTDIR%.tar.xz ( + 7za x %QTDIR%.tar.xz -so | 7za x -aoa -si -ttar -obuild + ) else ( + if exist %CD%\%QTDIR%.zip ( + 7za x -obuild %QTDIR%.zip + ) else ( + bitsadmin /transfer downloadQt5 /download http://download.qt.io/official_releases/qt/%QT_MAJOR%.%QT_MINOR%/%QT_MAJOR%.%QT_MINOR%.%QT_PATCH%/single/%QTDIR%.tar.xz %CD%\%QTDIR%.zip + 7za x %QTDIR%.tar.xz -so | 7za x -aoa -si -ttar -obuild + ) + ) + + move build\%QTDIR% build\%QTSHORTDIR% + cd build\%QTSHORTDIR% + REM Apply workaround for QTBUG-61342. + %BIN_DIR%\patch.exe -N -p0 --verbose -i %CD%\..\QTBUG-61342.patch -r %CD%\..\QTBUG-61342.rej.txt + IF ERRORLEVEL 1 ( + SET VALRETURN=1 + goto END + ) +) else ( + cd build\%QTSHORTDIR% ) REM nmake distclean or nmake confclean are not present in the Makefile, so we delete these files and hope it rebuilds. @@ -79,7 +83,7 @@ call configure.bat %CONFIG% %QT_COMMON% -shared -openssl -separate-debug-info IF ERRORLEVEL 1 ( SET VALRETURN=1 - goto END + goto END ) rem /K keeps building things not affected by errors @@ -95,6 +99,9 @@ IF ERRORLEVEL 1 ( SET VALRETURN=1 goto END ) +if not %STATIC_LIBS% ( + xcopy %LIB_DIR%\zlibwapi.dll %ROOT_DIR%\%QTSHORTDIR%\bin +) rem Note, we do not run nmake clean because it deletes files we need (e.g. compiled translations). From 9c18a0770bce4eb95fc5bd493b86db755193795a Mon Sep 17 00:00:00 2001 From: JosepMaJAZ Date: Mon, 13 Apr 2020 00:18:11 +0200 Subject: [PATCH 4/7] Actually remove the code that was meant for QT4. No need to comment it --- create_environment.bat | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/create_environment.bat b/create_environment.bat index 5d5ba0420..1379b73e9 100644 --- a/create_environment.bat +++ b/create_environment.bat @@ -72,16 +72,6 @@ ENDLOCAL exit /b 1 ) -REM echo Copying Qt4 -REM Note that using xcopy to copy Qt can run into "Insufficient memory" errors -REM due to path lengths growing larger than 254 characters. -REM %ROBOCOPY% qt-everywhere-opensource-src-4.8.7 "%ENVIRONMENT_PATH%\build\qt-everywhere-opensource-src-4.8.7" -REM robocopy errorlevel 1 means files were copied. -REM IF ERRORLEVEL 2 ( -REM echo Copying Qt 4.8.7 failed. -REM ENDLOCAL -REM exit /b 1 -REM ) echo Copying Qt5 REM Note that using xcopy to copy Qt can run into "Insufficient memory" errors From 79f1b65fb4d2c37756f0ef147dfc0b6e8a6227d8 Mon Sep 17 00:00:00 2001 From: JosepMaJAZ Date: Sun, 26 Apr 2020 11:28:50 +0200 Subject: [PATCH 5/7] Fixed ASIOSDK hash check. --- build_environment.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_environment.bat b/build_environment.bat index 52aff5883..f22612cb9 100644 --- a/build_environment.bat +++ b/build_environment.bat @@ -98,7 +98,7 @@ if NOT EXIST "%CD%\%PA_ASIO_PATH%\ASIOSDK" ( echo --- Downloading ASIO SDK --- echo By running this script, you must have agreed to the Steinberg ASIO SDK terms. bitsadmin /transfer downloadASIO /download http://www.steinberg.net/sdk_downloads/ASIOSDK2.3.1.zip %CD%\ASIOSDK2.3.1.zip - powershell "Exit !((get-filehash -algorithm sha256 ASIOSDK2.3.1.zip).Hash -eq '31074764475059448A9B7A56F103F4723ED60465E0E9D1A9446CA03DCF840F04')" + powershell "if((get-filehash -algorithm sha256 ASIOSDK2.3.1.zip).Hash -eq '31074764475059448A9B7A56F103F4723ED60465E0E9D1A9446CA03DCF840F04') { Exit 0 } else { Exit 1 } " if ERRORLEVEL 1 ( echo ASIO SDK does not match expected hash. powershell "(get-filehash -algorithm sha256 ASIOSDK2.3.1.zip).Hash" From f276f104a5970f9ade74e702dd4ce01a621ccd92 Mon Sep 17 00:00:00 2001 From: JosepMaJAZ Date: Sun, 26 Apr 2020 12:13:44 +0200 Subject: [PATCH 6/7] corrected the extension of the Qt5 file --- build_qt5.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_qt5.bat b/build_qt5.bat index c936837a0..de968483a 100644 --- a/build_qt5.bat +++ b/build_qt5.bat @@ -39,8 +39,8 @@ if not exist %CD%\build\%QTSHORTDIR% ( if exist %CD%\%QTDIR%.zip ( 7za x -obuild %QTDIR%.zip ) else ( - bitsadmin /transfer downloadQt5 /download http://download.qt.io/official_releases/qt/%QT_MAJOR%.%QT_MINOR%/%QT_MAJOR%.%QT_MINOR%.%QT_PATCH%/single/%QTDIR%.tar.xz %CD%\%QTDIR%.zip - 7za x %QTDIR%.tar.xz -so | 7za x -aoa -si -ttar -obuild + bitsadmin /transfer downloadQt5 /download http://download.qt.io/official_releases/qt/%QT_MAJOR%.%QT_MINOR%/%QT_MAJOR%.%QT_MINOR%.%QT_PATCH%/single/%QTDIR%.tar.xz %CD%\%QTDIR%.tar.xz + 7za x %CD%\%QTDIR%.tar.xz -so | 7za x -aoa -si -ttar -obuild ) ) From 47c1332a98bd07ce6c37bce4a5ff130afdc84213 Mon Sep 17 00:00:00 2001 From: JosepMaJAZ Date: Sun, 26 Apr 2020 15:48:17 +0200 Subject: [PATCH 7/7] Fixed path for the patch file (%CD% isn't updated because the change dir is executed inside an if) --- build_qt5.bat | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/build_qt5.bat b/build_qt5.bat index de968483a..4ed21f153 100644 --- a/build_qt5.bat +++ b/build_qt5.bat @@ -32,22 +32,23 @@ if %DELETE_OLD% ( rd /s /q build\%QTSHORTDIR% ) -if not exist %CD%\build\%QTSHORTDIR% ( - if exist %CD%\%QTDIR%.tar.xz ( - 7za x %QTDIR%.tar.xz -so | 7za x -aoa -si -ttar -obuild +if not exist %ROOT_DIR%\build\%QTSHORTDIR% ( + REM Note: Current 7z does not support the "paxheader" of tars, so it counts the @PaxHeader as files but doesn't seem to have any side effects right now + if exist %ROOT_DIR%\%QTDIR%.tar.xz ( + 7za x %ROOT_DIR%\%QTDIR%.tar.xz -so | 7za x -aoa -si -ttar -obuild ) else ( - if exist %CD%\%QTDIR%.zip ( - 7za x -obuild %QTDIR%.zip + if exist %ROOT_DIR%\%QTDIR%.zip ( + 7za x -obuild %ROOT_DIR%\%QTDIR%.zip ) else ( - bitsadmin /transfer downloadQt5 /download http://download.qt.io/official_releases/qt/%QT_MAJOR%.%QT_MINOR%/%QT_MAJOR%.%QT_MINOR%.%QT_PATCH%/single/%QTDIR%.tar.xz %CD%\%QTDIR%.tar.xz - 7za x %CD%\%QTDIR%.tar.xz -so | 7za x -aoa -si -ttar -obuild + bitsadmin /transfer downloadQt5 /download http://download.qt.io/official_releases/qt/%QT_MAJOR%.%QT_MINOR%/%QT_MAJOR%.%QT_MINOR%.%QT_PATCH%/single/%QTDIR%.tar.xz %ROOT_DIR%\%QTDIR%.tar.xz + 7za x %ROOT_DIR%\%QTDIR%.tar.xz -so | 7za x -aoa -si -ttar -obuild ) ) move build\%QTDIR% build\%QTSHORTDIR% cd build\%QTSHORTDIR% REM Apply workaround for QTBUG-61342. - %BIN_DIR%\patch.exe -N -p0 --verbose -i %CD%\..\QTBUG-61342.patch -r %CD%\..\QTBUG-61342.rej.txt + %BIN_DIR%\patch.exe -N -p0 --verbose -i %ROOT_DIR%\build\QTBUG-61342.patch -r %ROOT_DIR%\build\QTBUG-61342.rej.txt IF ERRORLEVEL 1 ( SET VALRETURN=1 goto END