Addind rules for iOS.

Change: 129807596
This commit is contained in:
A. Unique TensorFlower 2016-08-09 15:26:39 -08:00 committed by TensorFlower Gardener
parent bfcbc262af
commit 78c9dec5a6
3 changed files with 37 additions and 0 deletions

View File

@ -35,6 +35,14 @@ config_setting(
visibility = ["//visibility:public"],
)
config_setting(
name = "ios",
values = {
"crosstool_top": "//tools/osx/crosstool:crosstool",
},
visibility = ["//visibility:public"],
)
package_group(
name = "internal",
packages = [

View File

@ -54,6 +54,7 @@ licenses(["notice"]) # Apache 2.0
load(
"//tensorflow:tensorflow.bzl",
"if_android",
"if_ios",
"tf_copts",
"tf_cc_test",
"tf_cc_tests",
@ -649,6 +650,27 @@ cc_library(
alwayslink = 1,
)
# Native library support for iOS applications.
#
# bazel build --config=ios_x86_64 \
# //third_party/tensorflow/core:ios_tensorflow_lib
cc_library(
name = "ios_tensorflow_lib",
srcs = if_ios([
":android_op_registrations_and_gradients",
"//tensorflow/core:android_srcs",
"//tensorflow/core/kernels:android_core_ops",
"//tensorflow/core/kernels:android_extended_ops",
]),
copts = tf_copts() + ["-Os"] + ["-std=c++11"],
visibility = ["//visibility:public"],
deps = [
":protos_cc",
"//third_party/eigen3",
],
alwayslink = 1,
)
# Full TensorFlow library with operator support. Use this unless reducing
# binary size (by packaging a reduced operator set) is a concern.
cc_library(

View File

@ -101,6 +101,12 @@ def if_android(a):
"//conditions:default": [],
})
def if_ios(a):
return select({
"//tensorflow:ios": a,
"//conditions:default": [],
})
def tf_copts():
return (["-fno-exceptions", "-DEIGEN_AVOID_STL_ARRAY"] +
if_cuda(["-DGOOGLE_CUDA=1"]) +
@ -112,6 +118,7 @@ def tf_copts():
"-O2",
],
"//tensorflow:darwin": [],
"//tensorflow:ios": ["-std=c++11",],
"//conditions:default": ["-pthread"]}))
def tf_opts_nortti_if_android():