Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tflite - Fixing GL Delegate build so that the .so generated can be linked in Android CMake and used in the NDK #28674

Merged
6 changes: 6 additions & 0 deletions .bazelrc
Expand Up @@ -9,6 +9,12 @@ build:android_arm --fat_apk_cpu=armeabi-v7a
build:android_arm64 --config=android
build:android_arm64 --cpu=arm64-v8a
build:android_arm64 --fat_apk_cpu=arm64-v8a
build:android_x86 --config=android
build:android_x86 --cpu=x86
build:android_x86 --fat_apk_cpu=x86
build:android_x86_64 --config=android
build:android_x86_64 --cpu=x86_64
build:android_x86_64 --fat_apk_cpu=x86_64

# Sets the default Apple platform to macOS.
build --apple_platform_type=macos
Expand Down
4 changes: 3 additions & 1 deletion tensorflow/lite/delegates/gpu/BUILD
Expand Up @@ -88,7 +88,9 @@ objc_library(
# build -c opt --config android_arm64 --copt -Os --copt -DTFLITE_GPU_BINARY_RELEASE --copt -fvisibility=hidden --linkopt -s --strip always :libtensorflowlite_gpu_gl.so
cc_binary(
name = "libtensorflowlite_gpu_gl.so",
linkopts = select({
linkopts = [
"-Wl,-soname=libtensorflowlite_gpu_gl.so",
] + select({
"//tensorflow:android": [
"-lEGL",
"-lGLESv3",
Expand Down