fgmeta/build_release_windows.bat

181 lines
6.8 KiB
Batchfile
Raw Normal View History

IF NOT DEFINED WORKSPACE SET WORKSPACE=%~dp0
2017-12-23 19:21:07 +08:00
IF NOT DEFINED IS_NIGHTLY_BUILD SET IS_NIGHTLY_BUILD=1
IF %IS_NIGHTLY_BUILD% EQU 1 (
SET FGBUILDTYPE=Nightly
) ELSE (
SET FGBUILDTYPE=Release
)
2016-08-02 18:18:42 +08:00
REM following are for testing the script locally
REM SET PATH=%PATH%;%ProgramFiles%\CMake\bin;%ProgramFiles(x86)%\"Inno Setup 5"\
2016-08-02 18:18:42 +08:00
REM SET QT5SDK32=C:\Qt\5.6\msvc2015
REM SET QT5SDK64=C:\Qt\5.6\msvc2015_64
REM SET IS_NIGHTLY_BUILD=1
SET OSG32=%WORKSPACE%\install\msvc140\OpenSceneGraph
SET OSG64=%WORKSPACE%\install\msvc140-64\OpenSceneGraph
REM 32bits
md build-sg32
md build-fg32
md build-fg32-compositor
cd build-sg32
2016-08-02 18:18:42 +08:00
cmake ..\simgear -G "Visual Studio 14" ^
-DMSVC_3RDPARTY_ROOT=%WORKSPACE%/windows-3rd-party/msvc140 ^
-DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^
-DOSG_FSTREAM_EXPORT_FIXED=1 ^
-DCMAKE_PREFIX_PATH:PATH=%OSG32% ^
2016-08-02 18:18:42 +08:00
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140
2016-12-13 19:32:33 +08:00
cmake --build . --config RelWithDebInfo --target INSTALL
cd ..\build-fg32
2016-08-02 18:18:42 +08:00
cmake ..\flightgear -G "Visual Studio 14" ^
-DMSVC_3RDPARTY_ROOT=%WORKSPACE%/windows-3rd-party/msvc140 ^
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140 ^
-DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^
-DOSG_FSTREAM_EXPORT_FIXED=1 ^
-DCMAKE_PREFIX_PATH=%QT5SDK32%;%OSG32% ^
-DFG_BUILD_TYPE=%FGBUILDTYPE% ^
-DENABLE_SWIFT:BOOL=ON ^
-DENABLE_COMPOSITOR:BOOL=OFF
cmake --build . --config RelWithDebInfo --target INSTALL
cd ..\build-fg32-compositor
cmake ..\flightgear -G "Visual Studio 14" ^
-DMSVC_3RDPARTY_ROOT=%WORKSPACE%/windows-3rd-party/msvc140 ^
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140/compositor ^
2020-05-04 02:02:26 +08:00
-DCMAKE_PREFIX_PATH:PATH=%QT5SDK32%;%OSG32%;%WORKSPACE%/install/msvc140/ ^
2016-08-02 18:18:42 +08:00
-DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^
-DOSG_FSTREAM_EXPORT_FIXED=1 ^
2019-05-23 19:38:02 +08:00
-DFG_BUILD_TYPE=%FGBUILDTYPE% ^
-DENABLE_SWIFT:BOOL=ON ^
-DENABLE_COMPOSITOR:BOOL=ON
2016-12-13 19:32:33 +08:00
cmake --build . --config RelWithDebInfo --target INSTALL
2015-03-08 19:51:15 +08:00
cd ..
REM 64 bits
md build-sg64
md build-fg64
md build-fg64-compositor
2016-11-15 05:29:04 +08:00
cd build-sg64
2016-08-02 18:18:42 +08:00
cmake ..\SimGear -G "Visual Studio 14 Win64" ^
-DMSVC_3RDPARTY_ROOT=%WORKSPACE%/windows-3rd-party/msvc140 ^
-DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^
-DOSG_FSTREAM_EXPORT_FIXED=1 ^
-DCMAKE_PREFIX_PATH:PATH=%OSG64% ^
2016-08-02 18:18:42 +08:00
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140-64
2016-12-13 19:32:33 +08:00
cmake --build . --config RelWithDebInfo --target INSTALL
cd ..\build-fg64
2016-08-02 18:18:42 +08:00
cmake ..\flightgear -G "Visual Studio 14 Win64" ^
-DMSVC_3RDPARTY_ROOT=%WORKSPACE%/windows-3rd-party/msvc140 ^
-DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140-64 ^
-DCMAKE_PREFIX_PATH=%QT5SDK64%;%OSG64% ^
-DOSG_FSTREAM_EXPORT_FIXED=1 ^
2019-05-23 19:38:02 +08:00
-DFG_BUILD_TYPE=%FGBUILDTYPE% ^
-DENABLE_SWIFT:BOOL=ON ^
-DENABLE_COMPOSITOR:BOOL=OFF
2016-12-13 19:32:33 +08:00
cmake --build . --config RelWithDebInfo --target INSTALL
cd ..\build-fg64-compositor
cmake ..\flightgear -G "Visual Studio 14 Win64" ^
-DMSVC_3RDPARTY_ROOT=%WORKSPACE%/windows-3rd-party/msvc140 ^
-DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140-64/compositor ^
-DCMAKE_PREFIX_PATH=%QT5SDK64%;%OSG64%;%WORKSPACE%/install/msvc140-64/ ^
-DOSG_FSTREAM_EXPORT_FIXED=1 ^
-DFG_BUILD_TYPE=%FGBUILDTYPE% ^
-DENABLE_SWIFT:BOOL=ON ^
-DENABLE_COMPOSITOR:BOOL=ON
cmake --build . --config RelWithDebInfo --target INSTALL
cd ..
REM Qt5 deployment
2017-12-23 16:26:30 +08:00
SET QMLDIR=%WORKSPACE%/flightgear/src/GUI/qml
%QT5SDK32%\bin\windeployqt --release --list target --qmldir %QMLDIR% %WORKSPACE%/install/msvc140/bin/fgfs.exe
%QT5SDK32%\bin\windeployqt --release --list target --qmldir %QMLDIR% %WORKSPACE%/install/msvc140/compositor/bin/fgfs.exe
2017-12-23 16:26:30 +08:00
%QT5SDK64%\bin\windeployqt --release --list target --qmldir %QMLDIR% %WORKSPACE%/install/msvc140-64/bin/fgfs.exe
%QT5SDK64%\bin\windeployqt --release --list target --qmldir %QMLDIR% %WORKSPACE%/install/msvc140-64/compositor/bin/fgfs.exe
REM build setup
ECHO Packaging root is %WORKSPACE%
subst X: /D
subst X: %WORKSPACE%.
2015-09-02 18:35:06 +08:00
REM ensure output dir is clean since we upload the entirety of it
rmdir /S /Q output
2015-09-02 18:35:06 +08:00
2017-04-18 15:57:35 +08:00
SET FGFS_PDB=src\Main\RelWithDebInfo\fgfs.pdb
SET SENTRY_ORG=flightgear
SET SENTRY_PROJECT=flightgear
REM ensure SENTRY_AUTH_TOKEN is set in the environment
sentry-cli upload-dif %WORKSPACE%\build-fg32\%FGFS_PDB%
sentry-cli upload-dif %WORKSPACE%\build-fg64\%FGFS_PDB%
sentry-cli upload-dif %WORKSPACE%\build-fg32-compositor\%FGFS_PDB%
sentry-cli upload-dif %WORKSPACE%\build-fg64-compositor\%FGFS_PDB%
REM indirect way to get command output into an environment variable
set PATH=%OSG32%\bin;%PATH%
osgversion --so-number > %TEMP%\osg-so-number.txt
osgversion --version-number > %TEMP%\osg-version.txt
osgversion --openthreads-soversion-number > %TEMP%\openthreads-so-number.txt
SET /P FLIGHTGEAR_VERSION=<flightgear\version
SET /P OSG_VERSION=<%TEMP%\osg-version.txt
SET /P OSG_SO_NUMBER=<%TEMP%\osg-so-number.txt
SET /P OT_SO_NUMBER=<%TEMP%\openthreads-so-number.txt
2015-03-14 02:13:19 +08:00
IF %IS_NIGHTLY_BUILD% EQU 1 (
REM FlightGear nightly: with fgdata, output filename would be "FlightGear-x.x.x-nightly-full.exe"
CALL :writeBaseConfig
CALL :writeNightlyFullConfig
iscc /Q FlightGear.iss
2015-03-14 02:13:19 +08:00
REM FlightGear nightly: without fgdata, output filename would be "FlightGear-x.x.x-nightly.exe"
CALL :writeBaseConfig
CALL :writeNightlyDietConfig
iscc /Q FlightGear.iss
2015-03-14 01:58:01 +08:00
) ELSE (
2015-03-14 02:13:19 +08:00
REM FlightGear release: with fgdata, output filename would be "FlightGear-x.x.x.exe"
CALL :writeBaseConfig
CALL :writeReleaseConfig
iscc /Q FlightGear.iss
)
2015-03-14 02:23:21 +08:00
GOTO End
:writeBaseConfig
ECHO #define FGVersion "%FLIGHTGEAR_VERSION%" > InstallConfig.iss
ECHO #define OSGVersion "%OSG_VERSION%" >> InstallConfig.iss
ECHO #define OSGSoNumber "%OSG_SO_NUMBER%" >> InstallConfig.iss
ECHO #define OTSoNumber "%OT_SO_NUMBER%" >> InstallConfig.iss
GOTO End
:writeReleaseConfig
CALL :writeBaseConfig
ECHO #define FGDetails "" >> InstallConfig.iss
ECHO #define IncludeData "TRUE" >> InstallConfig.iss
GOTO End
:writeNightlyFullConfig
CALL :writeBaseConfig
ECHO #define FGDetails "-nightly-full" >> InstallConfig.iss
ECHO #define IncludeData "TRUE" >> InstallConfig.iss
GOTO End
:writeNightlyDietConfig
CALL :writeBaseConfig
ECHO #define FGDetails "-nightly" >> InstallConfig.iss
ECHO #define IncludeData "FALSE" >> InstallConfig.iss
GOTO End
:End