Merge pull request #2576 from hunbernd/fix/msys2-2

Some enhancements for the msys2 build scripts
This commit is contained in:
G10h4ck 2022-02-01 12:53:35 +01:00 committed by GitHub
commit ef456b2ef7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 83 additions and 31 deletions

View file

@ -32,6 +32,16 @@ if not "%ParamNoupdate%"=="1" (
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" 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"
) )
:: Fix webui compilation (TODO: remove when whole RS switched to cmake)
if "%ParamWebui%"=="1" (
pushd "%SourcePath%"
copy "%SourcePath%\libretroshare\src\jsonapi\jsonapi-generator-doxygen.conf" "%SourcePath%\jsonapi-generator\src\jsonapi-generator-doxygen.conf" %Quite%
copy "%SourcePath%\libretroshare\src\jsonapi\async-method-wrapper-template.cpp.tmpl" "%SourcePath%\jsonapi-generator\src\async-method-wrapper-template.cpp.tmpl" %Quite%
copy "%SourcePath%\libretroshare\src\jsonapi\method-wrapper-template.cpp.tmpl" "%SourcePath%\jsonapi-generator\src\method-wrapper-template.cpp.tmpl" %Quite%
git update-index --assume-unchanged "jsonapi-generator\src\jsonapi-generator-doxygen.conf" "jsonapi-generator\src\async-method-wrapper-template.cpp.tmpl" "jsonapi-generator\src\method-wrapper-template.cpp.tmpl"
popd
)
:: Initialize environment :: Initialize environment
call "%~dp0env.bat" %* call "%~dp0env.bat" %*
if errorlevel 2 exit /B 2 if errorlevel 2 exit /B 2
@ -66,6 +76,7 @@ echo %RS_QMAKE_CONFIG% > buildinfo.txt
echo %RsBuildConfig% >> buildinfo.txt echo %RsBuildConfig% >> buildinfo.txt
echo %RsArchitecture% >> buildinfo.txt echo %RsArchitecture% >> buildinfo.txt
echo Qt %QtVersion% >> buildinfo.txt echo Qt %QtVersion% >> buildinfo.txt
echo %RsToolchain% >> buildinfo.txt
echo %RsCompiler% >> buildinfo.txt echo %RsCompiler% >> buildinfo.txt
call "%ToolsPath%\msys2-path.bat" "%SourcePath%" MSYS2SourcePath call "%ToolsPath%\msys2-path.bat" "%SourcePath%" MSYS2SourcePath

View file

