1 下载源代码
git clone https://github.com/pol51/OpenSSL-CMake.git
cd OpenSSL-CMake
mkdir build && cd build
pico build.sh 内容如下两行
cmake -GXcode ..
xcodebuild -project openssl.xcodeproj -alltargets -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk -configuration Release
CMakeList。txt加入
include(cmake/iOS_64.cmake)
cmake/iOS_64.cmake内容如下
set (CMAKE_IOS_DEVELOPER_ROOT /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/)
set(CMAKE_C_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang)
set(CMAKE_CXX_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++)
set (CMAKE_C_FLAGS "-I/Users/tom/Documents/source/OpenSSL-CMake-maste -I/Users/tom/Documents/source/OpenSSL-CMake-master/build/ssl/")
set (CMAKE_CXX_FLAGS "-I/Users/tom/Documents/source/OpenSSL-CMake-maste -I/Users/tom/Documents/source/OpenSSL-CMake-master/build/ssl/ -headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden")
set(CMAKE_OSX_ARCHITECTURES arm64)