Merge pull request #13769 from jtattermusch/cmake_exclude_custom_ares

Exclude artificial ares target when building with cmake
pull/13775/head
Jan Tattermusch 7 years ago committed by GitHub
commit b2c389352f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 86
      CMakeLists.txt
  2. 2
      templates/CMakeLists.txt.template

@ -4683,92 +4683,6 @@ endif()
if (gRPC_BUILD_TESTS)
add_library(ares
third_party/cares/cares/ares__close_sockets.c
third_party/cares/cares/ares__get_hostent.c
third_party/cares/cares/ares__read_line.c
third_party/cares/cares/ares__timeval.c
third_party/cares/cares/ares_cancel.c
third_party/cares/cares/ares_create_query.c
third_party/cares/cares/ares_data.c
third_party/cares/cares/ares_destroy.c
third_party/cares/cares/ares_expand_name.c
third_party/cares/cares/ares_expand_string.c
third_party/cares/cares/ares_fds.c
third_party/cares/cares/ares_free_hostent.c
third_party/cares/cares/ares_free_string.c
third_party/cares/cares/ares_getenv.c
third_party/cares/cares/ares_gethostbyaddr.c
third_party/cares/cares/ares_gethostbyname.c
third_party/cares/cares/ares_getnameinfo.c
third_party/cares/cares/ares_getopt.c
third_party/cares/cares/ares_getsock.c
third_party/cares/cares/ares_init.c
third_party/cares/cares/ares_library_init.c
third_party/cares/cares/ares_llist.c
third_party/cares/cares/ares_mkquery.c
third_party/cares/cares/ares_nowarn.c
third_party/cares/cares/ares_options.c
third_party/cares/cares/ares_parse_a_reply.c
third_party/cares/cares/ares_parse_aaaa_reply.c
third_party/cares/cares/ares_parse_mx_reply.c
third_party/cares/cares/ares_parse_naptr_reply.c
third_party/cares/cares/ares_parse_ns_reply.c
third_party/cares/cares/ares_parse_ptr_reply.c
third_party/cares/cares/ares_parse_soa_reply.c
third_party/cares/cares/ares_parse_srv_reply.c
third_party/cares/cares/ares_parse_txt_reply.c
third_party/cares/cares/ares_platform.c
third_party/cares/cares/ares_process.c
third_party/cares/cares/ares_query.c
third_party/cares/cares/ares_search.c
third_party/cares/cares/ares_send.c
third_party/cares/cares/ares_strcasecmp.c
third_party/cares/cares/ares_strdup.c
third_party/cares/cares/ares_strerror.c
third_party/cares/cares/ares_timeout.c
third_party/cares/cares/ares_version.c
third_party/cares/cares/ares_writev.c
third_party/cares/cares/bitncmp.c
third_party/cares/cares/inet_net_pton.c
third_party/cares/cares/inet_ntop.c
third_party/cares/cares/windows_port.c
)
if(WIN32 AND MSVC)
set_target_properties(ares PROPERTIES COMPILE_PDB_NAME "ares"
COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
)
if (gRPC_INSTALL)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ares.pdb
DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL
)
endif()
endif()
target_include_directories(ares
PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${BORINGSSL_ROOT_DIR}/include
PRIVATE ${PROTOBUF_ROOT_DIR}/src
PRIVATE ${ZLIB_INCLUDE_DIR}
PRIVATE ${BENCHMARK}/include
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
PRIVATE ${CARES_INCLUDE_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
)
target_link_libraries(ares
${_gRPC_SSL_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_library(bad_client_test
test/core/bad_client/bad_client.cc
)

@ -445,7 +445,7 @@
% for lib in libs:
% if lib.build in ["all", "protoc", "tool", "test", "private"] and not lib.boringssl:
% if not lib.get('build_system', []) or 'cmake' in lib.get('build_system', []):
% if not lib.name in ['benchmark', 'z']: # we build these using CMake instead
% if not lib.name in ['ares', 'benchmark', 'z']: # we build these using CMake instead
% if lib.build in ["test", "private"]:
if (gRPC_BUILD_TESTS)
${cc_library(lib)}

Loading…
Cancel
Save