changeset 1827:e63cc95876cb baselib-win-build

Alternative build mechanism for Windows, with base as a library and a single script to run full builds
author Chris Cannam
date Thu, 24 May 2018 16:19:50 +0100
parents 1b6ffed298a2
children 8c3683eeb898
files .appveyor.yml .hgignore base.pri base.pro deploy/win32/build.cmd deploy/win32/sonic-visualiser.wxs deploy/win64/build.cmd deploy/win64/complete-build.bat deploy/win64/sonic-visualiser.wxs noconfig.pri sonic-visualiser.pro
diffstat 11 files changed, 200 insertions(+), 101 deletions(-) [+]
line wrap: on
line diff
--- a/.appveyor.yml	Fri May 18 13:49:23 2018 +0100
+++ b/.appveyor.yml	Thu May 24 16:19:50 2018 +0100
@@ -12,14 +12,7 @@
   - ps: '"[hostsecurity]" | Out-File -Encoding "ASCII" -Append $env:USERPROFILE\mercurial.ini'
   - ps: '"code.soundsoftware.ac.uk = code.soundsoftware.ac.uk:fingerprints=sha256:64:75:f6:47:15:de:b4:51:ea:96:e2:f4:8a:f5:53:a5:11:c8:dd:82:73:5d:bd:54:18:cb:c8:9d:10:37:28:85" | Out-File -Encoding "ASCII" -Append $env:USERPROFILE\mercurial.ini'
 
-before_build:
-  - set QTDIR=C:\Qt\5.10\msvc2017_64
-  - set PATH=%PATH%;%QTDIR%\bin;C:\Program Files (x86)\SMLNJ\bin
-  - repoint install
-  - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
-  - qmake -r -tp vc sonic-visualiser.pro
-  - sv-dependency-builds\win64-msvc\bin\capnp -Isv-dependency-builds/win64-msvc/include compile --src-prefix=piper/capnp -osv-dependency-builds/win64-msvc/bin/capnpc-c++:piper-cpp/vamp-capnp piper/capnp/piper.capnp
+build_script:
+  - deploy\win64\complete-build.bat
 
-build:
-  project: sonic-visualiser.sln
   
--- a/.hgignore	Fri May 18 13:49:23 2018 +0100
+++ b/.hgignore	Thu May 24 16:19:50 2018 +0100
@@ -50,3 +50,5 @@
 *.msi
 *.user
 glob:.repoint-*.bin
+build_win32
+build_win64
--- a/base.pri	Fri May 18 13:49:23 2018 +0100
+++ b/base.pri	Thu May 24 16:19:50 2018 +0100
@@ -33,37 +33,3 @@
 
 CONFIG += qt thread warn_on stl rtti exceptions c++11
 
-include(bq-files.pri)
-include(vamp-plugin-sdk-files.pri)
-include(svcore/files.pri)
-include(capnp-regen.pri)
-
-DATAQUAY_SOURCES=$$fromfile(dataquay/lib.pro, SOURCES)
-DATAQUAY_HEADERS=$$fromfile(dataquay/lib.pro, HEADERS)
-
-CHECKER_SOURCES=$$fromfile(checker/checker.pri, SOURCES)
-CHECKER_HEADERS=$$fromfile(checker/checker.pri, HEADERS)
-                 
-CLIENT_HEADERS=$$fromfile(piper-cpp/vamp-client/qt/test.pro, HEADERS)
-
-for (file, BQ_SOURCES)       { SOURCES += $$file }
-for (file, BQ_HEADERS)       { HEADERS += $$file }
-
-for (file, VAMP_SOURCES)     { SOURCES += $$file }
-for (file, VAMP_HEADERS)     { HEADERS += $$file }
-
-for (file, DATAQUAY_SOURCES) { SOURCES += $$sprintf("dataquay/%1", $$file) }
-for (file, DATAQUAY_HEADERS) { HEADERS += $$sprintf("dataquay/%1", $$file) }
-
-for (file, CHECKER_SOURCES)  { SOURCES += $$sprintf("checker/%1",  $$file) }
-for (file, CHECKER_HEADERS)  { HEADERS += $$sprintf("checker/%1",  $$file) }
-
-for (file, SVCORE_SOURCES)   { SOURCES += $$sprintf("svcore/%1", $$file) }
-for (file, SVCORE_HEADERS)   { HEADERS += $$sprintf("svcore/%1", $$file) }
-             
-for (file, CLIENT_HEADERS) {
-    HEADERS += $$sprintf("piper-cpp/vamp-client/qt/%1",  $$file)
-}
-
-SOURCES += piper-cpp/vamp-capnp/piper-capnp.cpp
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/base.pro	Thu May 24 16:19:50 2018 +0100
@@ -0,0 +1,56 @@
+
+TEMPLATE = lib
+
+exists(config.pri) {
+    include(config.pri)
+}
+
+!exists(config.pri) {
+    include(noconfig.pri)
+}
+
+include(base.pri)
+
+CONFIG += staticlib
+QT += network xml
+QT -= gui
+
+TARGET = base
+
+OBJECTS_DIR = o
+MOC_DIR = o
+
+include(bq-files.pri)
+include(vamp-plugin-sdk-files.pri)
+include(svcore/files.pri)
+include(capnp-regen.pri)
+
+DATAQUAY_SOURCES=$$fromfile(dataquay/lib.pro, SOURCES)
+DATAQUAY_HEADERS=$$fromfile(dataquay/lib.pro, HEADERS)
+
+CHECKER_SOURCES=$$fromfile(checker/checker.pri, SOURCES)
+CHECKER_HEADERS=$$fromfile(checker/checker.pri, HEADERS)
+                 
+CLIENT_HEADERS=$$fromfile(piper-cpp/vamp-client/qt/test.pro, HEADERS)
+
+for (file, BQ_SOURCES)       { SOURCES += $$file }
+for (file, BQ_HEADERS)       { HEADERS += $$file }
+
+for (file, VAMP_SOURCES)     { SOURCES += $$file }
+for (file, VAMP_HEADERS)     { HEADERS += $$file }
+
+for (file, DATAQUAY_SOURCES) { SOURCES += $$sprintf("dataquay/%1", $$file) }
+for (file, DATAQUAY_HEADERS) { HEADERS += $$sprintf("dataquay/%1", $$file) }
+
+for (file, CHECKER_SOURCES)  { SOURCES += $$sprintf("checker/%1",  $$file) }
+for (file, CHECKER_HEADERS)  { HEADERS += $$sprintf("checker/%1",  $$file) }
+
+for (file, SVCORE_SOURCES)   { SOURCES += $$sprintf("svcore/%1", $$file) }
+for (file, SVCORE_HEADERS)   { HEADERS += $$sprintf("svcore/%1", $$file) }
+             
+for (file, CLIENT_HEADERS) {
+    HEADERS += $$sprintf("piper-cpp/vamp-client/qt/%1",  $$file)
+}
+
+SOURCES += piper-cpp/vamp-capnp/piper-capnp.cpp
+
--- a/deploy/win32/build.cmd	Fri May 18 13:49:23 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-@ECHO OFF
-SET WIXPATH="C:\Program Files (x86)\WiX Toolset v3.11\bin"
-IF NOT EXIST %WIXPATH% (
-    SET WIXPATH="C:\Program Files\WiX Toolset v3.11\bin"
-)
-DEL sonic-visualiser.msi
-%WIXPATH%\candle.exe -v sonic-visualiser.wxs
-%WIXPATH%\light.exe -b ..\..\..\build-sonic-visualiser-Desktop_Qt_5_10_1_MinGW_32bit-Release -ext WixUIExtension -ext WixUtilExtension -v sonic-visualiser.wixobj
-PAUSE
-DEL sonic-visualiser.wixobj
-DEL sonic-visualiser.wixpdb
--- a/deploy/win32/sonic-visualiser.wxs	Fri May 18 13:49:23 2018 +0100
+++ b/deploy/win32/sonic-visualiser.wxs	Thu May 24 16:19:50 2018 +0100
@@ -35,7 +35,7 @@
             <File
                 Id="VampREADME"
                 Name="README.txt"
