diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2017-06-06 10:31:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-06 10:31:21 -0700 |
commit | 2aeb4ab9c732325ccefbe3f346d29b5ef80e110f (patch) | |
tree | 4423bcf323bbe6d98a2e7ae400d36be2e63ed0e1 /BUILD | |
parent | ddbe36003e26e6404ff2992b02c0ece9ddb68607 (diff) | |
parent | 0b059a3d8a8f8aa40dde7bea55edca4ec5dfea66 (diff) | |
download | protobuf-2aeb4ab9c732325ccefbe3f346d29b5ef80e110f.tar.gz protobuf-2aeb4ab9c732325ccefbe3f346d29b5ef80e110f.tar.bz2 protobuf-2aeb4ab9c732325ccefbe3f346d29b5ef80e110f.zip |
Merge pull request #3160 from meteorcloudy/winbuild
Refactor cc options in BUILD file for Windows
Diffstat (limited to 'BUILD')
-rw-r--r-- | BUILD | 44 |
1 files changed, 32 insertions, 12 deletions
@@ -8,15 +8,35 @@ exports_files(["LICENSE"]) # 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 = { @@ -60,7 +80,7 @@ config_setting( }, ) -IOS_ARM_COPTS = COPTS + [ +IOS_ARM_COPTS = [ "-DOS_IOS", "-miphoneos-version-min=7.0", "-arch armv7", @@ -103,8 +123,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"], @@ -174,8 +194,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"], |