Add libtensorflowlite.so target

This target exports the interpreter C++ API and the kernel C API, and
includes the builtin set of ops.

Fixes #25278 and fixes #19642.

PiperOrigin-RevId: 232396927
This commit is contained in:
Jared Duke 2019-02-04 17:19:22 -08:00 committed by TensorFlower Gardener
parent 6f848e3e8b
commit 0300883583
3 changed files with 38 additions and 1 deletions

View File

@ -5,7 +5,7 @@ package(
licenses(["notice"]) # Apache 2.0 licenses(["notice"]) # Apache 2.0
load("//tensorflow:tensorflow.bzl", "if_not_windows", "tf_cc_test") load("//tensorflow:tensorflow.bzl", "if_not_windows", "tf_cc_test")
load("//tensorflow/lite:build_def.bzl", "tflite_copts") load("//tensorflow/lite:build_def.bzl", "tflite_cc_shared_object", "tflite_copts")
load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite") load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite")
exports_files(glob([ exports_files(glob([
@ -398,4 +398,30 @@ cc_test(
], ],
) )
# Shared lib target for convenience, pulls in the core runtime and builtin ops.
# Note: This target is not yet finalized, and the exact set of exported (C/C++)
# APIs is subject to change.
tflite_cc_shared_object(
name = "libtensorflowlite.so",
linkopts = select({
"//tensorflow:darwin": [
"-Wl,-exported_symbols_list", # This line must be directly followed by the exported_symbols.lds file
"$(location //tensorflow/lite:tflite_exported_symbols.lds)",
"-Wl,-install_name,@rpath/libtensorflowlite.so",
],
"//tensorflow:windows": [],
"//conditions:default": [
"-z defs",
"-Wl,--version-script", # This line must be directly followed by the version_script.lds file
"$(location //tensorflow/lite:tflite_version_script.lds)",
],
}),
deps = [
":framework",
":tflite_exported_symbols.lds",
":tflite_version_script.lds",
"//tensorflow/lite/kernels:builtin_ops",
],
)
tflite_portable_test_suite() tflite_portable_test_suite()

View File

@ -0,0 +1,3 @@
*TfLite*
*tflite*
*TFL_*

View File

@ -0,0 +1,8 @@
VERS_1.0 {
global:
*TfLite*;
*tflite*;
*TFL_*;
local:
*;
};