-                Source="..\sonic-visualiser\deploy\win32\README-Vamp.txt"/>
+                Source="..\deploy\win32\README-Vamp.txt"/>
           </Component>
         </Directory>
         <Directory Id="APPLICATIONFOLDER" Name="Sonic Visualiser">
@@ -72,20 +72,20 @@
             <File
                 Id="COPYING"
                 Name="COPYING.txt"
-                Source="..\sonic-visualiser\COPYING"/>
+                Source="..\COPYING"/>
             <File
                 Id="README"
                 Name="README.txt"
-                Source="..\sonic-visualiser\README.md"/>
+                Source="..\README.md"/>
             <File
                 Id="CHANGELOG"
                 Name="CHANGELOG.txt"
-                Source="..\sonic-visualiser\CHANGELOG"/>
+                Source="..\CHANGELOG"/>
 
             <File
                 Id="winicon.ico"
                 Name="sv-winicon.ico"
-                Source="..\sonic-visualiser\icons/sv-winicon.ico"/>
+                Source="..\icons/sv-winicon.ico"/>
           </Component>
           
           <Component
@@ -241,17 +241,13 @@
     <Property Id="WIXUI_DONTVALIDATEPATH" Value="1" />
     <Property Id="ApplicationFolderName" Value="Sonic Visualiser" />
     <Property Id="WixAppFolder" Value="WixPerMachineFolder" />
-    <WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
+    <WixVariable Id="WixUILicenseRtf" Value="..\deploy\win32\License.rtf" />
     
-    <Icon Id="winicon.ico" SourceFile="..\sonic-visualiser\icons\sv-winicon.ico"/>
+    <Icon Id="winicon.ico" SourceFile="..\icons\sv-winicon.ico"/>
     <Property Id="ARPPRODUCTICON" Value="winicon.ico" />
-<!--
-    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch Sonic Visualiser now"/>
-    <Property Id="WixShellExecTarget" Value="[#SVExecutable]"/>
-    <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes"/>
--->
-    <WixVariable Id="WixUIBannerBmp" Value="..\sonic-visualiser\deploy\win32\top.bmp"/>
-    <WixVariable Id="WixUIDialogBmp" Value="..\sonic-visualiser\deploy\win32\main.bmp"/>
+
+    <WixVariable Id="WixUIBannerBmp" Value="..\deploy\win32\top.bmp"/>
+    <WixVariable Id="WixUIDialogBmp" Value="..\deploy\win32\main.bmp"/>
 
   </Product>
 </Wix>
