From e3e2106fad7bde3638a0b0753ba1b1e225e30a89 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 9 Dec 2016 11:09:34 +0100 Subject: [PATCH] make protobuf building consistent --- templates/vsprojects/protobuf.props.template | 2 +- templates/vsprojects/protoc.props.template | 2 +- tools/run_tests/build_artifact_protoc.bat | 9 +++++---- vsprojects/README.md | 6 ++++-- vsprojects/build_plugins.bat | 2 +- vsprojects/protobuf.props | 2 +- vsprojects/protoc.props | 2 +- 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/templates/vsprojects/protobuf.props.template b/templates/vsprojects/protobuf.props.template index 48f9431c1cf..3ae7c745ded 100644 --- a/templates/vsprojects/protobuf.props.template +++ b/templates/vsprojects/protobuf.props.template @@ -6,7 +6,7 @@ libprotobuf.lib;%(AdditionalDependencies) - $(SolutionDir)\..\third_party\protobuf\cmake\$(Configuration);%(AdditionalLibraryDirectories) + $(SolutionDir)\..\third_party\protobuf\cmake\build\solution\$(Configuration);%(AdditionalLibraryDirectories) diff --git a/templates/vsprojects/protoc.props.template b/templates/vsprojects/protoc.props.template index ced6028a4be..2c3844a9a4e 100644 --- a/templates/vsprojects/protoc.props.template +++ b/templates/vsprojects/protoc.props.template @@ -9,7 +9,7 @@ libprotoc.lib;%(AdditionalDependencies) - $(SolutionDir)\..\third_party\protobuf\cmake\$(Configuration);%(AdditionalLibraryDirectories) + $(SolutionDir)\..\third_party\protobuf\cmake\build\solution\$(Configuration);%(AdditionalLibraryDirectories) diff --git a/tools/run_tests/build_artifact_protoc.bat b/tools/run_tests/build_artifact_protoc.bat index 3246a903d0b..b2bf86da404 100644 --- a/tools/run_tests/build_artifact_protoc.bat +++ b/tools/run_tests/build_artifact_protoc.bat @@ -30,15 +30,16 @@ mkdir artifacts setlocal -cd third_party/protobuf +cd third_party/protobuf/cmake -cd cmake -cmake -G "%generator%" -Dprotobuf_BUILD_TESTS=OFF || goto :error +mkdir build & cd build +mkdir solution & cd solution +cmake -G "%generator%" -Dprotobuf_BUILD_TESTS=OFF ../.. || goto :error endlocal call vsprojects/build_plugins.bat || goto :error -xcopy /Y third_party\protobuf\cmake\Release\protoc.exe artifacts\ || goto :error +xcopy /Y third_party\protobuf\cmake\build\solution\Release\protoc.exe artifacts\ || goto :error xcopy /Y vsprojects\Release\*_plugin.exe artifacts\ || xcopy /Y vsprojects\x64\Release\*_plugin.exe artifacts\ || goto :error goto :EOF diff --git a/vsprojects/README.md b/vsprojects/README.md index 56d9f560098..7af69c2726b 100644 --- a/vsprojects/README.md +++ b/vsprojects/README.md @@ -83,10 +83,12 @@ Windows .exe binaries of gRPC protoc plugins. 1. Follow instructions in `third_party\protobuf\cmake\README.md` to create Visual Studio 2013 projects for protobuf. ``` $ cd third_party/protobuf/cmake -$ cmake -G "Visual Studio 12 2013" +$ mkdir build & cd build +$ mkdir solution & cd solution +$ cmake -G "Visual Studio 12 2013" -Dprotobuf_BUILD_TESTS=OFF ../.. ``` -2. Open solution `third_party\protobuf\cmake\protobuf.sln` and build it in Release mode. That will build libraries `libprotobuf.lib` and `libprotoc.lib` needed for the next step. +2. Open solution `third_party\protobuf\cmake\build\solution\protobuf.sln` and build it in Release mode. That will build libraries `libprotobuf.lib` and `libprotoc.lib` needed for the next step. 3. Open solution `vsprojects\grpc_protoc_plugins.sln` and build it in Release mode. As a result, you should obtain a set of gRPC protoc plugin binaries (`grpc_cpp_plugin.exe`, `grpc_csharp_plugin.exe`, ...) diff --git a/vsprojects/build_plugins.bat b/vsprojects/build_plugins.bat index 7c8e056dc4e..ae5c5f09bed 100644 --- a/vsprojects/build_plugins.bat +++ b/vsprojects/build_plugins.bat @@ -38,7 +38,7 @@ cd /d %~dp0 @call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" x86 @rem Build third_party/protobuf -msbuild ..\third_party\protobuf\cmake\protobuf.sln /p:Configuration=Release || goto :error +msbuild ..\third_party\protobuf\cmake\build\solution\protobuf.sln /p:Configuration=Release || goto :error @rem Build the C# protoc plugins msbuild grpc_protoc_plugins.sln /p:Configuration=Release || goto :error diff --git a/vsprojects/protobuf.props b/vsprojects/protobuf.props index b1de8af27a5..b8283135729 100644 --- a/vsprojects/protobuf.props +++ b/vsprojects/protobuf.props @@ -1 +1 @@ - libprotobuf.lib;%(AdditionalDependencies) $(SolutionDir)\..\third_party\protobuf\cmake\$(Configuration);%(AdditionalLibraryDirectories) \ No newline at end of file + libprotobuf.lib;%(AdditionalDependencies) $(SolutionDir)\..\third_party\protobuf\cmake\build\solution\$(Configuration);%(AdditionalLibraryDirectories) \ No newline at end of file diff --git a/vsprojects/protoc.props b/vsprojects/protoc.props index 1bdc07193bc..87fff8f1288 100644 --- a/vsprojects/protoc.props +++ b/vsprojects/protoc.props @@ -1 +1 @@ - 4244;4267;%(DisableSpecificWarnings) libprotoc.lib;%(AdditionalDependencies) $(SolutionDir)\..\third_party\protobuf\cmake\$(Configuration);%(AdditionalLibraryDirectories) \ No newline at end of file + 4244;4267;%(DisableSpecificWarnings) libprotoc.lib;%(AdditionalDependencies) $(SolutionDir)\..\third_party\protobuf\cmake\build\solution\$(Configuration);%(AdditionalLibraryDirectories) \ No newline at end of file