Skip to content

Commit

Permalink
Fix tflite ios build
Browse files Browse the repository at this point in the history
  • Loading branch information
canmingh authored and Canming Huang committed Jan 17, 2025
1 parent e6b347c commit 8a323a3
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
24 changes: 12 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1498,26 +1498,26 @@ IF(HAVE_ANDROID_LITE)
PATTERN ".git" EXCLUDE
PATTERN "bin" EXCLUDE
)
INSTALL(
DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/Solution/Android
DESTINATION Solution
COMPONENT emgutf_example_source
FILES_MATCHING
PATTERN "Emgu.TF.Lite.Example.Android.sln"
PATTERN ".git" EXCLUDE
PATTERN "bin" EXCLUDE
)
# INSTALL(
# DIRECTORY
# ${CMAKE_CURRENT_SOURCE_DIR}/Solution/Android
# DESTINATION Solution
# COMPONENT emgutf_example_source
# FILES_MATCHING
# PATTERN "Emgu.TF.Lite.Android.sln"
# PATTERN ".git" EXCLUDE
# PATTERN "bin" EXCLUDE
# )
ENDIF()

IF(HAVE_IOS_LITE)
INSTALL(
DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/Solution/iOS
DESTINATION Solution
COMPONENT emgutf_example_source
COMPONENT emgutf_source
FILES_MATCHING
PATTERN "Emgu.TF.Lite.Example.iOS.sln"
PATTERN "Emgu.TF.Lite.iOS.sln"
PATTERN ".git" EXCLUDE
PATTERN "bin" EXCLUDE
)
Expand Down
3 changes: 2 additions & 1 deletion Emgu.TF.Runtime/Maui/Android/Full/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ IF(HAVE_ANDROID AND (WIN32 OR APPLE))
DESTINATION Emgu.TF.Runtime/Maui/Android
COMPONENT emgutf_source
FILES_MATCHING
PATTERN "*.cs"
PATTERN "*.cs"
PATTERN "Directory.Build.props"
PATTERN "${PROJECT_NAME}.csproj"
PATTERN ".svn" EXCLUDE
PATTERN "obj" EXCLUDE
Expand Down
3 changes: 2 additions & 1 deletion Emgu.TF.Runtime/Maui/Android/Lite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ IF(HAVE_ANDROID_LITE AND (WIN32 OR APPLE))
DESTINATION Emgu.TF.Runtime/Maui/Android
COMPONENT emgutf_source
FILES_MATCHING
PATTERN "*.cs"
PATTERN "*.cs"
PATTERN "Directory.Build.props"
PATTERN "${PROJECT_NAME}.csproj"
PATTERN ".svn" EXCLUDE
PATTERN "obj" EXCLUDE
Expand Down
3 changes: 2 additions & 1 deletion Emgu.TF.Runtime/Maui/iOS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ IF(HAVE_IOS_LITE)
COMPONENT emgutf_source
FILES_MATCHING
PATTERN "*.csproj"
PATTERN "*.cs"
PATTERN "Directory.Build.props"
PATTERN "*.cs"
PATTERN ".svn" EXCLUDE
PATTERN "obj" EXCLUDE
PATTERN "CMakeFiles" EXCLUDE
Expand Down
2 changes: 1 addition & 1 deletion platforms/ios/bazel_build_tflite_ios
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [ "$1" = "darwin_x86_64" ] || [ "$1" = "darwin_arm64" ]; then
BAZEL_BUILD_OPTION="--apple_platform_type=macos --cpu=$1"
else
echo "Building for iOS"
BAZEL_BUILD_OPTION="-config=$1"
BAZEL_BUILD_OPTION="--config=$1"
fi

cd "$(dirname "$0")"
Expand Down
1 change: 1 addition & 0 deletions platforms/ios/bazel_build_xcframework
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
lipo -create -output ../../lib/ios/libtfliteextern_ios_simulator.a ../../lib/ios/libtfliteextern_ios_x86_64.a ../../lib/ios/libtfliteextern_ios_sim_arm64.a
lipo -create -output ../../lib/ios/libtfliteextern.a ../../lib/ios/libtfliteextern_ios_x86_64.a ../../lib/ios/libtfliteextern_ios_arm64.a

rm -rf ../../lib/ios/libtfliteextern_ios.xcframework
xcodebuild -create-xcframework -library ../../lib/ios/libtfliteextern_ios_simulator.a -library ../../lib/ios/libtfliteextern_ios_arm64.a -output ../../lib/ios/libtfliteextern_ios.xcframework

0 comments on commit 8a323a3

Please sign in to comment.