--- a/deploy/win64/build.cmd	Fri May 18 13:49:23 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-@ECHO OFF
-SET WIXPATH="C:\Program Files (x86)\WiX Toolset v3.11\bin"
-IF NOT EXIST %WIXPATH% (
-    SET WIXPATH="C:\Program Files\WiX Toolset v3.11\bin"
-)
-DEL sonic-visualiser.msi
-%WIXPATH%\candle.exe -v sonic-visualiser.wxs
-%WIXPATH%\light.exe -b ..\..\..\build-sonic-visualiser-Desktop_Qt_5_10_1_MSVC2017_64bit-Release -ext WixUIExtension -v sonic-visualiser.wixobj
-PAUSE
-DEL sonic-visualiser.wixobj
-DEL sonic-visualiser.wixpdb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/win64/complete-build.bat	Thu May 24 16:19:50 2018 +0100
@@ -0,0 +1,102 @@
+rem  Run this from within the top-level SV dir: deploy\win64\complete-build.bat
+rem  To build from clean, delete the folders build_win32 and build_win64 first
+
+set STARTPWD=%CD%
+
+if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" (
+@   echo "Could not find MSVC vars batch file"
+@   exit /b
+)
+
+set QTDIR32=C:\Qt\5.10.1\mingw53_32
+set QTDIR64=C:\Qt\5.10.1\msvc2017_64
+if not exist %QTDIR32% (
+@   echo Could not find 32-bit Qt
+@   exit /b
+)
+if not exist %QTDIR64% (
+@   echo Could not find 64-bit Qt
+@   exit /b
+)
+
+if not exist "C:\Program Files (x86)\SMLNJ\bin" (
+@   echo Could not find SML/NJ, required for Repoint
+@   exit /b
+)
+
+if not exist "C:\Program Files (x86)\WiX Toolset v3.11\bin" (
+@   echo Could not find WiX Toolset
+@   exit /b
+)
+
+call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
+
+set NONQTPATH=%PATH%;"C:\Program Files (x86)\SMLNJ\bin";"C:\Program Files (x86)\WiX Toolset v3.11\bin"
+
+cd %STARTPWD%
+
+call .\repoint install
+
+set QTDIR=%QTDIR32%
+set PATH=%NONQTPATH%;%QTDIR%\bin;C:\Qt\Tools\QtCreator\bin;C:\Qt\Tools\mingw530_32\bin
+
+sv-dependency-builds\win32-mingw\bin\capnp -Isv-dependency-builds/win32-mingw/include compile --src-prefix=piper/capnp -osv-dependency-builds/win32-mingw/bin/capnpc-c++:piper-cpp/vamp-capnp piper/capnp/piper.capnp
+
+mkdir build_win32
+cd build_win32
+
+qmake -r ..\sonic-visualiser.pro
+
+jom
+
+copy .\checker\release\vamp-plugin-load-checker.exe .\release
+
+copy %QTDIR%\bin\Qt5Core.dll .\release
+copy %QTDIR%\bin\Qt5Gui.dll .\release
+copy %QTDIR%\bin\Qt5Widgets.dll .\release
+copy %QTDIR%\bin\Qt5Network.dll .\release
+copy %QTDIR%\bin\Qt5Xml.dll .\release
+copy %QTDIR%\bin\Qt5Svg.dll .\release
+copy %QTDIR%\bin\libgcc_s_dw2-1.dll .\release
+copy %QTDIR%\bin\"libstdc++-6.dll" .\release
+copy %QTDIR%\bin\libwinpthread-1.dll .\release
+copy %QTDIR%\plugins\platforms\qminimal.dll .\release
+copy %QTDIR%\plugins\platforms\qwindows.dll .\release
+
+del sonic-visualiser.msi
+candle -v ..\deploy\win32\sonic-visualiser.wxs
+light -b . -ext WixUIExtension -ext WixUtilExtension -v sonic-visualiser.wixobj
+del sonic-visualiser.wixobj
+del sonic-visualiser.wixpdb
+
+cd %STARTPWD%
+
+set QTDIR=%QTDIR64%
+set PATH=%NONQTPATH%;%QTDIR%\bin
+
+sv-dependency-builds\win64-msvc\bin\capnp -Isv-dependency-builds/win64-msvc/include compile --src-prefix=piper/capnp -osv-dependency-builds/win64-msvc/bin/capnpc-c++:piper-cpp/vamp-capnp piper/capnp/piper.capnp
+
+mkdir build_win64
+cd build_win64
+
+qmake -r -tp vc ..\sonic-visualiser.pro
+
+msbuild sonic-visualiser.sln /t:Build /p:Configuration=Release
+
+copy .\checker\release\vamp-plugin-load-checker.exe .\release
+
+copy %QTDIR%\bin\Qt5Core.dll .\release
+copy %QTDIR%\bin\Qt5Gui.dll .\release
+copy %QTDIR%\bin\Qt5Widgets.dll .\release
+copy %QTDIR%\bin\Qt5Network.dll .\release
+copy %QTDIR%\bin\Qt5Xml.dll .\release
+copy %QTDIR%\bin\Qt5Svg.dll .\release
+copy %QTDIR%\plugins\platforms\qminimal.dll .\release
+copy %QTDIR%\plugins\platforms\qwindows.dll .\release
+copy ..\sv-dependency-builds\win64-msvc\lib\libsndfile-1.dll .\release
+
+del sonic-visualiser.msi
+candle -v ..\deploy\win64\sonic-visualiser.wxs
+light -b . -ext WixUIExtension -ext WixUtilExtension -v sonic-visualiser.wixobj
+del sonic-visualiser.wixobj
+del sonic-visualiser.wixpdb
--- a/deploy/win64/sonic-visualiser.wxs	Fri May 18 13:49:23 2018 +0100
+++ b/deploy/win64/sonic-visualiser.wxs	Thu May 24 16:19:50 2018 +0100
@@ -40,7 +40,7 @@
             <File
                 Id="VampREADME"
                 Name="README.txt"
