2018-10-13 07:19:22 -04:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
setlocal
|
|
|
|
|
|
|
|
:: Initialize environment
|
|
|
|
call "%~dp0..\env.bat"
|
|
|
|
if errorlevel 1 goto error_env
|
|
|
|
call "%EnvPath%\env.bat"
|
|
|
|
if errorlevel 1 goto error_env
|
|
|
|
call "%EnvPath%\env.bat"
|
|
|
|
if errorlevel 1 goto error_env
|
|
|
|
call "%EnvPath%\env-msys2.bat"
|
|
|
|
if errorlevel 1 goto error_env
|
|
|
|
|
|
|
|
:: Initialize base environment
|
|
|
|
call "%~dp0env-base.bat" %*
|
|
|
|
if errorlevel 2 exit /B 2
|
|
|
|
if errorlevel 1 goto error_env
|
|
|
|
|
2020-06-01 08:01:36 -04:00
|
|
|
if not "%ParamNoupdate%"=="1" (
|
|
|
|
:: Install needed things
|
|
|
|
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S make git mingw-w64-%RsMSYS2Architecture%-toolchain mingw-w64-%RsMSYS2Architecture%-qt5 mingw-w64-%RsMSYS2Architecture%-miniupnpc mingw-w64-%RsMSYS2Architecture%-sqlcipher mingw-w64-%RsMSYS2Architecture%-cmake"
|
2020-05-29 17:06:21 -04:00
|
|
|
|
2020-06-01 08:01:36 -04:00
|
|
|
:: Webui
|
|
|
|
if "%ParamWebui%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-doxygen mingw-w64-%RsMSYS2Architecture%-rapidjson"
|
2018-10-13 07:19:22 -04:00
|
|
|
|
2020-06-01 08:01:36 -04:00
|
|
|
:: Plugins
|
|
|
|
if "%ParamPlugins%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-speex mingw-w64-%RsMSYS2Architecture%-speexdsp mingw-w64-%RsMSYS2Architecture%-curl mingw-w64-%RsMSYS2Architecture%-libxslt mingw-w64-%RsMSYS2Architecture%-opencv mingw-w64-%RsMSYS2Architecture%-ffmpeg"
|
2018-10-13 07:19:22 -04:00
|
|
|
|
2020-06-01 08:01:36 -04:00
|
|
|
:: Clang
|
|
|
|
if "%ParamClang%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-clang"
|
2020-05-29 20:16:59 -04:00
|
|
|
|
2020-06-01 08:01:36 -04:00
|
|
|
:: Indexing
|
|
|
|
if "%ParamIndexing%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-xapian-core mingw-w64-%RsMSYS2Architecture%-libvorbis mingw-w64-%RsMSYS2Architecture%-flac mingw-w64-%RsMSYS2Architecture%-taglib"
|
|
|
|
)
|
2020-05-31 18:53:31 -04:00
|
|
|
|
2018-10-13 07:19:22 -04:00
|
|
|
:: Initialize environment
|
|
|
|
call "%~dp0env.bat" %*
|
|
|
|
if errorlevel 2 exit /B 2
|
|
|
|
if errorlevel 1 goto error_env
|
|
|
|
|
|
|
|
echo.
|
|
|
|
echo === Version
|
|
|
|
echo.
|
|
|
|
|
|
|
|
title Build - %SourceName%-%RsBuildConfig% [Version]
|
|
|
|
|
|
|
|
pushd "%SourcePath%\retroshare-gui\src\gui\images"
|
|
|
|
:: Touch resource file
|
|
|
|
copy /b retroshare_win.rc +,,
|
|
|
|
popd
|
|
|
|
|
|
|
|
if not exist "%RsBuildPath%" mkdir "%RsBuildPath%"
|
|
|
|
pushd "%RsBuildPath%"
|
|
|
|
|
|
|
|
echo.
|
|
|
|
echo === qmake
|
|
|
|
echo.
|
|
|
|
|
|
|
|
title Build - %SourceName%-%RsBuildConfig% [qmake]
|
|
|
|
|
2018-12-31 15:36:09 -05:00
|
|
|
set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=%RsBuildConfig%"
|
2018-10-13 07:19:22 -04:00
|
|
|
if "%ParamAutologin%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=rs_autologin"
|
|
|
|
if "%ParamPlugins%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=retroshare_plugins"
|
|
|
|
|
2020-05-23 10:10:11 -04:00
|
|
|
:: Dump the active build config into a file
|
|
|
|
echo %RS_QMAKE_CONFIG% > buildinfo.txt
|
|
|
|
echo %RsBuildConfig% >> buildinfo.txt
|
|
|
|
echo %RsArchitecture% >> buildinfo.txt
|
|
|
|
echo Qt %QtVersion% >> buildinfo.txt
|
|
|
|
|
2018-10-13 07:19:22 -04:00
|
|
|
call "%ToolsPath%\msys2-path.bat" "%SourcePath%" MSYS2SourcePath
|
|
|
|
call "%ToolsPath%\msys2-path.bat" "%EnvMSYS2Path%" MSYS2EnvMSYS2Path
|
2020-05-29 20:16:59 -04:00
|
|
|
if "%ParamClang%"=="1" (
|
|
|
|
%EnvMSYS2Cmd% "qmake "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-clang-g++ %RS_QMAKE_CONFIG%"
|
|
|
|
) else (
|
|
|
|
%EnvMSYS2Cmd% "qmake "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-g++ %RS_QMAKE_CONFIG%"
|
|
|
|
)
|
2018-10-13 07:19:22 -04:00
|
|
|
if errorlevel 1 goto error
|
|
|
|
|
|
|
|
echo.
|
|
|
|
echo === make
|
|
|
|
echo.
|
|
|
|
|
|
|
|
title Build - %SourceName%-%RsBuildConfig% [make]
|
|
|
|
|
2020-05-24 12:24:58 -04:00
|
|
|
%EnvMSYS2Cmd% "make -j %CoreCount%"
|
2018-10-13 07:19:22 -04:00
|
|
|
|
2020-05-23 16:05:44 -04:00
|
|
|
:: Webui
|
|
|
|
if "%ParamWebui%"=="1" (
|
|
|
|
call "%~dp0..\tools\webui.bat"
|
|
|
|
)
|
|
|
|
|
2018-10-13 07:19:22 -04:00
|
|
|
:error
|
|
|
|
popd
|
|
|
|
|
|
|
|
title %COMSPEC%
|
|
|
|
|
|
|
|
if errorlevel 1 echo.& echo Build failed& echo.
|
|
|
|
exit /B %ERRORLEVEL%
|
|
|
|
|
|
|
|
:error_env
|
|
|
|
echo Failed to initialize environment.
|
|
|
|
endlocal
|
|
|
|
exit /B 1
|