Commit 9aea0ef0 authored by Jisi Liu's avatar Jisi Liu

Merge pull request #1312 from petewarden/master

Bazel iOS build settings
parents c71f1847 bc2d6c25
...@@ -26,6 +26,37 @@ load( ...@@ -26,6 +26,37 @@ load(
"internal_protobuf_py_tests", "internal_protobuf_py_tests",
) )
config_setting(
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",
},
)
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( cc_library(
name = "protobuf_lite", name = "protobuf_lite",
srcs = [ srcs = [
...@@ -55,7 +86,12 @@ cc_library( ...@@ -55,7 +86,12 @@ cc_library(
"src/google/protobuf/wire_format_lite.cc", "src/google/protobuf/wire_format_lite.cc",
], ],
hdrs = glob(["src/google/protobuf/**/*.h"]), hdrs = glob(["src/google/protobuf/**/*.h"]),
copts = COPTS, copts = select({
":ios_armv7": IOS_ARM_COPTS,
":ios_armv7s": IOS_ARM_COPTS,
":ios_arm64": IOS_ARM_COPTS,
"//conditions:default": COPTS,
}),
includes = ["src/"], includes = ["src/"],
linkopts = LINK_OPTS, linkopts = LINK_OPTS,
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
...@@ -120,7 +156,12 @@ cc_library( ...@@ -120,7 +156,12 @@ cc_library(
"src/google/protobuf/wrappers.pb.cc", "src/google/protobuf/wrappers.pb.cc",
], ],
hdrs = glob(["src/**/*.h"]), hdrs = glob(["src/**/*.h"]),
copts = COPTS, copts = select({
":ios_armv7": IOS_ARM_COPTS,
":ios_armv7s": IOS_ARM_COPTS,
":ios_arm64": IOS_ARM_COPTS,
"//conditions:default": COPTS,
}),
includes = ["src/"], includes = ["src/"],
linkopts = LINK_OPTS, linkopts = LINK_OPTS,
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment