Skip to content

Commit 1285733

Browse files
FeodorFitsnerCreeper19472
authored andcommitted
Fix framework identifier formatting in xcframework_utils.sh
Ensures that the generated framework identifier does not start with a dash and defaults to 'framework' if empty. This improves compatibility and prevents invalid identifiers when creating xcframeworks from dylibs.
1 parent a02857a commit 1285733

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

darwin/xcframework_utils.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ create_xcframework_from_dylibs() {
5555
dylib_without_ext=$(echo $dylib_relative_path | cut -d "." -f 1)
5656
framework=$(echo $dylib_without_ext | tr "/" ".")
5757
framework_identifier=${framework//_/-}
58+
while [[ $framework_identifier == -* ]]; do
59+
framework_identifier=${framework_identifier#-}
60+
done
61+
framework_identifier=${framework_identifier:-framework}
5862

5963
# creating "iphoneos" framework
6064
fd=iphoneos/$framework.framework
@@ -97,4 +101,4 @@ create_xcframework_from_dylibs() {
97101
# cleanup
98102
popd >/dev/null
99103
rm -rf "${tmp_dir}" >/dev/null
100-
}
104+
}

0 commit comments

Comments
 (0)