Addind rules for iOS.
Change: 129807596
This commit is contained in:
parent
bfcbc262af
commit
78c9dec5a6
@ -35,6 +35,14 @@ config_setting(
|
|||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
config_setting(
|
||||||
|
name = "ios",
|
||||||
|
values = {
|
||||||
|
"crosstool_top": "//tools/osx/crosstool:crosstool",
|
||||||
|
},
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
||||||
|
|
||||||
package_group(
|
package_group(
|
||||||
name = "internal",
|
name = "internal",
|
||||||
packages = [
|
packages = [
|
||||||
|
@ -54,6 +54,7 @@ licenses(["notice"]) # Apache 2.0
|
|||||||
load(
|
load(
|
||||||
"//tensorflow:tensorflow.bzl",
|
"//tensorflow:tensorflow.bzl",
|
||||||
"if_android",
|
"if_android",
|
||||||
|
"if_ios",
|
||||||
"tf_copts",
|
"tf_copts",
|
||||||
"tf_cc_test",
|
"tf_cc_test",
|
||||||
"tf_cc_tests",
|
"tf_cc_tests",
|
||||||
@ -649,6 +650,27 @@ cc_library(
|
|||||||
alwayslink = 1,
|
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
|
# Full TensorFlow library with operator support. Use this unless reducing
|
||||||
# binary size (by packaging a reduced operator set) is a concern.
|
# binary size (by packaging a reduced operator set) is a concern.
|
||||||
cc_library(
|
cc_library(
|
||||||
|
@ -101,6 +101,12 @@ def if_android(a):
|
|||||||
"//conditions:default": [],
|
"//conditions:default": [],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
def if_ios(a):
|
||||||
|
return select({
|
||||||
|
"//tensorflow:ios": a,
|
||||||
|
"//conditions:default": [],
|
||||||
|
})
|
||||||
|
|
||||||
def tf_copts():
|
def tf_copts():
|
||||||
return (["-fno-exceptions", "-DEIGEN_AVOID_STL_ARRAY"] +
|
return (["-fno-exceptions", "-DEIGEN_AVOID_STL_ARRAY"] +
|
||||||
if_cuda(["-DGOOGLE_CUDA=1"]) +
|
if_cuda(["-DGOOGLE_CUDA=1"]) +
|
||||||
@ -112,6 +118,7 @@ def tf_copts():
|
|||||||
"-O2",
|
"-O2",
|
||||||
],
|
],
|
||||||
"//tensorflow:darwin": [],
|
"//tensorflow:darwin": [],
|
||||||
|
"//tensorflow:ios": ["-std=c++11",],
|
||||||
"//conditions:default": ["-pthread"]}))
|
"//conditions:default": ["-pthread"]}))
|
||||||
|
|
||||||
def tf_opts_nortti_if_android():
|
def tf_opts_nortti_if_android():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user