• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1setlocal
2
3IF %platform%==MinGW GOTO build_mingw
4IF %language%==cpp GOTO build_cpp
5IF %language%==csharp GOTO build_csharp
6
7echo Unsupported language %language% and platform %platform%. Exiting.
8goto :error
9
10:build_mingw
11echo Building MinGW
12set PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH:C:\Program Files\Git\usr\bin;=%
13mkdir build_mingw
14cd build_mingw
15cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% -Dprotobuf_BUILD_TESTS=0 ../cmake
16mingw32-make -j8 all || goto error
17rem cd %configuration%
18rem tests.exe || goto error
19goto :EOF
20
21:build_cpp
22echo Building C++
23mkdir build_msvc
24cd build_msvc
25cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% ../cmake
26msbuild protobuf.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error
27cd %configuration%
28tests.exe || goto error
29goto :EOF
30
31:build_csharp
32echo Building C#
33cd csharp\src
34REM The platform environment variable is implicitly used by msbuild;
35REM we don't want it.
36set platform=
37dotnet restore
38dotnet build -c %configuration% || goto error
39
40echo Testing C#
41dotnet test -c %configuration% -f netcoreapp2.1 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
42dotnet test -c %configuration% -f net451 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
43
44goto :EOF
45
46:error
47echo Failed!
48EXIT /b %ERRORLEVEL%
49