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@rem Builds C# artifacts on Windows 16 17set ARCHITECTURE=%1 18 19@rem enter repo root 20cd /d %~dp0\..\..\.. 21 22mkdir cmake 23cd cmake 24mkdir build 25cd build 26mkdir %ARCHITECTURE% 27cd %ARCHITECTURE% 28 29@rem TODO(jtattermusch): is there a better way to force using MSVC? 30@rem select the MSVC compiler explicitly to avoid using gcc from mingw or cygwin 31@rem (both are on path) 32set "MSVC_COMPILER=C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe" 33if "%ARCHITECTURE%" == "x64" ( 34 set "MSVC_COMPILER=C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe" 35) 36 37call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" %ARCHITECTURE% 38cmake -G Ninja -DCMAKE_C_COMPILER="%MSVC_COMPILER%" -DCMAKE_CXX_COMPILER="%MSVC_COMPILER%" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DgRPC_BUILD_TESTS=OFF -DgRPC_MSVC_STATIC_RUNTIME=ON ../../.. || goto :error 39cmake --build . --target grpc_csharp_ext 40cd ..\..\.. 41 42mkdir -p %ARTIFACTS_OUT% 43copy /Y cmake\build\%ARCHITECTURE%\grpc_csharp_ext.dll %ARTIFACTS_OUT% || goto :error 44copy /Y cmake\build\%ARCHITECTURE%\grpc_csharp_ext.pdb %ARTIFACTS_OUT% || goto :error 45 46goto :EOF 47 48:error 49echo Failed! 50exit /b %errorlevel% 51