Skip to content

Commit d74fdc4

Browse files
authored
Ensure dynamic libjpeg libraries are not linked (#9081)
2 parents 329d6a6 + 2af930b commit d74fdc4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/wheels-dependencies.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ if [[ "$CIBW_PLATFORM" == "ios" ]]; then
6060
# on using the Xcode builder, which isn't very helpful for most of Pillow's
6161
# dependencies. Therefore, we lean on the OSX configurations, plus CC, CFLAGS
6262
# etc. to ensure the right sysroot is selected.
63-
HOST_CMAKE_FLAGS="-DCMAKE_SYSTEM_NAME=$CMAKE_SYSTEM_NAME -DCMAKE_SYSTEM_PROCESSOR=$GNU_ARCH -DCMAKE_OSX_DEPLOYMENT_TARGET=$IPHONEOS_DEPLOYMENT_TARGET -DCMAKE_OSX_SYSROOT=$IOS_SDK_PATH -DBUILD_SHARED_LIBS=NO"
63+
HOST_CMAKE_FLAGS="-DCMAKE_SYSTEM_NAME=$CMAKE_SYSTEM_NAME -DCMAKE_SYSTEM_PROCESSOR=$GNU_ARCH -DCMAKE_OSX_DEPLOYMENT_TARGET=$IPHONEOS_DEPLOYMENT_TARGET -DCMAKE_OSX_SYSROOT=$IOS_SDK_PATH -DBUILD_SHARED_LIBS=NO -DENABLE_SHARED=NO"
6464

6565
# Meson needs to be pointed at a cross-platform configuration file
6666
# This will be generated once CC etc. have been evaluated.
@@ -380,6 +380,15 @@ fi
380380

381381
wrap_wheel_builder build
382382

383+
# A safety catch for iOS. iOS can't use dynamic libraries, but clang will prefer
384+
# to link dynamic libraries to static libraries. The only way to reliably
385+
# prevent this is to not have dynamic libraries available in the first place.
386+
# The build process *shouldn't* generate any dylibs... but just in case, purge
387+
# any dylibs that *have* been installed into the build prefix directory.
388+
if [[ -n "$IOS_SDK" ]]; then
389+
find "$BUILD_PREFIX" -name "*.dylib" -exec rm -rf {} \;
390+
fi
391+
383392
# Return to the project root to finish the build
384393
popd > /dev/null
385394

0 commit comments

Comments
 (0)