Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move XCFrameworks to lib/XCFrameworks #3504

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ let package = Package(
),
.binaryTarget(
name: "IceCpp",
path: "cpp/lib/Ice.xcframework"
path: "cpp/lib/XCFrameworks/Ice.xcframework"
),
.binaryTarget(
name: "IceDiscoveryCpp",
path: "cpp/lib/IceDiscovery.xcframework"
path: "cpp/lib/XCFrameworks/IceDiscovery.xcframework"

),
.binaryTarget(
name: "IceLocatorDiscoveryCpp",
path: "cpp/lib/IceLocatorDiscovery.xcframework"
path: "cpp/lib/XCFrameworks/IceLocatorDiscovery.xcframework"

),
.executableTarget(
Expand Down
20 changes: 10 additions & 10 deletions cpp/config/Make.xcframework.rules
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ xcframework-flags = $(foreach p,$($1_platforms),-library $(call xcframework-
# $(call create-xcframework,$1=framework-name)
define create-xcframework

lib/$1.xcframework: $(call xcframework-libraries,$1)
$(E) Creating lib/$1.xcframework from $(call xcframework-libraries,$1)
$(Q)$(RM) -r lib/$1.xcframework
lib/XCFrameworks/$1.xcframework: $(call xcframework-libraries,$1)
$(E) Creating lib/XCFrameworks/$1.xcframework from $(call xcframework-libraries,$1)
$(Q)$(RM) -r lib/XCFrameworks/$1.xcframework
$(Q)if [ -d include/$1 ]; then \
xcodebuild -create-xcframework $(call xcframework-flags,$1,true) -output lib/$1.xcframework ; \
find lib/$1.xcframework -name Headers -prune -exec mv {} {}_$1 \; -exec mkdir {} \; -exec mv {}_$1 {}/$1 \; ; \
xcodebuild -create-xcframework $(call xcframework-flags,$1,true) -output lib/XCFrameworks/$1.xcframework ; \
find lib/XCFrameworks/$1.xcframework -name Headers -prune -exec mv {} {}_$1 \; -exec mkdir {} \; -exec mv {}_$1 {}/$1 \; ; \
if [ -d include/generated/$1 ]; then \
find lib/$1.xcframework -name Headers -prune -exec cp -r include/generated/$1/* {}/$1 \; ; \
find lib/XCFrameworks/$1.xcframework -name Headers -prune -exec cp -r include/generated/$1/* {}/$1 \; ; \
fi \
else \
xcodebuild -create-xcframework $(call xcframework-flags,$1) -output lib/$1.xcframework; \
xcodebuild -create-xcframework $(call xcframework-flags,$1) -output lib/XCFrameworks/$1.xcframework; \
fi

srcs all:: lib/$1.xcframework
srcs all:: lib/XCFrameworks/$1.xcframework

clean::
$(E) Cleaning lib/$1.xcframework
$(Q)$(RM) -r lib/$1.xcframework
$(E) Cleaning lib/XCFrameworks/$1.xcframework
$(Q)$(RM) -r lib/XCFrameworks/$1.xcframework
endef

ifeq ($(filter $(config),static),)
Expand Down