Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion scripts/build_framework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ xcodebuild archive \
-destination generic/platform=iOS \
-archivePath ".build/archives/RiveRuntime_iOS" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
BUILD_LIBRARY_FOR_DISTRIBUTION=YES

xcodebuild archive \
-configuration ${CONFIGURATION} \
Expand Down Expand Up @@ -123,3 +123,16 @@ xcodebuild \
-framework RiveRuntime.framework \
-output archive/RiveRuntime.xcframework

# Strip the `module RiveRuntime.Swift { ... }` block from every modulemap in the
# XCFramework. The Swift build phase unconditionally appends this block, which
# bakes in C++ interop type definitions for the Swift version used to build the
# XCFramework. Consumers using a different Xcode/Swift version see conflicting
# definitions and get ODR errors. Removing the block prevents Clang from ever
# loading the stale header.
echo "Stripping RiveRuntime.Swift submodule from XCFramework modulemaps..."
find archive/RiveRuntime.xcframework -name "module.modulemap" | while read -r map; do
perl -0777 -i -pe 's/\n*^module RiveRuntime\.Swift \{[^}]*\}\n?//mg' "$map"
echo " Patched: $map"
done
echo "Done."

Loading