Skip to content

Commit

Permalink
PMNGIOS-978 [platform] Fix visibility warning, remove not needed armv…
Browse files Browse the repository at this point in the history
…7 arch and update to OpenCV 4.6.0
  • Loading branch information
acecilia authored Aug 22, 2022
1 parent 7609502 commit ab5f935
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ build_3_4_6:

build_4_5_2:
Scripts/opencv_xcframework.sh build_4_5_2

build_4_6_0:
Scripts/opencv_xcframework.sh build_4_6_0

3 changes: 0 additions & 3 deletions opencv2.json

This file was deleted.

25 changes: 24 additions & 1 deletion scripts/opencv_xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build_xcframework() {

python3 "${BUILD_DIR}/${VERSION}/platforms/apple/build_xcframework.py" \
--build_only_specified_archs \
--iphoneos_archs arm64,armv7 \
--iphoneos_archs arm64 \
--iphonesimulator_archs arm64,x86_64 \
--out "${OUTPUT_DIR}" \
"$@"
Expand All @@ -35,6 +35,16 @@ patch_xcframework_remove_symlinks() {
done
}

# Disable iOS visibility warnings
# See: https://github.com/opencv/opencv/issues/7565#issuecomment-555549631
disable_ios_visibility_warnings() {
readonly VERSION="${1}"
readonly FILE_TO_PATCH="${BUILD_DIR}/${VERSION}/CMakeLists.txt"

# Add the OPENCV_SKIP_VISIBILITY_HIDDEN to the first line of the CMakeLists.txt file
echo -e "SET(OPENCV_SKIP_VISIBILITY_HIDDEN TRUE)\n$(cat ${FILE_TO_PATCH})" > "${FILE_TO_PATCH}"
}

build_3_4_6() {
clone 3.4.6
clone 4.5.2
Expand All @@ -58,5 +68,18 @@ build_4_5_2() {
patch_xcframework_remove_symlinks
}

build_4_6_0() {
clone 4.6.0
disable_ios_visibility_warnings 4.6.0

# Fix PATH to find python
# See: https://github.com/opencv/opencv/issues/21926#issuecomment-1156755364
ln -s "$(which python3)" "$(pwd)/${BUILD_DIR}/python"
export PATH="$(pwd)/${BUILD_DIR}:${PATH}"

build_xcframework 4.6.0
patch_xcframework_remove_symlinks
}

rm -rf "${BUILD_DIR}"
"$@"

0 comments on commit ab5f935

Please sign in to comment.