From 60409759308322e94f79df0f37f2f194e8fc212d Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Fri, 10 Nov 2017 13:44:26 -0800 Subject: [PATCH] In bazel builds, provide an option to select non-uses of c_ares --- BUILD | 5 +++++ bazel/grpc_build_system.bzl | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/BUILD b/BUILD index bcb75af0321..6a514496f62 100644 --- a/BUILD +++ b/BUILD @@ -33,6 +33,11 @@ load( "grpc_generate_one_off_targets", ) +config_setting( + name = "grpc_no_ares", + values = {"define": "grpc_no_ares=true"}, +) + # This should be updated along with build.yaml g_stands_for = "generous" diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index 6cfed6b0e72..b35ca73745f 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -33,6 +33,10 @@ def grpc_cc_library(name, srcs = [], public_hdrs = [], hdrs = [], native.cc_library( name = name, srcs = srcs, + defines = select({ + "//:grpc_no_ares": ["GRPC_ARES=0"], + "//conditions:default": [], + }), hdrs = hdrs + public_hdrs, deps = deps + ["//external:" + dep for dep in external_deps], copts = copts,