forked from chyh1990/protobuf-2.4.1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_ios.sh
executable file
·31 lines (25 loc) · 1.19 KB
/
build_ios.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
XCODEDIR=`xcode-select --print-path`
IOS_SDK=$(xcodebuild -showsdks | grep iphoneos | sort | head -n 1 | awk '{print $NF}')
SIM_SDK=$(xcodebuild -showsdks | grep iphonesimulator | sort | \
head -n 1 | awk '{print $NF}')
IPHONEOS_PLATFORM=${XCODEDIR}/Platforms/iPhoneOS.platform
IPHONEOS_SYSROOT=${IPHONEOS_PLATFORM}/Developer/SDKs/${IOS_SDK}.sdk
IPHONESIMULATOR_PLATFORM=${XCODEDIR}/Platforms/iPhoneSimulator.platform
IPHONESIMULATOR_SYSROOT=${IPHONESIMULATOR_PLATFORM}/Developer/SDKs/${SIM_SDK}.sdk
make distclean
export CXXFLAGS="-fPIC -fvisibility=hidden \
-arch armv7 -arch armv7s -arch arm64 \
-isysroot $IPHONEOS_SYSROOT -std=c++11 -stdlib=libc++"
./configure --build=armv7-apple-darwin13.0.0 --disable-shared \
--prefix=`pwd`/build-ios-OS --with-protoc=protoc --without-zlib
make -j3 && make install
make distclean
export CXXFLAGS="-fPIC -fvisibility=hidden -arch i386 \
-isysroot $IPHONESIMULATOR_SYSROOT -std=c++11 -stdlib=libc++"
export LDFLAGS="-arch i386 -isysroot $IPHONESIMULATOR_SYSROOT \
-miphoneos-version-min=7.0"
./configure --build=i386-apple-darwin13.0.0 --disable-shared \
--prefix=`pwd`/build-ios-SIMULATOR --with-protoc=protoc \
--without-zlib
make -j3 && make install