| 1 |
@rem Copyright 2016 gRPC authors. |
| 2 |
@rem |
| 3 |
@rem Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
@rem you may not use this file except in compliance with the License. |
| 5 |
@rem You may obtain a copy of the License at |
| 6 |
@rem |
| 7 |
@rem http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
@rem |
| 9 |
@rem Unless required by applicable law or agreed to in writing, software |
| 10 |
@rem distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
@rem See the License for the specific language governing permissions and |
| 13 |
@rem limitations under the License. |
| 14 |
|
| 15 |
mkdir -p %ARTIFACTS_OUT% |
| 16 |
|
| 17 |
@rem enter repo root |
| 18 |
cd /d %~dp0\..\..\.. |
| 19 |
|
| 20 |
mkdir cmake |
| 21 |
cd cmake |
| 22 |
mkdir build |
| 23 |
cd build |
| 24 |
|
| 25 |
@rem Use externally provided env to determine build parallelism, otherwise use default. |
| 26 |
if "%GRPC_PROTOC_BUILD_COMPILER_JOBS%"=="" ( |
| 27 |
set GRPC_PROTOC_BUILD_COMPILER_JOBS=2 |
| 28 |
) |
| 29 |
|
| 30 |
@rem set cl.exe build environment to build with VS2015 tooling |
| 31 |
@rem this is required for Ninja build to work |
| 32 |
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" %ARCHITECTURE% |
| 33 |
@rem restore command echo |
| 34 |
echo on |
| 35 |
|
| 36 |
@rem Select MSVC compiler (cl.exe) explicitly to make sure we don't end up gcc from mingw or cygwin |
| 37 |
@rem (both are on path in kokoro win workers) |
| 38 |
cmake -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DgRPC_BUILD_TESTS=OFF -DgRPC_MSVC_STATIC_RUNTIME=ON ../../.. || goto :error |
| 39 |
|
| 40 |
ninja -j%GRPC_PROTOC_BUILD_COMPILER_JOBS% protoc plugins || goto :error |
| 41 |
cd ..\.. |
| 42 |
|
| 43 |
xcopy /Y cmake\build\third_party\protobuf\protoc.exe %ARTIFACTS_OUT%\ || goto :error |
| 44 |
xcopy /Y cmake\build\*_plugin.exe %ARTIFACTS_OUT%\ || goto :error |
| 45 |
|
| 46 |
goto :EOF |
| 47 |
|
| 48 |
:error |
| 49 |
exit /b 1 |