-
Notifications
You must be signed in to change notification settings - Fork 519
/
build_test.bat
39 lines (30 loc) · 1.38 KB
/
build_test.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
SET MODE="Release"
SET TOPSRCDIR=%cd%
SET VERB=Build
if NOT "%1" == "" SET VERB="%1"
rem call build_sdk.bat || goto :error
cd %TOPSRCDIR%
Call :BUILD_TEST x86 || goto :error
Call :BUILD_TEST x64 || goto :error
Call :BUILD_TEST ARM64 || goto :error
exit /b
:BUILD_TEST
set TOOLSET=%1
if "%1" == "ARM64" set TOOLSET=amd64_arm64
for /f "usebackq delims=#" %%a in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -version 17 -property installationPath`) do call "%%a\VC\Auxiliary\Build\vcvarsall.bat" %TOOLSET%
if %ERRORLEVEL% NEQ 0 goto :error
msbuild /p:ForceImportBeforeCppTargets="%CD%\test\static.props" ".\Examples-pcap\MakeAll.sln" /m /t:%VERB% /p:Configuration=%MODE% /p:Platform="%1" || goto :error
msbuild /p:ForceImportBeforeCppTargets="%CD%\test\static.props" ".\Examples\sendcap\sendcap.vcxproj" /m /t:%VERB% /p:Configuration=%MODE% /p:Platform="%1" || goto :error
if NOT "%VERB%" == "Build" goto :EOF
set BINDIR=%1\
if "%1" == "x86" set BINDIR=""
mkdir test\%1\
copy /b ".\Examples-pcap\%BINDIR%%MODE%\iflist.exe" test\%1\
copy /b ".\Examples-pcap\%BINDIR%%MODE%\pcap_filter.exe" test\%1\
copy /b ".\Examples-pcap\%BINDIR%%MODE%\sendpack.exe" test\%1\
copy /b ".\Examples-pcap\%BINDIR%%MODE%\readfile.exe" test\%1\
copy /b ".\Examples\sendcap\%BINDIR%%MODE%\sendcap.exe" test\%1\
goto :EOF
:error
echo Something failed: %ERRORLEVEL%
exit /b 1