diff options
author | Ning Ren <ningr@google.com> | 2017-11-20 15:24:21 -0800 |
---|---|---|
committer | Alexander Polcyn <apolcyn@google.com> | 2017-12-14 17:37:55 -0800 |
commit | 174e02ae3e377e1cfc36a620a078d8046b0887c1 (patch) | |
tree | 9398499c265ccc49cac563b69e4d949de1eb76f6 /third_party/cares/cares.BUILD | |
parent | 5d37e61d069a3d33fba15db35151d013a298537f (diff) |
Packs contents of WORKSPACE into a bzl function, so that it can be resued by other projects, and simplifies cares build.
Diffstat (limited to 'third_party/cares/cares.BUILD')
-rw-r--r-- | third_party/cares/cares.BUILD | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/third_party/cares/cares.BUILD b/third_party/cares/cares.BUILD index 85ca506ab0..3ac02875e6 100644 --- a/third_party/cares/cares.BUILD +++ b/third_party/cares/cares.BUILD @@ -35,33 +35,27 @@ config_setting( ) genrule( - name = "ares_build", - srcs = ["@cares_local_files//:ares_build_h"], + name = "ares_build_h", + srcs = ["@com_github_grpc_grpc//third_party/cares:ares_build.h"], outs = ["ares_build.h"], - cmd = "cat $(location @cares_local_files//:ares_build_h) > $@", + cmd = "cat $< > $@", ) -# cc_library( -# name = "ares_build_h", -# hdrs = ["ares_build.h"], -# data = [":ares_build"], -# includes = ["."], -# ) - genrule( - name = "ares_config", - srcs = ["@cares_local_files//:ares_config_h"], + name = "ares_config_h", + srcs = select({ + ":ios_x86_64": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], + ":ios_armv7": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], + ":ios_armv7s": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], + ":ios_arm64": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], + ":darwin": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], + ":android": ["@com_github_grpc_grpc//third_party/cares:config_android/ares_config.h"], + "//conditions:default": ["@com_github_grpc_grpc//third_party/cares:config_linux/ares_config.h"], + }), outs = ["ares_config.h"], - cmd = "cat $(location @cares_local_files//:ares_config_h) > $@", + cmd = "cat $< > $@", ) -# cc_library( -# name = "ares_config_h", -# hdrs = ["ares_config.h"], -# data = [":ares_config"], -# includes = ["."], -# ) - cc_library( name = "ares", srcs = [ @@ -147,10 +141,6 @@ cc_library( "-DNOMINMAX", "-DHAVE_CONFIG_H", ], - data = [ - ":ares_build", - ":ares_config", - ], includes = ["."], linkstatic = 1, visibility = [ |