diff --git a/build_scripts/Windows-msys2/build/build.bat b/build_scripts/Windows-msys2/build/build.bat index 4d366f28c..972379aad 100644 --- a/build_scripts/Windows-msys2/build/build.bat +++ b/build_scripts/Windows-msys2/build/build.bat @@ -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" ) +:: 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 call "%~dp0env.bat" %* if errorlevel 2 exit /B 2 @@ -66,6 +76,7 @@ echo %RS_QMAKE_CONFIG% > buildinfo.txt echo %RsBuildConfig% >> buildinfo.txt echo %RsArchitecture% >> buildinfo.txt echo Qt %QtVersion% >> buildinfo.txt +echo %RsToolchain% >> buildinfo.txt echo %RsCompiler% >> buildinfo.txt call "%ToolsPath%\msys2-path.bat" "%SourcePath%" MSYS2SourcePath diff --git a/build_scripts/Windows-msys2/build/env-base.bat b/build_scripts/Windows-msys2/build/env-base.bat index 9d9fa5379..01a7a8f12 100644 --- a/build_scripts/Windows-msys2/build/env-base.bat +++ b/build_scripts/Windows-msys2/build/env-base.bat @@ -1,6 +1,4 @@ :: Process commandline parameter -set Param32=0 -set Param64=0 set ParamRelease=0 set ParamDebug=0 set ParamAutologin=0 @@ -9,17 +7,40 @@ set ParamTor=0 set ParamWebui=0 set ParamClang=0 set ParamIndexing=0 +set ParamFriendserver=0 set ParamNoupdate=0 set CoreCount=%NUMBER_OF_PROCESSORS% set RS_QMAKE_CONFIG= +set RsToolchain= +set tcc=0 :parameter_loop if "%~1" NEQ "" ( for /f "tokens=1,2 delims==" %%a in ("%~1") do ( if "%%~a"=="32" ( - set Param32=1 + set RsToolchain=mingw32 + set /A tcc=tcc+1 ) 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" ( set ParamRelease=1 ) else if "%%~a"=="debug" ( @@ -38,6 +59,8 @@ if "%~1" NEQ "" ( set ParamClang=1 ) else if "%%~a"=="indexing" ( set ParamIndexing=1 + ) else if "%%~a"=="friendserver" ( + set ParamFriendserver=1 ) else if "%%~a"=="noupdate" ( set ParamNoupdate=1 ) else if "%%~a"=="CONFIG+" ( @@ -52,22 +75,37 @@ if "%~1" NEQ "" ( goto parameter_loop ) -if "%Param32%"=="1" ( - if "%Param64%"=="1" ( - echo. - echo 32-bit or 64-bit? - goto :usage - ) - - set RsBit=32 - set RsArchitecture=x86 - set RsMSYS2Architecture=i686 +if %tcc% NEQ 1 ( + echo Multiple or no toolchain specified + goto :usage ) -if "%Param64%"=="1" ( - set RsBit=64 +if "%RsToolchain%"=="mingw32" ( + set RsArchitecture=x86 + set RsMSYS2Architecture=i686 + set MSYSTEM=MINGW32 +) else if "%RsToolchain%"=="mingw64" ( set RsArchitecture=x64 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" ( @@ -76,8 +114,6 @@ if "%ParamClang%"=="1" ( set RsCompiler=GCC ) -if "%RsBit%"=="" goto :usage - if "%ParamRelease%"=="1" ( if "%ParamDebug%"=="1" ( 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" ) +if "%ParamFriendserver%"=="1" ( + set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=rs_efs" +) + exit /B 0 :usage 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 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. 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 clang Use clang compiler instead of GCC echo indexing Build with deep channel and file indexing support +echo friendserver Enable friendserver support echo noupdate Skip updating the libraries echo "CONFIG+=..." Enable some extra features, you can find the almost complete list in retroshare.pri echo. diff --git a/build_scripts/Windows-msys2/build/env.bat b/build_scripts/Windows-msys2/build/env.bat index bfe2afeba..c8cb71ff4 100644 --- a/build_scripts/Windows-msys2/build/env.bat +++ b/build_scripts/Windows-msys2/build/env.bat @@ -2,8 +2,6 @@ call "%~dp0env-base.bat" %* if errorlevel 2 exit /B 2 if errorlevel 1 goto error_env -set MSYSTEM=MINGW%RsBit% - set BuildPath=%EnvRootPath%\builds set DeployPath=%EnvRootPath%\deploy @@ -14,10 +12,10 @@ if not exist "%DeployPath%" mkdir "%DeployPath%" call "%ToolsPath%\get-qt-version.bat" QtVersion 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 RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsArchitecture%-%RsCompiler%-%RsBuildConfig% +set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsToolchain%-%RsCompiler%-%RsBuildConfig% +set RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsToolchain%-%RsCompiler%-%RsBuildConfig% set RsPackPath=%DeployPath% set RsArchiveAdd= set RsWebuiPath=%RootPath%\%SourceName%-webui diff --git a/build_scripts/Windows-msys2/build/pack.bat b/build_scripts/Windows-msys2/build/pack.bat index 4948c1541..ceefd0144 100644 --- a/build_scripts/Windows-msys2/build/pack.bat +++ b/build_scripts/Windows-msys2/build/pack.bat @@ -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%\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%\retroshare-friendserver\src\%RsBuildConfig%\retroshare-friendserver.exe" ( + copy "%RsBuildPath%\retroshare-friendserver\src\%RsBuildConfig%\retroshare-friendserver.exe" "%RsDeployPath%" %Quite% +) echo copy extensions for /D %%D in ("%RsBuildPath%\plugins\*") do ( diff --git a/retroshare-friendserver/src/retroshare-friendserver.pro b/retroshare-friendserver/src/retroshare-friendserver.pro index 61c604e43..a566a0927 100644 --- a/retroshare-friendserver/src/retroshare-friendserver.pro +++ b/retroshare-friendserver/src/retroshare-friendserver.pro @@ -44,6 +44,7 @@ unix { win32-g++|win32-clang-g++ { dLib = ws2_32 iphlpapi crypt32 LIBS *= $$linkDynamicLibs(dLib) + CONFIG += console } ################################### COMMON stuff ################################## diff --git a/retroshare-service/src/retroshare-service.pro b/retroshare-service/src/retroshare-service.pro index 2c7a3d094..6458e03ed 100644 --- a/retroshare-service/src/retroshare-service.pro +++ b/retroshare-service/src/retroshare-service.pro @@ -87,12 +87,7 @@ macx { ################################# Windows ########################################## win32-g++|win32-clang-g++ { - CONFIG(debug, debug|release) { - # show console output - CONFIG += console - } else { - CONFIG -= console - } + CONFIG += console CONFIG(debug, debug|release) { } else {