Skip to content

Commit

Permalink
Move TF project version and version suffix in release_version.h file.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ai-edge-bot authored and copybara-github committed Jan 15, 2025
1 parent a8b2f84 commit 028c75d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tflite/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions tflite/python/analyzer_wrapper/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)
2 changes: 1 addition & 1 deletion tflite/python/analyzer_wrapper/model_analyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tflite/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 028c75d

Please sign in to comment.