一. 下載代碼
進入curl gthub下載github的release版本的代碼如下,我們使用的是7.71.1版本

image.png
二. 使用腳本
sh build_libcurl_ios.sh
三. 如果要編譯curl其他版本參考
常見問題
網(wǎng)上其他腳本容易出現(xiàn)
Can't cross-compile for iOS on macOS 10.15
Can't cross-compile for iOS on macOS 10.15 #4367
這里使用這個腳本不用出現(xiàn)問題,原因是編譯要cd到curl里面去,配置目錄會有問題導(dǎo)致。并不是上述的問題
腳本下載地址
https://github.com/xcysuccess/curl7.71/blob/master/build_libcurl_ios.sh