@@ -206,24 +206,22 @@ memenv_test : helpers/memenv/memenv_test.o $(MEMENVLIBRARY) $(LIBRARY) $(TESTHAR
206
206
ifeq ($(PLATFORM ) , IOS)
207
207
# For iOS, create universal object files to be used on both the simulator and
208
208
# a device.
209
- PLATFORMSROOT =/Applications/Xcode.app/Contents/Developer/Platforms
210
- SIMULATORROOT =$(PLATFORMSROOT ) /iPhoneSimulator.platform/Developer
211
- DEVICEROOT =$(PLATFORMSROOT ) /iPhoneOS.platform/Developer
212
- IOSVERSION =$(shell defaults read $(PLATFORMSROOT ) /iPhoneOS.platform/version CFBundleShortVersionString)
209
+ SIMULATORSDK =$(shell xcrun -sdk iphonesimulator --show-sdk-path)
210
+ DEVICESDK =$(shell xcrun -sdk iphoneos --show-sdk-path)
213
211
IOSARCH =-arch armv6 -arch armv7 -arch armv7s -arch arm64
214
212
215
213
.cc.o :
216
214
mkdir -p ios-x86/$(dir $@ )
217
- xcrun -sdk iphonesimulator $(CXX ) $(CXXFLAGS ) -isysroot $( SIMULATORROOT ) /SDKs/iPhoneSimulator $( IOSVERSION ) .sdk -arch i686 -arch x86_64 -c $< -o ios-x86/$@
215
+ xcrun -sdk iphonesimulator $(CXX ) $(CXXFLAGS ) -isysroot " $( SIMULATORSDK ) " -arch i686 -arch x86_64 -c $< -o ios-x86/$@
218
216
mkdir -p ios-arm/$(dir $@ )
219
- xcrun -sdk iphoneos $(CXX ) $(CXXFLAGS ) -isysroot $( DEVICEROOT ) /SDKs/iPhoneOS $( IOSVERSION ) .sdk $(IOSARCH ) -c $< -o ios-arm/$@
217
+ xcrun -sdk iphoneos $(CXX ) $(CXXFLAGS ) -isysroot " $( DEVICESDK ) " $(IOSARCH ) -c $< -o ios-arm/$@
220
218
xcrun lipo ios-x86/$@ ios-arm/$@ -create -output $@
221
219
222
220
.c.o :
223
221
mkdir -p ios-x86/$(dir $@ )
224
- xcrun -sdk iphonesimulator $(CC ) $(CFLAGS ) -isysroot $( SIMULATORROOT ) /SDKs/iPhoneSimulator $( IOSVERSION ) .sdk -arch i686 -arch x86_64 -c $< -o ios-x86/$@
222
+ xcrun -sdk iphonesimulator $(CC ) $(CFLAGS ) -isysroot " $( SIMULATORSDK ) " -arch i686 -arch x86_64 -c $< -o ios-x86/$@
225
223
mkdir -p ios-arm/$(dir $@ )
226
- xcrun -sdk iphoneos $(CC ) $(CFLAGS ) -isysroot $( DEVICEROOT ) /SDKs/iPhoneOS $( IOSVERSION ) .sdk $(IOSARCH ) -c $< -o ios-arm/$@
224
+ xcrun -sdk iphoneos $(CC ) $(CFLAGS ) -isysroot " $( DEVICESDK ) " $(IOSARCH ) -c $< -o ios-arm/$@
227
225
xcrun lipo ios-x86/$@ ios-arm/$@ -create -output $@
228
226
229
227
else
0 commit comments