Skip to content

Commit 9112ec6

Browse files
[mlgo] Use LLVM_HAVE_TFLITE instead of LLVM_HAVE_TF_API
This patch replaces uses of LLVM_HAVE_TF_API with LLVM_HAVE_TFLITE in a couple of CMakeLists.txt. Now that 842b0d0 has landed, we now have: LLVM_HAVE_TF_API is defined if and only if LLVM_HAVE_TFLITE evaluates to true in the CMake variable world (assuming that you do not set LLVM_HAVE_TF_API on the cmake invocation). FWIW, the story is a little different in the C++ macro world, where: LLVM_HAVE_TF_API is defined if and only if LLVM_HAVE_TFLITE is defined This is why edc83a1 consisted only of mechanical replacements. Differential Revision: https://reviews.llvm.org/D140061
1 parent 23f4f66 commit 9112ec6

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

llvm/lib/Analysis/CMakeLists.txt

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if (DEFINED LLVM_HAVE_TF_AOT OR DEFINED LLVM_HAVE_TF_API)
1+
if (DEFINED LLVM_HAVE_TF_AOT OR LLVM_HAVE_TFLITE)
22
include(TensorFlowCompile)
33
set(LLVM_INLINER_MODEL_PATH_DEFAULT "models/inliner-Oz")
44

@@ -17,18 +17,14 @@ if (DEFINED LLVM_HAVE_TF_AOT OR DEFINED LLVM_HAVE_TF_API)
1717
)
1818
endif()
1919

20-
if (DEFINED LLVM_HAVE_TF_API)
21-
if (LLVM_HAVE_TFLITE)
22-
build_proto(
23-
tensorflow/core/protobuf/error_codes
24-
tensorflow/core/example/feature
25-
tensorflow/core/example/example)
26-
list(APPEND MLLinkDeps
27-
tensorflow-lite::tensorflow-lite
28-
protobuf::libprotobuf)
29-
else()
30-
list(APPEND MLLinkDeps ${tensorflow_c_api} ${tensorflow_fx})
31-
endif()
20+
if (LLVM_HAVE_TFLITE)
21+
build_proto(
22+
tensorflow/core/protobuf/error_codes
23+
tensorflow/core/example/feature
24+
tensorflow/core/example/example)
25+
list(APPEND MLLinkDeps
26+
tensorflow-lite::tensorflow-lite
27+
protobuf::libprotobuf)
3228
endif()
3329
endif()
3430

llvm/unittests/Analysis/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set(LLVM_LINK_COMPONENTS
77
)
88

99
set(MLGO_TESTS TFUtilsTest.cpp TrainingLoggerTest.cpp)
10-
if (DEFINED LLVM_HAVE_TF_API)
10+
if (LLVM_HAVE_TFLITE)
1111
LIST(APPEND EXTRA_TESTS ${MLGO_TESTS})
1212
else()
1313
LIST(APPEND LLVM_OPTIONAL_SOURCES ${MLGO_TESTS})

0 commit comments

Comments
 (0)