Debian Codegraph @

LspCpp/third_party/ixwebsocket/tools/build_ios.sh

raw
1 #!/bin/sh
2
3 #
4 # This script creates static libraries for macOS and iOS devices
5 #
6 # To use a specific OpenSSL version add the arguments:
7 # -DOPENSSL_VERSION="[version]" \
8 # -DOPENSSL_FOUND=1 \
9 # -DOPENSSL_INCLUDE_DIR=[include path] \
10 # -DOPENSSL_LIBRARIES="[lib path]/libssl.a;[lib path]/libcrypto.a" \
11 #
12
13 DEPLOYMENT_TARGET_IOS='12.0'
14 DEPLOYMENT_TARGET_MAC='14.0'
15 CMAKE_DIR=/Applications/CMake.app/Contents/bin
16 CMAKE=${CMAKE_DIR}/cmake
17
18 ${CMAKE} \
19 .. \
20 -GXcode \
21 -DUSE_TLS=1
22
23 mkdir -p ios sim mac
24
25 xcodebuild -project 'ixwebsocket.xcodeproj' -target "ixwebsocket" -sdk iphoneos ARCHS='arm64' TARGET_BUILD_DIR='$(PWD)/ios' BUILT_PRODUCTS_DIR='$(PWD)/ios' TARGET_NAME='ixwebsocket' IPHONEOS_DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET_IOS}
26 xcodebuild -project 'ixwebsocket.xcodeproj' -target "ixwebsocket" -sdk iphonesimulator ARCHS='x86_64' TARGET_BUILD_DIR='$(PWD)/sim' BUILT_PRODUCTS_DIR='$(PWD)/sim' TARGET_NAME='ixwebsocket' IPHONEOS_DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET_IOS}
27 xcodebuild -project 'ixwebsocket.xcodeproj' -target "ixwebsocket" -destination 'platform=OS X' ARCHS='x86_64 arm64' TARGET_BUILD_DIR='$(PWD)/mac' BUILT_PRODUCTS_DIR='$(PWD)/mac' TARGET_NAME='ixwebsocket' MACOSX_DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET_MAC}
28
29 rm -rf ./out/*.a
30 rm -rf ./out/ios/*.a
31 rm -rf ./out/mac/*.a
32 mkdir -p out
33 mkdir -p ./out/ios ./out/mac
34 lipo -create "./ios/libixwebsocket.a" "./sim/libixwebsocket.a" -output ./out/ios/libixwebsocket.a
35 cp "./mac/libixwebsocket.a" ./out/mac/libixwebsocket.a