@ -206,24 +206,22 @@ memenv_test : helpers/memenv/memenv_test.o $(MEMENVLIBRARY) $(LIBRARY) $(TESTHAR
i f e q ( $( PLATFORM ) , I O S )
i f e q ( $( PLATFORM ) , I O S )
# For iOS, create universal object files to be used on both the simulator and
# For iOS, create universal object files to be used on both the simulator and
# a device.
# a device.
PLATFORMSROOT = /Applications/Xcode.app/Contents/Developer/Platforms
SIMULATORROOT = $( PLATFORMSROOT) /iPhoneSimulator.platform/Developer
DEVICEROOT = $( PLATFORMSROOT) /iPhoneOS.platform/Developer
IOSVERSION = $( shell defaults read $( PLATFORMSROOT) /iPhoneOS.platform/version CFBundleShortVersionString)
SIMULATORSDK = $( shell xcrun -sdk iphonesimulator --show-sdk-path)
DEVICESDK = $( shell xcrun -sdk iphoneos --show-sdk-path)
IOSARCH = -arch armv6 -arch armv7 -arch armv7s -arch arm64
IOSARCH = -arch armv6 -arch armv7 -arch armv7s -arch arm64
.cc.o :
.cc.o :
mkdir -p ios-x86/$( dir $@ )
mkdir -p ios-x86/$( dir $@ )
xcrun -sdk iphonesimulator $( CXX) $( CXXFLAGS) -isysroot $( SIMULATORROOT) /SDKs/iPhoneSimulator$( IOSVERSION) .sdk -arch i686 -arch x86_64 -c $< -o ios-x86/$@
xcrun -sdk iphonesimulator $( CXX) $( CXXFLAGS) -isysroot " $( SIMULATORSDK) " -arch i686 -arch x86_64 -c $< -o ios-x86/$@
mkdir -p ios-arm/$( dir $@ )
mkdir -p ios-arm/$( dir $@ )
xcrun -sdk iphoneos $( CXX) $( CXXFLAGS) -isysroot $( DEVICEROOT) /SDKs/iPhoneOS$( IOSVERSION) .sdk $( IOSARCH) -c $< -o ios-arm/$@
xcrun -sdk iphoneos $( CXX) $( CXXFLAGS) -isysroot " $( DEVICESDK) " $( IOSARCH) -c $< -o ios-arm/$@
xcrun lipo ios-x86/$@ ios-arm/$@ -create -output $@
xcrun lipo ios-x86/$@ ios-arm/$@ -create -output $@
.c.o :
.c.o :
mkdir -p ios-x86/$( dir $@ )
mkdir -p ios-x86/$( dir $@ )
xcrun -sdk iphonesimulator $( CC) $( CFLAGS) -isysroot $( SIMULATORROOT) /SDKs/iPhoneSimulator$( IOSVERSION) .sdk -arch i686 -arch x86_64 -c $< -o ios-x86/$@
xcrun -sdk iphonesimulator $( CC) $( CFLAGS) -isysroot " $( SIMULATORSDK) " -arch i686 -arch x86_64 -c $< -o ios-x86/$@
mkdir -p ios-arm/$( dir $@ )
mkdir -p ios-arm/$( dir $@ )
xcrun -sdk iphoneos $( CC) $( CFLAGS) -isysroot $( DEVICEROOT) /SDKs/iPhoneOS$( IOSVERSION) .sdk $( IOSARCH) -c $< -o ios-arm/$@
xcrun -sdk iphoneos $( CC) $( CFLAGS) -isysroot " $( DEVICESDK) " $( IOSARCH) -c $< -o ios-arm/$@
xcrun lipo ios-x86/$@ ios-arm/$@ -create -output $@
xcrun lipo ios-x86/$@ ios-arm/$@ -create -output $@
e l s e
e l s e