From cb39204af85533f1905b5715908c51adc46ca610 Mon Sep 17 00:00:00 2001 From: Pete Warden Date: Tue, 23 Feb 2016 10:18:32 -0800 Subject: [PATCH 1/2] Updated library generation with iOS options --- BUILD | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/BUILD b/BUILD index c4de1c4c9..8667cc481 100644 --- a/BUILD +++ b/BUILD @@ -26,6 +26,25 @@ load( "internal_protobuf_py_tests", ) +config_setting( + name = "ios_arm", + values = { + "ios_cpu": "armv7", + "ios_cpu": "armv7s", + "ios_cpu": "arm64", + }, +) + +IOS_ARM_COPTS = COPTS + [ + "-DOS_IOS", + "-miphoneos-version-min=7.0", + "-arch armv7", + "-arch armv7s", + "-arch arm64", + "-D__thread=", + "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/", +] + cc_library( name = "protobuf_lite", srcs = [ @@ -55,7 +74,10 @@ cc_library( "src/google/protobuf/wire_format_lite.cc", ], hdrs = glob(["src/google/protobuf/**/*.h"]), - copts = COPTS, + copts = select({ + ":ios_arm": IOS_ARM_COPTS, + "//conditions:default": COPTS, + }), includes = ["src/"], linkopts = LINK_OPTS, visibility = ["//visibility:public"], @@ -120,7 +142,10 @@ cc_library( "src/google/protobuf/wrappers.pb.cc", ], hdrs = glob(["src/**/*.h"]), - copts = COPTS, + copts = select({ + ":ios_arm": IOS_ARM_COPTS, + "//conditions:default": COPTS, + }), includes = ["src/"], linkopts = LINK_OPTS, visibility = ["//visibility:public"], From f0c1a8637218a03a083901493c9b3acdb6e5db57 Mon Sep 17 00:00:00 2001 From: Pete Warden Date: Wed, 9 Mar 2016 13:03:52 -0800 Subject: [PATCH 2/2] Added iOS settings to Bazel build --- BUILD | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/BUILD b/BUILD index 8667cc481..39ba0d940 100644 --- a/BUILD +++ b/BUILD @@ -27,10 +27,22 @@ load( ) config_setting( - name = "ios_arm", + name = "ios_armv7", values = { "ios_cpu": "armv7", + }, +) + +config_setting( + name = "ios_armv7s", + values = { "ios_cpu": "armv7s", + }, +) + +config_setting( + name = "ios_arm64", + values = { "ios_cpu": "arm64", }, ) @@ -75,7 +87,9 @@ cc_library( ], hdrs = glob(["src/google/protobuf/**/*.h"]), copts = select({ - ":ios_arm": IOS_ARM_COPTS, + ":ios_armv7": IOS_ARM_COPTS, + ":ios_armv7s": IOS_ARM_COPTS, + ":ios_arm64": IOS_ARM_COPTS, "//conditions:default": COPTS, }), includes = ["src/"], @@ -143,7 +157,9 @@ cc_library( ], hdrs = glob(["src/**/*.h"]), copts = select({ - ":ios_arm": IOS_ARM_COPTS, + ":ios_armv7": IOS_ARM_COPTS, + ":ios_armv7s": IOS_ARM_COPTS, + ":ios_arm64": IOS_ARM_COPTS, "//conditions:default": COPTS, }), includes = ["src/"],