adamwulf / ClippingBezier

ClippingBezier calculates intersection points, paths, and shapes between two UIBezierPaths
http://getlooseleaf.com/opensource/
MIT License
254 stars 34 forks source link

Build ClippingBezier and PerformanceBezier as iOS Universal Framework #3

Closed codenia closed 4 years ago

codenia commented 6 years ago

Hello,

I would like to build the two frameworks ClippingBezier and PerformanceBezier as universal frameworks for iOS to run on the iOS devices and with the simulator.

First I need to create PerformanceBezier. In the "Build settings" I set "Build Active Architecture Only" and "ONLY_ACTIVE_PLATFORM" to NO.

When I build the framework I get an error "Shell Script Invocation Error": Create universal static library

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool -static /Users/admin/Library/Developer/Xcode/DerivedData/PerformanceBezier-dkiwfkhgbhutcqdugjfaqkvvlbsy/Build/Products/Debug-iphoneos/PerformanceBezier.framework/PerformanceBezier /Users/admin/Library/Developer/Xcode/DerivedData/PerformanceBezier-dkiwfkhgbhutcqdugjfaqkvvlbsy/Build/Products/Debug-iphonesimulator/PerformanceBezier.framework/PerformanceBezier -o /Users/admin/Library/Developer/Xcode/DerivedData/PerformanceBezier-dkiwfkhgbhutcqdugjfaqkvvlbsy/Build/Products/Debug-iphoneos/PerformanceBezier.framework/PerformanceBezier.temp

/Users/admin/Library/Developer/Xcode/DerivedData/PerformanceBezier-dkiwfkhgbhutcqdugjfaqkvvlbsy/Build/Intermediates/PerformanceBezier.build/Debug-iphoneos/PerformanceBezier.build/Script-66F2EBF51A8DC0CD00D536E9.sh: line 104: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool: No such file or directory

The "Build Framework Script" contains this:

echo "Create universal static library" echo "$PLATFORM_DEVELOPER_BIN_DIR/libtool" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp" "$PLATFORM_DEVELOPER_BIN_DIR/libtool" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp" echo mv "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}" mv "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}" fi

How can I fix this error and build ClippingBezier and PerformanceBezier as iOS Universal Framework?

codenia commented 6 years ago

I have changed the script now as follows:

echo "Create universal static library"

LIBTOOL_PATH=$(xcrun -sdk iphoneos -f libtool)

echo "$LIBTOOL_PATH" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp"

"$LIBTOOL_PATH" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp"

The libtool is now found and the framework is build successful but I get this warning when using the framework in a project and when starting in the simulator:

ld: warning: ignoring file /Users/admin/Desktop/iOS Projekte/Flooring/Libs/ClippingBezier-master/PerformanceBezier.framework/PerformanceBezier, missing required architecture i386 in file /Users/admin/Desktop/iOS Projekte/Flooring/Libs/ClippingBezier-master/PerformanceBezier.framework/PerformanceBezier (2 slices)

And errors "Apple Mach-O Linker Error Group" like "_bezierPointAtT", referenced from"

On the iPhone the app runs without errors.