-                Source="..\sonic-visualiser\deploy\win64\README-Vamp.txt"/>
+                Source="..\deploy\win64\README-Vamp.txt"/>
           </Component>
         </Directory>
 
@@ -77,20 +77,20 @@
             <File
                 Id="COPYING"
                 Name="COPYING.txt"
-                Source="..\sonic-visualiser\COPYING"/>
+                Source="..\COPYING"/>
             <File
                 Id="README"
                 Name="README.txt"
-                Source="..\sonic-visualiser\README.md"/>
+                Source="..\README.md"/>
             <File
                 Id="CHANGELOG"
                 Name="CHANGELOG.txt"
-                Source="..\sonic-visualiser\CHANGELOG"/>
+                Source="..\CHANGELOG"/>
 
             <File
                 Id="winicon.ico"
                 Name="sv-winicon.ico"
-                Source="..\sonic-visualiser\icons\sv-winicon.ico"/>
+                Source="..\icons\sv-winicon.ico"/>
           </Component>
           
           <Component Win64="yes"
@@ -150,7 +150,7 @@
             <File
                 Id="libsndfile"
                 Name="libsndfile-1.dll"
-                Source="..\sonic-visualiser\sv-dependency-builds\win64-msvc\lib\libsndfile-1.dll"
+                Source="..\sv-dependency-builds\win64-msvc\lib\libsndfile-1.dll"
                 KeyPath="yes"/>
           </Component>
 
@@ -210,19 +210,19 @@
 	      <File
 		  Id="piper32"
 		  Name="piper-vamp-simple-server-32.exe"
-		  Source="release\piper-vamp-simple-server-32.exe"/>
+		  Source="..\build_win32\release\piper-vamp-simple-server.exe"/>
 	      <File
                   Id="libgcc32"
                   Name="libgcc_s_dw2-1.dll"
-                  Source="release\libgcc_s_dw2-1.dll"/>
+                  Source="..\build_win32\release\libgcc_s_dw2-1.dll"/>
 	      <File
                   Id="libstdcplusplus32"
                   Name="libstdc++-6.dll"
-                  Source="release\libstdc++-6.dll"/>
+                  Source="..\build_win32\release\libstdc++-6.dll"/>
 	      <File
                   Id="libwinpthread32"
                   Name="libwinpthread-1.dll"
-                  Source="release\libwinpthread-1.dll"/>
+                  Source="..\build_win32\release\libwinpthread-1.dll"/>
 	    </Component>
             <Component Win64="yes"
                 Id="Checker64"
@@ -238,7 +238,7 @@
 	      <File
 		  Id="checker32"
 		  Name="vamp-plugin-load-checker-32.exe"
-		  Source="release\vamp-plugin-load-checker-32.exe"/>
+		  Source="..\build_win32\release\vamp-plugin-load-checker.exe"/>
 	    </Component>
 	    
 	  </Directory> <!-- helpers -->
@@ -253,7 +253,7 @@
             <File
                 Id="Vamp32README"
                 Name="README.txt"
-                Source="..\sonic-visualiser\deploy\win64\README-Vamp32.txt"/>
+                Source="..\deploy\win64\README-Vamp32.txt"/>
           </Component>
         </Directory>
       </Directory>
@@ -303,13 +303,13 @@
     <Property Id="WIXUI_DONTVALIDATEPATH" Value="1" />
     <Property Id="ApplicationFolderName" Value="Sonic Visualiser" />
     <Property Id="WixAppFolder" Value="WixPerMachineFolder" />
