Skip to content

Commit 89ebded

Browse files
skribka04levlam
authored andcommitted
fix: remove duplicate "-simulator" when building XCFramework for iOS
In the Makefile, all targets (including simulators) are predefined, and the existing ifeq construct was appending an extra "-simulator" suffix to already simulator targets. As a result, identifiers like "iphoneos-simulator-simulator" were generated and the build failed.
1 parent 51780ad commit 89ebded

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

‎example/ios/Python-Apple-support.patch‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/Makefile b/Makefile
2-
index a1d13e9..8efcf20 100644
2+
index a1d13e9..34b8d32 100644
33
--- a/Makefile
44
+++ b/Makefile
55
@@ -18,8 +18,13 @@
@@ -79,18 +79,20 @@ index a1d13e9..8efcf20 100644
7979
# The architecture of the machine doing the build
8080
HOST_ARCH=$(shell uname -m)
8181
HOST_PYTHON=install/macOS/macosx/python-$(PYTHON_VERSION)
82-
@@ -212,6 +236,10 @@ ARCH-$(target)=$$(subst .,,$$(suffix $(target)))
83-
82+
@@ -213,11 +237,7 @@ ARCH-$(target)=$$(subst .,,$$(suffix $(target)))
8483
ifeq ($(os),macOS)
8584
TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-darwin
86-
+else ifeq ($(os),visionOS)
87-
+TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-xros
88-
+else ifeq ($(os),visionOS-simulator)
89-
+TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-xros-simulator
9085
else
91-
ifeq ($$(findstring simulator,$$(SDK-$(target))),)
92-
TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target))
93-
@@ -662,7 +690,7 @@ BZIP2_FATLIB-$(sdk)=$$(BZIP2_MERGE-$(sdk))/lib/libbz2.a
86+
- ifeq ($$(findstring simulator,$$(SDK-$(target))),)
87+
-TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target))
88+
- else
89+
-TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target))-simulator
90+
- endif
91+
+ TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target))
92+
endif
93+
94+
SDK_ROOT-$(target)=$$(shell xcrun --sdk $$(SDK-$(target)) --show-sdk-path)
95+
@@ -662,7 +682,7 @@ BZIP2_FATLIB-$(sdk)=$$(BZIP2_MERGE-$(sdk))/lib/libbz2.a
9496
XZ_MERGE-$(sdk)=$(PROJECT_DIR)/merge/$(os)/$(sdk)/xz-$(XZ_VERSION)
9597
XZ_FATLIB-$(sdk)=$$(XZ_MERGE-$(sdk))/lib/liblzma.a
9698

@@ -99,7 +101,7 @@ index a1d13e9..8efcf20 100644
99101
OPENSSL_FATINCLUDE-$(sdk)=$$(OPENSSL_MERGE-$(sdk))/include
100102
OPENSSL_SSL_FATLIB-$(sdk)=$$(OPENSSL_MERGE-$(sdk))/lib/libssl.a
101103
OPENSSL_CRYPTO_FATLIB-$(sdk)=$$(OPENSSL_MERGE-$(sdk))/lib/libcrypto.a
102-
@@ -716,14 +744,14 @@ $$(OPENSSL_SSL_FATLIB-$(sdk)): $$(foreach target,$$(SDK_TARGETS-$(sdk)),$$(OPENS
104+
@@ -716,14 +736,14 @@ $$(OPENSSL_SSL_FATLIB-$(sdk)): $$(foreach target,$$(SDK_TARGETS-$(sdk)),$$(OPENS
103105
mkdir -p $$(OPENSSL_MERGE-$(sdk))/lib
104106
lipo -create -output $$@ \
105107
$$(foreach target,$$(SDK_TARGETS-$(sdk)),$$(OPENSSL_SSL_LIB-$$(target))) \

0 commit comments

Comments
 (0)