Skip to content

Commit 51e7ded

Browse files
committed
Add circle ci 2.0
1 parent 9a5277d commit 51e7ded

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

build_ios_fat.sh

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
11
#!/bin/bash
22

3-
# git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git
4-
# git clone https://github.com/leetal/ios-cmake
5-
# cd socket.io-client-cpp
6-
73
export DARWIN_DEPLOYMENT_TARGET=8.0
84

9-
archs="armv7 armv7s arm64 i386 x86_64"
5+
build_type=${1:-Release}
6+
rebuild=${2}
7+
archs="armv7 armv7s armv8 x86 x86_64"
108

119
rm -rf build-ios-*/
1210
rm libssl.a
1311
rm libcrypto.a
1412
rm libboost_*.a
1513
rm libsioclient_tls.a
1614

15+
if [ ! -d ios-cmake ]; then
16+
git clone https://github.com/leetal/ios-cmake
17+
fi
18+
1719
for arch in $archs; do
1820
mkdir -p build-ios-$arch && pushd build-ios-$arch
1921

20-
conan install .. --profile ~/.conan/profiles/ios-$arch --build
22+
conan install .. -s arch=${arch} -s compiler=apple-clang -s compiler.version=9.1 -s os=iOS -s os.version=8.0 -s compiler.libcxx=libc++ -s build_type=${build_type} ${rebuild}
2123

2224
platform="OS"
23-
if [ "$arch" = "i386" ]; then
25+
if [ "$arch" = "x86" ]; then
2426
platform="SIMULATOR"
2527
elif [ "$arch" = "x86_64" ]; then
2628
platform="SIMULATOR64"
2729
fi
2830

29-
cmake -DCMAKE_TOOLCHAIN_FILE=../ios-cmake/ios.toolchain.cmake -DIOS_PLATFORM=$platform ..
31+
cmake -DCMAKE_TOOLCHAIN_FILE=../ios-cmake/ios.toolchain.cmake -DIOS_PLATFORM=$platform -DIOS_DEPLOYMENT_TARGET=8.0 -DENABLE_BITCODE=YES -DCMAKE_BUILD_TYPE=${build_type} ..
3032
cmake --build .
3133

3234
popd
3335
done
3436

35-
lipo -create build-ios-arm64/libsioclient_tls.a build-ios-x86_64/libsioclient_tls.a build-ios-i386/libsioclient_tls.a -output libsioclient_tls.a
37+
lipo -create build-ios-armv8/libsioclient_tls.a build-ios-x86_64/libsioclient_tls.a build-ios-x86/libsioclient_tls.a -output libsioclient_tls.a
3638

3739
lipo -create ~/.conan/data/OpenSSL/1.1.1/conan/stable/package/*/lib/libssl.a -output libssl.a
3840
lipo -create ~/.conan/data/OpenSSL/1.1.1/conan/stable/package/*/lib/libcrypto.a -output libcrypto.a

circle.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: ~/socket.io-client-cpp
5+
macos:
6+
xcode: "9.0"
7+
steps:
8+
- checkout
9+
- run:
10+
name: "Pull Submodules"
11+
command: |
12+
git submodule init
13+
git submodule update --remote
14+
- run:
15+
name: Install dependencies
16+
command: brew install conan cmake
17+
- run:
18+
name: Building
19+
command: ./build_ios_fat.sh Release --build

0 commit comments

Comments
 (0)