aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorGravatar Alexander Polcyn <apolcyn@google.com>2017-10-18 00:20:33 -0700
committerGravatar Alexander Polcyn <apolcyn@google.com>2018-03-20 23:51:19 -0700
commit690dde672a877083e29ee5af0b8252697aa48fa0 (patch)
treea801580cf12ad6655cd45e695c11a45ded9b67b5 /templates
parent8327acd9a23d80e979eb890b71a53966c3509a6d (diff)
Add address sorting submodule for use in c-ares wrapper
Diffstat (limited to 'templates')
-rw-r--r--templates/CMakeLists.txt.template6
-rw-r--r--templates/Makefile.template18
2 files changed, 20 insertions, 4 deletions
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index ef4d7d710c..ec09203ca1 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -46,6 +46,7 @@
if target_dict['name'] in ['grpc', 'grpc_cronet', 'grpc_unsecure']:
deps.append("${_gRPC_ZLIB_LIBRARIES}")
deps.append("${_gRPC_CARES_LIBRARIES}")
+ deps.append("${_gRPC_ADDRESS_SORTING_LIBRARIES}")
deps.append("${_gRPC_ALLTARGETS_LIBRARIES}")
for d in target_dict.get('deps', []):
if d == 'benchmark':
@@ -166,6 +167,9 @@
include(cmake/gflags.cmake)
include(cmake/benchmark.cmake)
+ include_directories(<%text>${CMAKE_CURRENT_SOURCE_DIR}/third_party/address_sorting</%text>)
+ set(_gRPC_ADDRESS_SORTING_LIBRARIES address_sorting)
+
if(NOT MSVC)
set(CMAKE_C_FLAGS "<%text>${CMAKE_C_FLAGS}</%text> -std=c99")
set(CMAKE_CXX_FLAGS "<%text>${CMAKE_CXX_FLAGS}</%text> -std=c++11")
@@ -375,6 +379,7 @@
PRIVATE <%text>${_gRPC_BENCHMARK_INCLUDE_DIR}</%text>
PRIVATE <%text>${_gRPC_CARES_INCLUDE_DIR}</%text>
PRIVATE <%text>${_gRPC_GFLAGS_INCLUDE_DIR}</%text>
+ PRIVATE <%text>${CMAKE_CURRENT_BINARY_DIR}</%text>/third_party/address_sorting
% if lib.build in ['test', 'private'] and lib.language == 'c++':
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
@@ -455,6 +460,7 @@
PRIVATE <%text>${_gRPC_BENCHMARK_INCLUDE_DIR}</%text>
PRIVATE <%text>${_gRPC_CARES_INCLUDE_DIR}</%text>
PRIVATE <%text>${_gRPC_GFLAGS_INCLUDE_DIR}</%text>
+ PRIVATE <%text>${CMAKE_CURRENT_BINARY_DIR}</%text>/third_party/address_sorting
% if tgt.build in ['test', 'private'] and tgt.language == 'c++':
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
diff --git a/templates/Makefile.template b/templates/Makefile.template
index 196d12f678..e0dab0291e 100644
--- a/templates/Makefile.template
+++ b/templates/Makefile.template
@@ -590,6 +590,11 @@
EMBED_CARES ?= false
endif
+ ADDRESS_SORTING_DEP = $(LIBDIR)/$(CONFIG)/libaddress_sorting.a
+ ADDRESS_SORTING_MERGE_OBJS = $(LIBADDRESS_SORTING_OBJS)
+ ADDRESS_SORTING_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/libaddress_sorting.a
+ CPPFLAGS := -Ithird_party/address_sorting $(CPPFLAGS)
+
ifeq ($(EMBED_CARES),true)
CARES_DEP = $(LIBDIR)/$(CONFIG)/libares.a
CARES_MERGE_OBJS = $(LIBARES_OBJS)
@@ -1480,7 +1485,7 @@
else
% endif
- $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(CARES_DEP)\
+ $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP)\
## The else here corresponds to the if secure earlier.
% else:
% if lib.language == 'c++':
@@ -1504,6 +1509,9 @@
% if lib.name != 'ares':
$(CARES_DEP) \
% endif
+ % if lib.name != 'address_sorting':
+ $(ADDRESS_SORTING_DEP) \
+ % endif
% endif
% if lib.language == 'c++':
$(PROTOBUF_DEP)\
@@ -1513,6 +1521,7 @@
$(LIBGPR_OBJS) \
$(ZLIB_MERGE_OBJS) \
$(CARES_MERGE_OBJS) \
+ $(ADDRESS_SORTING_MERGE_OBJS) \
% if lib.get('secure', 'check') == True:
$(OPENSSL_MERGE_OBJS) \
% endif
@@ -1526,6 +1535,7 @@
$(LIBGPR_OBJS) \
$(ZLIB_MERGE_OBJS) \
$(CARES_MERGE_OBJS) \
+ $(ADDRESS_SORTING_MERGE_OBJS) \
% if lib.get('secure', 'check') == True:
$(OPENSSL_MERGE_OBJS) \
% endif
@@ -1548,9 +1558,9 @@
common = '$(LIB' + lib.name.upper() + '_OBJS)'
link_libs = ''
- lib_deps = ' $(ZLIB_DEP) $(CARES_DEP)'
+ lib_deps = ' $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP)'
mingw_libs = ''
- mingw_lib_deps = ' $(ZLIB_DEP) $(CARES_DEP)'
+ mingw_lib_deps = ' $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP)'
if lib.language == 'c++':
lib_deps += ' $(PROTOBUF_DEP)'
mingw_lib_deps += ' $(PROTOBUF_DEP)'
@@ -1575,7 +1585,7 @@
security = lib.get('secure', 'check')
if security == True:
common = common + ' $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE)'
- common = common + ' $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS)'
+ common = common + ' $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS)'
if security in [True, 'check']:
for src in lib.src: