From 888826695ebfb7e6e4c4f987ad61bb450aeb6905 Mon Sep 17 00:00:00 2001 From: Terry Heo Date: Mon, 14 Sep 2020 19:00:24 -0700 Subject: [PATCH] Skip building TF_AcquireFlexDelegate() on Android The function is needed to support Flex delegate on Python API. Since Android doesn't need it and some NDK tool has a build error on this, we'd better skip this on Android. This CL fixes #42744 issue. PiperOrigin-RevId: 331677690 Change-Id: I84587c7e6a7e40992d55f59c73b45a6d332bc8f0 --- tensorflow/lite/delegates/flex/delegate.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tensorflow/lite/delegates/flex/delegate.cc b/tensorflow/lite/delegates/flex/delegate.cc index 4664ab34700..16eb6b2d560 100644 --- a/tensorflow/lite/delegates/flex/delegate.cc +++ b/tensorflow/lite/delegates/flex/delegate.cc @@ -145,6 +145,7 @@ TfLiteStatus FlexDelegate::CopyFromBufferHandle( // Exported C interface function which is used by AcquireFlexDelegate() at // interpreter_build.cc. To export the function name globally, the function name // must be matched with patterns in tf_version_script.lds +#if !defined(__ANDROID__) extern "C" { #if defined(_WIN32) __declspec(dllexport) @@ -153,3 +154,4 @@ __declspec(dllexport) return tflite::FlexDelegate::Create(); } } // extern "C" +#endif // !defined(__ANDROID__)