[TFLite] Fix cmake build kernel test fail
Using CMake to build the TFLite kernel test will fail in linking stage when `-DTFLITE_ENABLE_GPU=OFF`
ld: libtensorflow-lite-test-base.a(op_version.cc.o): in function `.LBB1_18':
op_version.cc:(.text._ZN6tflite15UpdateOpVersionEPh+0x14c): undefined reference to `tflite::GetOpSignature(tflite::OperatorCode const*, tflite::Operator const*, tflite::SubGraph const*, tflite::Model const*)'
clang++: rror: linker command failed with exit code 1 (use -v to see invocation)
Solution:
Add `versioning/op_signature.cc` to TEST_FRAMEWORK_SRC if `-DTFLITE_ENABLE_GPU=OFF`.
`versioning/op_version.cc` depends on `versioning/op_signature.cc` because of using GetOpSignature().
We don't need to add `versioning/op_signature.cc` to TEST_FRAMEWORK_SRC if `-DTFLITE_ENABLE_GPU=ON`.
Because `versioning/op_signature.cc` is appended in `TFLITE_DELEGATES_GPU_SRCS`, it makes `tensorflow-lite.a` define `GetOpSignature`.
Signed-off-by: NBruce Lai <bruce.lai@sifive.com>
Showing
想要评论请 注册 或 登录