From 028c75d9be3164ddb8631545278158e78a74a933 Mon Sep 17 00:00:00 2001 From: Google AI Edge Date: Tue, 14 Jan 2025 10:45:52 -0800 Subject: [PATCH] Move TF project version and version suffix in release_version.h file. Create `cc_library` for `release_version.h` and add dependency on this rule to the targets. This change will enable ability to pass defines values to `release_version.h`. PiperOrigin-RevId: 715441698 --- tflite/BUILD | 4 +++- tflite/python/analyzer_wrapper/BUILD | 1 + tflite/python/analyzer_wrapper/model_analyzer.cc | 2 +- tflite/version.h | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tflite/BUILD b/tflite/BUILD index e23c0c50..450b0f10 100644 --- a/tflite/BUILD +++ b/tflite/BUILD @@ -195,10 +195,12 @@ exports_files( cc_library( name = "version", - srcs = ["@org_tensorflow//tensorflow/core/public:version.h"], hdrs = ["version.h"], compatible_with = get_compatible_with_portable(), copts = tflite_copts_warnings(), + deps = [ + "@org_tensorflow//tensorflow/core/public:release_version", + ], ) alias( diff --git a/tflite/python/analyzer_wrapper/BUILD b/tflite/python/analyzer_wrapper/BUILD index 18326a1a..7c2afc9e 100644 --- a/tflite/python/analyzer_wrapper/BUILD +++ b/tflite/python/analyzer_wrapper/BUILD @@ -35,5 +35,6 @@ cc_library( "@flatbuffers//:runtime_cc", "@org_tensorflow//tensorflow/compiler/mlir/lite/schema:schema_utils", "@org_tensorflow//tensorflow/core:framework", + "@org_tensorflow//tensorflow/core/public:release_version", ], ) diff --git a/tflite/python/analyzer_wrapper/model_analyzer.cc b/tflite/python/analyzer_wrapper/model_analyzer.cc index 223eb693..fa147b17 100644 --- a/tflite/python/analyzer_wrapper/model_analyzer.cc +++ b/tflite/python/analyzer_wrapper/model_analyzer.cc @@ -26,7 +26,7 @@ limitations under the License. #include "absl/strings/str_join.h" #include "flatbuffers/vector.h" // from @flatbuffers #include "tensorflow/compiler/mlir/lite/schema/schema_utils.h" -#include "tensorflow/core/public/version.h" +#include "tensorflow/core/public/release_version.h" #include "tflite/core/api/error_reporter.h" #include "tflite/core/model_builder.h" #include "tflite/schema/schema_generated.h" diff --git a/tflite/version.h b/tflite/version.h index 3cd3de26..f17fee70 100644 --- a/tflite/version.h +++ b/tflite/version.h @@ -15,7 +15,7 @@ limitations under the License. #ifndef TENSORFLOW_LITE_VERSION_H_ #define TENSORFLOW_LITE_VERSION_H_ -#include "tensorflow/core/public/version.h" +#include "tensorflow/core/public/release_version.h" // The version number of the Schema. Ideally all changes will be backward // compatible. If that ever changes, we must ensure that version is the first