-    <WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
+    <WixVariable Id="WixUILicenseRtf" Value="..\deploy\win64\License.rtf" />
     
-    <Icon Id="winicon.ico" SourceFile="..\sonic-visualiser\icons\sv-winicon.ico"/>
+    <Icon Id="winicon.ico" SourceFile="..\icons\sv-winicon.ico"/>
     <Property Id="ARPPRODUCTICON" Value="winicon.ico" />
 
-    <WixVariable Id="WixUIBannerBmp" Value="..\sonic-visualiser\deploy\win32\top.bmp"/>
-    <WixVariable Id="WixUIDialogBmp" Value="..\sonic-visualiser\deploy\win32\main.bmp"/>
+    <WixVariable Id="WixUIBannerBmp" Value="..\deploy\win32\top.bmp"/>
+    <WixVariable Id="WixUIDialogBmp" Value="..\deploy\win32\main.bmp"/>
 
   </Product>
 </Wix>
--- a/noconfig.pri	Fri May 18 13:49:23 2018 +0100
+++ b/noconfig.pri	Thu May 24 16:19:50 2018 +0100
@@ -30,6 +30,7 @@
 # these.
 
 LIBS += \
+        -lbase \
         -lbz2 \
 	-lrubberband \
 	-lfftw3 \
@@ -56,9 +57,9 @@
 
     # This config is currently used for 32-bit Windows builds.
 
-    INCLUDEPATH += sv-dependency-builds/win32-mingw/include
+    INCLUDEPATH += $$PWD/sv-dependency-builds/win32-mingw/include
 
-    LIBS += -Lrelease -Lsv-dependency-builds/win32-mingw/lib -L../sonic-visualiser/sv-dependency-builds/win32-mingw/lib
+    LIBS += -Lrelease -L$$PWD/sv-dependency-builds/win32-mingw/lib
 
     DEFINES += NOMINMAX _USE_MATH_DEFINES CAPNP_LITE
 
@@ -78,7 +79,7 @@
     # we want to do 32-bit builds with MSVC as well, then we'll
     # need to add a way to distinguish the two.
     
-    INCLUDEPATH += sv-dependency-builds/win64-msvc/include
+    INCLUDEPATH += $$PWD/sv-dependency-builds/win64-msvc/include
 
 ## This seems to be intruding even when we're supposed to be release
 #    CONFIG(debug) {
@@ -88,7 +89,7 @@
 #    }
     CONFIG(release) {
         LIBS += -Lrelease \
-            -L../sonic-visualiser/sv-dependency-builds/win64-msvc/lib
+            -L$$PWD/sv-dependency-builds/win64-msvc/lib
     }
 
     DEFINES += NOMINMAX _USE_MATH_DEFINES CAPNP_LITE
@@ -113,8 +114,8 @@
 
     # All Mac builds are 64-bit these days.
 
-    INCLUDEPATH += sv-dependency-builds/osx/include
-    LIBS += -Lsv-dependency-builds/osx/lib
+    INCLUDEPATH += $$PWD/sv-dependency-builds/osx/include
+    LIBS += -L$$PWD/sv-dependency-builds/osx/lib
 
     QMAKE_CXXFLAGS_RELEASE += -O3 -ffast-math
 
--- a/sonic-visualiser.pro	Fri May 18 13:49:23 2018 +0100
+++ b/sonic-visualiser.pro	Thu May 24 16:19:50 2018 +0100
@@ -1,6 +1,9 @@
 
 TEMPLATE = subdirs
 
+SUBDIRS += \
+        sub_base
+
 # We build the tests on every platform, though at the time of
 # writing they are only automatically run on non-Windows platforms
 # (because of the difficulty of getting them running nicely in the
@@ -16,6 +19,8 @@
         sub_convert \
 	sub_sv
 
+sub_base.file = base.pro
+        
 sub_test_svcore_base.file = test-svcore-base.pro
 sub_test_svcore_data_fileio.file = test-svcore-data-fileio.pro
 sub_test_svcore_data_model.file = test-svcore-data-model.pro