-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] Pre-build x86 viosock libraries as needed
1. Pre-builds x86 viosock libraries when building virtio-win.sln or viosock.sln for amd64 in the circumstances the required x86 libraries do not already exist. 2. Provides framework for other drivers requiring pre-built x86 libraries. Implemented in new file: prebuild_x86_libs.bat Split from PR #1212. Signed-off-by: benyamin-codez <[email protected]>
- Loading branch information
1 parent
6607ef3
commit 1088f21
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
@echo off | ||
setlocal | ||
rem Check for x86 viosock libraries and build them if needed... | ||
call :do_viosock %* | ||
if ERRORLEVEL 1 ( | ||
endlocal | ||
exit /B 1 | ||
) | ||
endlocal | ||
goto :eof | ||
|
||
:do_viosock | ||
rem Lay up some variables | ||
set BUILD_FILE=%~1 | ||
set BUILD_ARCH=%~2 | ||
set BUILD_DIR=%~3 | ||
set TARGET=%~4 | ||
set BUILD_FLAVOUR=%~5 | ||
set VIOSOCK_PREBUILD_X86_LIBS= | ||
set BUILD_FAILED= | ||
|
||
rem Which solutions need this? | ||
if "%BUILD_FILE%"=="virtio-win.sln" ( | ||
set VIOSOCK_PREBUILD_X86_LIBS=1 | ||
) | ||
if "%BUILD_FILE%"=="viosock.sln" ( | ||
set VIOSOCK_PREBUILD_X86_LIBS=1 | ||
) | ||
|
||
if "%VIOSOCK_PREBUILD_X86_LIBS%" EQU "1" ( | ||
rem Only proceed if we are building for x64 | ||
if %BUILD_ARCH%==x64 ( | ||
rem Check for x86 viosock libraries and build them if needed... | ||
if not exist "%BUILD_DIR%viosock\lib\x86\%TARGET%%BUILD_FLAVOR%\viosocklib.dll" ( | ||
echo. | ||
echo ATTENTION ^: Need to build x86 viosock libraries before building for amd64... | ||
setlocal | ||
set VIRTIO_WIN_NO_ARM=1 | ||
if "%BUILD_FILE%"=="virtio-win.sln" ( | ||
pushd "%BUILD_DIR%viosock\lib" | ||
) | ||
if "%BUILD_FILE%"=="viosock.sln" ( | ||
pushd "%BUILD_DIR%lib" | ||
) | ||
call ..\..\build\build.bat viosocklib.vcxproj %TARGET% x86 | ||
if ERRORLEVEL 1 ( | ||
set BUILD_FAILED=1 | ||
) | ||
popd | ||
if "%BUILD_FAILED%" EQU "1" ( | ||
exit /B 1 | ||
) | ||
echo Successfully built the x86 viosock libraries. | ||
echo. | ||
echo Continuing with amd64 build... | ||
endlocal | ||
) | ||
) | ||
) | ||
goto :eof |