Skip to content

Commit caa1cd0

Browse files
committed
Fix builds for TensorFlow Lite on Mac and Windows
1 parent e1565dc commit caa1cd0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tensorflow-lite/cppbuild.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ sedinplace '/#include <math.h>/a\
3535
sedinplace "s/TFLITE_VERSION_STRING/\"$TENSORFLOW_VERSION\"/g" tensorflow-$TENSORFLOW_VERSION/tensorflow/lite/core/c/c_api.cc
3636
sedinplace "s/TFLITE_EXTENSION_APIS_VERSION_STRING/\"$TENSORFLOW_VERSION\"/g" tensorflow-$TENSORFLOW_VERSION/tensorflow/lite/core/c/c_api.cc
3737
sedinplace '/private:/d' tensorflow-$TENSORFLOW_VERSION/tensorflow/lite/core/model_building.h
38-
sedinplace "s:TENSORFLOW_SOURCE_DIR \"\":TENSORFLOW_SOURCE_DIR \"$PWD/tensorflow-$TENSORFLOW_VERSION\":g" tensorflow-$TENSORFLOW_VERSION/tensorflow/lite/CMakeLists.txt
38+
sedinplace '/core\/example/d' tensorflow-$TENSORFLOW_VERSION/tensorflow/lite/CMakeLists.txt
39+
sedinplace "s:TENSORFLOW_SOURCE_DIR \"\":TENSORFLOW_SOURCE_DIR \"${PWD//\\//}/tensorflow-$TENSORFLOW_VERSION\":g" tensorflow-$TENSORFLOW_VERSION/tensorflow/lite/CMakeLists.txt
40+
3941

4042
if [[ ! "$PLATFORM" == windows* ]]; then
4143
mkdir -p build_flatc
@@ -123,6 +125,7 @@ sedinplace '/CMakeCCompilerId.o/d' objs
123125
sedinplace '/CMakeCXXCompilerId.o/d' objs
124126
sedinplace '/tensorflowlite_c.dir/d' objs
125127
sedinplace '/tensorflow_profiler_logger/d' objs
128+
sedinplace '/xnnpack-operator-delete.dir/d' objs
126129
# convert to DOS paths with short names to prevent exceeding MAX_PATH on Windows
127130
if which cygpath; then
128131
cygpath -d -f objs > objs.dos

0 commit comments

Comments
 (0)