@ -1,6 +1,4 @@
:: Process commandline parameter :: Process commandline parameter
set Param32=0
set Param64=0
set ParamRelease=0 set ParamRelease=0
set ParamDebug=0 set ParamDebug=0
set ParamAutologin=0 set ParamAutologin=0
@ -9,17 +7,40 @@ set ParamTor=0
set ParamWebui=0 set ParamWebui=0
set ParamClang=0 set ParamClang=0
set ParamIndexing=0 set ParamIndexing=0
set ParamFriendserver=0
set ParamNoupdate=0 set ParamNoupdate=0
set CoreCount=%NUMBER_OF_PROCESSORS% set CoreCount=%NUMBER_OF_PROCESSORS%
set RS_QMAKE_CONFIG= set RS_QMAKE_CONFIG=
set RsToolchain=
set tcc=0
:parameter_loop :parameter_loop
if "%~1" NEQ "" ( if "%~1" NEQ "" (
for /f "tokens=1,2 delims==" %%a in ("%~1") do ( for /f "tokens=1,2 delims==" %%a in ("%~1") do (
if "%%~a"=="32" ( if "%%~a"=="32" (
set Param32=1 set RsToolchain=mingw32
set /A tcc=tcc+1
) else if "%%~a"=="64" ( ) else if "%%~a"=="64" (
set Param64=1 set RsToolchain=mingw64
set /A tcc=tcc+1
) else if "%%~a"=="mingw32" (
set RsToolchain=mingw32
set /A tcc=tcc+1
) else if "%%~a"=="mingw64" (
set RsToolchain=mingw64
set /A tcc=tcc+1
) else if "%%~a"=="ucrt64" (
set RsToolchain=ucrt64
set /A tcc=tcc+1
) else if "%%~a"=="clang64" (
set RsToolchain=clang64
set /A tcc=tcc+1
) else if "%%~a"=="clang32" (
set RsToolchain=clang32
set /A tcc=tcc+1
) else if "%%~a"=="clangarm64" (
set RsToolchain=clangarm64
set /A tcc=tcc+1
) else if "%%~a"=="release" ( ) else if "%%~a"=="release" (
set ParamRelease=1 set ParamRelease=1
) else if "%%~a"=="debug" ( ) else if "%%~a"=="debug" (
@ -38,6 +59,8 @@ if "%~1" NEQ "" (
set ParamClang=1 set ParamClang=1
) else if "%%~a"=="indexing" ( ) else if "%%~a"=="indexing" (
set ParamIndexing=1 set ParamIndexing=1
) else if "%%~a"=="friendserver" (
set ParamFriendserver=1
) else if "%%~a"=="noupdate" ( ) else if "%%~a"=="noupdate" (
set ParamNoupdate=1 set ParamNoupdate=1
) else if "%%~a"=="CONFIG+" ( ) else if "%%~a"=="CONFIG+" (
@ -52,22 +75,37 @@ if "%~1" NEQ "" (
goto parameter_loop goto parameter_loop
) )
if "%Param32%"=="1" ( if %tcc% NEQ 1 (
if "%Param64%"=="1" ( echo Multiple or no toolchain specified
echo. goto :usage
echo 32-bit or 64-bit?
goto :usage
)
set RsBit=32
set RsArchitecture=x86
set RsMSYS2Architecture=i686
) )
if "%Param64%"=="1" ( if "%RsToolchain%"=="mingw32" (
set RsBit=64 set RsArchitecture=x86
set RsMSYS2Architecture=i686
set MSYSTEM=MINGW32
) else if "%RsToolchain%"=="mingw64" (
set RsArchitecture=x64 set RsArchitecture=x64
set RsMSYS2Architecture=x86_64 set RsMSYS2Architecture=x86_64
set MSYSTEM=MINGW64
) else if "%RsToolchain%"=="ucrt64" (
set RsArchitecture=x64
set RsMSYS2Architecture=ucrt-x86_64
set MSYSTEM=UCRT64
) else if "%RsToolchain%"=="clang64" (
set RsArchitecture=x64
set RsMSYS2Architecture=clang-x86_64
set MSYSTEM=CLANG64
set ParamClang=1
) else if "%RsToolchain%"=="clang32" (
set RsArchitecture=x86
set RsMSYS2Architecture=clang-i686
set MSYSTEM=CLANG32
set ParamClang=1
) else if "%RsToolchain%"=="clangarm64" (
set RsArchitecture=arm64
set RsMSYS2Architecture=clang-aarch64
set MSYSTEM=CLANGARM64
) )
if "%ParamClang%"=="1" ( if "%ParamClang%"=="1" (
@ -76,8 +114,6 @@ if "%ParamClang%"=="1" (
set RsCompiler=GCC set RsCompiler=GCC
) )
if "%RsBit%"=="" goto :usage
if "%ParamRelease%"=="1" ( if "%ParamRelease%"=="1" (
if "%ParamDebug%"=="1" ( if "%ParamDebug%"=="1" (
echo. echo.
@ -104,14 +140,21 @@ if "%ParamIndexing%"=="1" (
set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=rs_deep_channels_index" "CONFIG+=rs_deep_files_index" "CONFIG+=rs_deep_files_index_ogg" "CONFIG+=rs_deep_files_index_flac" "CONFIG+=rs_deep_files_index_taglib" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=rs_deep_channels_index" "CONFIG+=rs_deep_files_index" "CONFIG+=rs_deep_files_index_ogg" "CONFIG+=rs_deep_files_index_flac" "CONFIG+=rs_deep_files_index_taglib"
) )
if "%ParamFriendserver%"=="1" (
set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=rs_efs"
)
exit /B 0 exit /B 0
:usage :usage
echo. echo.
echo Usage: 32^|64 release^|debug [autologin plugins webui singlethread clang indexing noupdate] ["CONFIG+=..."] echo Usage: 32^|64^|other release^|debug [autologin plugins webui singlethread clang indexing friendserver noupdate] ["CONFIG+=..."]
echo. echo.
echo Mandatory parameter echo Mandatory parameter
echo 32^|64 32-bit or 64-bit Version echo 32^|64 32-bit or 64-bit version (same as mingw32 or mingw64)
echo Or you can specify any other toolchain supported by msys2:
echo mingw32^|mingw64^|clang32^|clang64^|ucrt64^|clangarm64
echo More info: https://www.msys2.org/docs/environments
echo release^|debug Build release or debug version echo release^|debug Build release or debug version
echo. echo.
echo Optional parameter (need clean when changed) echo Optional parameter (need clean when changed)
@ -121,6 +164,7 @@ echo webui Enable JsonAPI and pack webui files
echo singlethread Use only 1 thread for building echo singlethread Use only 1 thread for building
echo clang Use clang compiler instead of GCC echo clang Use clang compiler instead of GCC
echo indexing Build with deep channel and file indexing support echo indexing Build with deep channel and file indexing support
echo friendserver Enable friendserver support
echo noupdate Skip updating the libraries echo noupdate Skip updating the libraries
echo "CONFIG+=..." Enable some extra features, you can find the almost complete list in retroshare.pri echo "CONFIG+=..." Enable some extra features, you can find the almost complete list in retroshare.pri
echo. echo.

View file

@ -2,8 +2,6 @@ call "%~dp0env-base.bat" %*
if errorlevel 2 exit /B 2 if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env if errorlevel 1 goto error_env
set MSYSTEM=MINGW%RsBit%
set BuildPath=%EnvRootPath%\builds set BuildPath=%EnvRootPath%\builds
set DeployPath=%EnvRootPath%\deploy set DeployPath=%EnvRootPath%\deploy
@ -14,10 +12,10 @@ if not exist "%DeployPath%" mkdir "%DeployPath%"
call "%ToolsPath%\get-qt-version.bat" QtVersion call "%ToolsPath%\get-qt-version.bat" QtVersion
if "%QtVersion%"=="" %cecho% error "Cannot get Qt version." & exit /B 1 if "%QtVersion%"=="" %cecho% error "Cannot get Qt version." & exit /B 1
set RsMinGWPath=%EnvMSYS2BasePath%\mingw%RsBit% set RsMinGWPath=%EnvMSYS2BasePath%\%RsToolchain%
set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsArchitecture%-%RsCompiler%-%RsBuildConfig% set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsToolchain%-%RsCompiler%-%RsBuildConfig%
set RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsArchitecture%-%RsCompiler%-%RsBuildConfig% set RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsToolchain%-%RsCompiler%-%RsBuildConfig%
set RsPackPath=%DeployPath% set RsPackPath=%DeployPath%
set RsArchiveAdd= set RsArchiveAdd=
set RsWebuiPath=%RootPath%\%SourceName%-webui set RsWebuiPath=%RootPath%\%SourceName%-webui

View file

@ -105,6 +105,9 @@ copy "%RsBuildPath%\retroshare-nogui\src\%RsBuildConfig%\retroshare*-nogui.exe"
copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite% copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite%
copy "%RsBuildPath%\supportlibs\cmark\build\src\libcmark.dll" "%RsDeployPath%" %Quite% copy "%RsBuildPath%\supportlibs\cmark\build\src\libcmark.dll" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" copy "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" "%RsDeployPath%" %Quite% if exist "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" copy "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\retroshare-friendserver\src\%RsBuildConfig%\retroshare-friendserver.exe" (
copy "%RsBuildPath%\retroshare-friendserver\src\%RsBuildConfig%\retroshare-friendserver.exe" "%RsDeployPath%" %Quite%
)
echo copy extensions echo copy extensions
for /D %%D in ("%RsBuildPath%\plugins\*") do ( for /D %%D in ("%RsBuildPath%\plugins\*") do (

View file

@ -44,6 +44,7 @@ unix {
win32-g++|win32-clang-g++ { win32-g++|win32-clang-g++ {
dLib = ws2_32 iphlpapi crypt32 dLib = ws2_32 iphlpapi crypt32
LIBS *= $$linkDynamicLibs(dLib) LIBS *= $$linkDynamicLibs(dLib)
CONFIG += console
} }
################################### COMMON stuff ################################## ################################### COMMON stuff ##################################

View file

@ -87,12 +87,7 @@ macx {
################################# Windows ########################################## ################################# Windows ##########################################
win32-g++|win32-clang-g++ { win32-g++|win32-clang-g++ {
CONFIG(debug, debug|release) { CONFIG += console
# show console output
CONFIG += console
} else {
CONFIG -= console
}
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
} else { } else {