aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/protobuf
diff options
context:
space:
mode:
authorGravatar Yun Peng <pcloudy@google.com>2017-05-29 11:48:07 +0200
committerGravatar Yun Peng <pcloudy@google.com>2017-05-29 14:38:30 +0200
commit86445d41f0636c3cfc375dd5e72171f6cbf4da81 (patch)
treedaf13de4de65b47fbac1fa5e7a9b11692ef498f1 /third_party/protobuf
parent0433a20572085b2a0cde756b65dbaebed154b18c (diff)
Refactor protobuf and grpc BUILD files for Windows
1. Added config_settings for Windows 2. Don't use gcc warning options in copts, this made it possible to build without python wrapper scripts. Change-Id: I37521d717b9d2d488a3bb0ec658dad40c6ddbb27
Diffstat (limited to 'third_party/protobuf')
-rw-r--r--third_party/protobuf/3.2.0/BUILD44
1 files changed, 32 insertions, 12 deletions
diff --git a/third_party/protobuf/3.2.0/BUILD b/third_party/protobuf/3.2.0/BUILD
index a6a52810f1..0581130365 100644
--- a/third_party/protobuf/3.2.0/BUILD
+++ b/third_party/protobuf/3.2.0/BUILD
@@ -55,15 +55,35 @@ filegroup(
# Protobuf Runtime Library
################################################################################
-COPTS = [
- "-DHAVE_PTHREAD",
- "-Wall",
- "-Wwrite-strings",
- "-Woverloaded-virtual",
- "-Wno-sign-compare",
- "-Wno-unused-function",
+WIN_COPTS = [
+ "/DHAVE_PTHREAD",
+ "/wd4018", # -Wno-sign-compare
+ "/wd4514", # -Wno-unused-function
]
+COPTS = select({
+ ":windows" : WIN_COPTS,
+ ":windows_msvc" : WIN_COPTS,
+ "//conditions:default": [
+ "-DHAVE_PTHREAD",
+ "-Wall",
+ "-Wwrite-strings",
+ "-Woverloaded-virtual",
+ "-Wno-sign-compare",
+ "-Wno-unused-function",
+ ],
+})
+
+config_setting(
+ name = "windows",
+ values = { "cpu": "x64_windows" },
+)
+
+config_setting(
+ name = "windows_msvc",
+ values = { "cpu": "x64_windows_msvc" },
+)
+
config_setting(
name = "android",
values = {
@@ -107,7 +127,7 @@ config_setting(
},
)
-IOS_ARM_COPTS = COPTS + [
+IOS_ARM_COPTS = [
"-DOS_IOS",
"-miphoneos-version-min=7.0",
"-arch armv7",
@@ -151,8 +171,8 @@ cc_library(
":ios_armv7": IOS_ARM_COPTS,
":ios_armv7s": IOS_ARM_COPTS,
":ios_arm64": IOS_ARM_COPTS,
- "//conditions:default": COPTS,
- }),
+ "//conditions:default": [],
+ }) + COPTS,
includes = ["src/"],
linkopts = LINK_OPTS,
visibility = ["//visibility:public"],
@@ -223,8 +243,8 @@ cc_library(
":ios_armv7": IOS_ARM_COPTS,
":ios_armv7s": IOS_ARM_COPTS,
":ios_arm64": IOS_ARM_COPTS,
- "//conditions:default": COPTS,
- }),
+ "//conditions:default": [],
+ }) + COPTS,
includes = ["src/"],
linkopts = LINK_OPTS,
visibility = ["//visibility:public"],