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
This commit is contained in:
parent
3d01a46171
commit
c4286420f9
@ -589,7 +589,15 @@ def tf_cc_test(name,
|
|||||||
name="%s%s" % (name, suffix),
|
name="%s%s" % (name, suffix),
|
||||||
srcs=srcs + tf_binary_additional_srcs(),
|
srcs=srcs + tf_binary_additional_srcs(),
|
||||||
copts=tf_copts() + extra_copts,
|
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(
|
deps=deps + if_mkl(
|
||||||
[
|
[
|
||||||
"//third_party/mkl:intel_binary_blob",
|
"//third_party/mkl:intel_binary_blob",
|
||||||
|
Loading…
Reference in New Issue
Block a user