aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tensorflow.bzl
diff options
context:
space:
mode:
authorGravatar Austin Anderson <angerson@google.com>2017-12-20 13:53:00 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-12-20 13:56:51 -0800
commitc4286420f9f529bcf39610416bd2ebbe3b508ee2 (patch)
tree5aa456c3d9255f909893b10bb3972e36c64ab90a /tensorflow/tensorflow.bzl
parent3d01a46171b5d256617627537187ab819c196aa4 (diff)
Make tf_cc_test compilable by default for Android
This change adjusts the build options for tf_cc_test targets so that they can be built for Android devices by default. Many targets will still need additional options on a per-target basis. Android requires that executables be compiled with `-pie`. PiperOrigin-RevId: 179729092
Diffstat (limited to 'tensorflow/tensorflow.bzl')
-rw-r--r--tensorflow/tensorflow.bzl10
1 files changed, 9 insertions, 1 deletions
diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl
index 9b13a86ed3..b19b5c9b22 100644
--- a/tensorflow/tensorflow.bzl
+++ b/tensorflow/tensorflow.bzl
@@ -589,7 +589,15 @@ def tf_cc_test(name,
name="%s%s" % (name, suffix),
srcs=srcs + tf_binary_additional_srcs(),
copts=tf_copts() + extra_copts,
- linkopts=["-lpthread", "-lm"] + linkopts + _rpath_linkopts(name),
+ linkopts=select({
+ "//tensorflow:android": [
+ "-pie",
+ ],
+ "//conditions:default": [
+ "-lpthread",
+ "-lm"
+ ],
+ }) + linkopts + _rpath_linkopts(name),
deps=deps + if_mkl(
[
"//third_party/mkl:intel_binary_blob",