@@ -206,24 +206,22 @@ memenv_test : helpers/memenv/memenv_test.o $(MEMENVLIBRARY) $(LIBRARY) $(TESTHAR
206206ifeq ($(PLATFORM ) , IOS)
207207# For iOS, create universal object files to be used on both the simulator and
208208# 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)
213211IOSARCH =-arch armv6 -arch armv7 -arch armv7s -arch arm64
214212
215213.cc.o :
216214 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/$@
218216 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/$@
220218 xcrun lipo ios-x86/$@ ios-arm/$@ -create -output $@
221219
222220.c.o :
223221 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/$@
225223 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/$@
227225 xcrun lipo ios-x86/$@ ios-arm/$@ -create -output $@
228226
229227else
0 commit comments