aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2017-04-25 12:15:53 -0700
committerGravatar murgatroid99 <mlumish@google.com>2017-04-25 12:15:53 -0700
commit3049462b75ac557348243601896ed68ca8145522 (patch)
tree213389dd32b961b25f3833738201e857ce7ae2e3 /templates
parent627e2a5abd2e4146c85625e98083a95846ad57e8 (diff)
parent79759fea1abd09102d38af3e13a84b69e898124b (diff)
Merge remote-tracking branch 'upstream/v1.3.x' into node_only_uv
Diffstat (limited to 'templates')
-rw-r--r--templates/CMakeLists.txt.template6
-rw-r--r--templates/Makefile.template14
-rw-r--r--templates/src/python/grpcio/grpc/_grpcio_metadata.py.template34
-rw-r--r--templates/tools/run_tests/generated/sources_and_headers.json.template2
4 files changed, 50 insertions, 6 deletions
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index c647ea5707..88e518f132 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -314,8 +314,10 @@
set(CMAKE_CXX_FLAGS "<%text>${CMAKE_CXX_FLAGS}</%text> -std=c++11")
endif()
- if(UNIX)
- set(_gRPC_ALLTARGETS_LIBRARIES dl rt m pthread)
+ if(_gRPC_PLATFORM_MAC)
+ set(_gRPC_ALLTARGETS_LIBRARIES <%text>${CMAKE_DL_LIBS}</%text> m pthread)
+ elseif(UNIX)
+ set(_gRPC_ALLTARGETS_LIBRARIES <%text>${CMAKE_DL_LIBS}</%text> rt m pthread)
endif()
if(WIN32 AND MSVC)
diff --git a/templates/Makefile.template b/templates/Makefile.template
index 1e6ca9337d..5ce606f828 100644
--- a/templates/Makefile.template
+++ b/templates/Makefile.template
@@ -311,7 +311,7 @@
USE_BUILT_PROTOC = false
endif
- GTEST_LIB = -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googletest third_party/googletest/googletest/src/gtest-all.cc
+ GTEST_LIB = -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googletest third_party/googletest/googletest/src/gtest-all.cc -Ithird_party/googletest/googlemock/include -Ithird_party/googletest/googlemock third_party/googletest/googlemock/src/gmock-all.cc
GTEST_LIB += -lgflags
ifeq ($(V),1)
E = @:
@@ -716,7 +716,7 @@
PC_REQUIRES_GRPCXX =
PC_LIBS_GRPCXX =
- CPPFLAGS := -Ithird_party/googletest/googletest/include $(CPPFLAGS)
+ CPPFLAGS := -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include $(CPPFLAGS)
PROTOC_PLUGINS_ALL =\
% for tgt in targets:
@@ -1240,6 +1240,14 @@
$(GENDIR)/${p}.pb.cc: protoc_dep_error
$(GENDIR)/${p}.grpc.pb.cc: protoc_dep_error
else
+ <%
+ pluginflags=""
+ %>
+ % if p in ["src/proto/grpc/testing/compiler_test", "src/proto/grpc/testing/echo"]:
+ <%
+ pluginflags="generate_mock_code=true:"
+ %>
+ % endif
$(GENDIR)/${p}.pb.cc: ${p}.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) ${' '.join('$(GENDIR)/%s.pb.cc' % q for q in proto_deps.get(p, []))}
$(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@`
@@ -1248,7 +1256,7 @@
$(GENDIR)/${p}.grpc.pb.cc: ${p}.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) ${' '.join('$(GENDIR)/%s.pb.cc $(GENDIR)/%s.grpc.pb.cc' % (q,q) for q in proto_deps.get(p, []))}
$(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
$(Q) mkdir -p `dirname $@`
- $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $<
+ $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=${pluginflags}$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $<
endif
% endfor
diff --git a/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template b/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template
new file mode 100644
index 0000000000..3d325b4d3d
--- /dev/null
+++ b/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template
@@ -0,0 +1,34 @@
+%YAML 1.2
+--- |
+ # Copyright 2017, Google Inc.
+ # All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are
+ # met:
+ #
+ # * Redistributions of source code must retain the above copyright
+ # notice, this list of conditions and the following disclaimer.
+ # * Redistributions in binary form must reproduce the above
+ # copyright notice, this list of conditions and the following disclaimer
+ # in the documentation and/or other materials provided with the
+ # distribution.
+ # * Neither the name of Google Inc. nor the names of its
+ # contributors may be used to endorse or promote products derived from
+ # this software without specific prior written permission.
+ #
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!!
+
+ __version__ = """${settings.python_version.pep440()}"""
diff --git a/templates/tools/run_tests/generated/sources_and_headers.json.template b/templates/tools/run_tests/generated/sources_and_headers.json.template
index 1c5c9747d6..c7dc3c837d 100644
--- a/templates/tools/run_tests/generated/sources_and_headers.json.template
+++ b/templates/tools/run_tests/generated/sources_and_headers.json.template
@@ -9,7 +9,7 @@
for f in src:
name, ext = os.path.splitext(f)
if ext == '.proto':
- out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h'])
+ out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h', '%s_mock.grpc.pb.h'])
return out
def all_targets(targets, libs, filegroups):