mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
Use MSYS2 to build external libraries for Windows compile
This commit is contained in:
parent
096c996153
commit
ef03b12956
10 changed files with 647 additions and 13 deletions
51
build_scripts/Windows/build-libs/build-libs.bat
Normal file
51
build_scripts/Windows/build-libs/build-libs.bat
Normal file
|
@ -0,0 +1,51 @@
|
|||
:: Usage:
|
||||
:: call build-libs.bat [make tasks]
|
||||
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
:: Parameter
|
||||
set MakeParam="DOWNLOAD_PATH=../../download"
|
||||
|
||||
set MakeTask=
|
||||
:param_loop
|
||||
if "%~1" NEQ "" (
|
||||
set MakeTask=%MakeTask% %1
|
||||
shift /1
|
||||
goto param_loop
|
||||
)
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0..\env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
call "%EnvPath%\env-msys2.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
:: Check MSYS environment
|
||||
if not exist "%EnvMSYS2SH%" %cecho% error "Please install MSYS2 first." & exit /B 1
|
||||
|
||||
:: Initialize environment
|
||||
call "%~dp0env.bat"
|
||||
if errorlevel 1 goto error_env
|
||||
|
||||
call "%ToolsPath%\msys-path.bat" "%~dp0" MSYS2CurPath
|
||||
call "%ToolsPath%\msys-path.bat" "%BuildLibsPath%" MSYS2BuildLibsPath
|
||||
|
||||
if not exist "%BuildLibsPath%" mkdir "%BuildLibsPath%"
|
||||
|
||||
set MSYSTEM=MINGW%MSYS2Base%
|
||||
set MSYS2_PATH_TYPE=inherit
|
||||
|
||||
%EnvMSYS2Cmd% "pacman --needed --noconfirm -S diffutils perl tar make mingw-w64-%MSYS2Architecture%-make"
|
||||
::mingw-w64-%MSYS2Architecture%-cmake
|
||||
::%EnvMSYS2Cmd% "pacman --noconfirm -Rd --nodeps mingw-w64-%MSYS2Architecture%-zlib"
|
||||
|
||||
%EnvMSYS2Cmd% "cd "%MSYS2BuildLibsPath%" && make -f %MSYS2CurPath%/makefile %MakeParam% %MakeTask%"
|
||||
|
||||
exit /B %ERRORLEVEL%
|
||||
|
||||
:error_env
|
||||
echo Failed to initialize environment.
|
||||
endlocal
|
||||
exit /B 1
|
Loading…
Add table
Add a link
Reference in a new issue