Libuv porting to iOS

Source: Internet
Author: User

LIBUV website only provides the method of compiling OS X, without iOS. Since OS X is about the same as the iOS system kernel,
and the compilation tool is Xcode, so we can just re-specify the CPU architecture, we will be able to compile the iOS version.

1. Install Python, the official website has OS X version: python.org/download, download Python 3.x Mac Installer disk image
2. Open image, inside the installation file is pythom.mpkg, double-click is not open, to right--open mode--installer.
3. After installation, open terminal, enter Python to see if the installation is successful
4. Download the latest source code on the LIBUV website: https://github.com/joyent/libuv
5. Enter the LIBUV in the terminal and enter
$ mkdir-p Build
$ git clone https://git.chromium.org/external/gyp.git Build/gyp
If you don't have git, install git first.
6.$./gyp_uv.py-f Xcode
Generate the Xcode project file uv.xcodeproj. I made a mistake in this step, the error comes from subprocess.py,

I changed it. gyp_uv.py's get_compiler_version () function simply returns the compiler's version information.

$ xcodebuild-archs= "x86_64 i386"-project uv.xcodeproj \
-configuration Release-target All
Build the OS X version of the Library
7. The theory is to change-archs to "ARMv7 armv7s arm64" can be generated on the iOS version, but for the sake of insurance, or open
Uv.xcodeproj, then modify the architecture information in build setting:
Basesdk:latest IOS
Architecture:armv7,armv7s,arm64
Supported Platform:ios
Valid architecture:arm64 armv7 armv7s
8. We first compile with iOS Device, generate the real machine version of the library, in the Debug-iphoneos directory
Then compile with Simulater, generate the emulator version of the library, in the Debug-iphonesimulater directory
9 in order to be convenient for later use, we need to synthesize the above two libraries into one
Lipo-create DEBUG-IPHONEOS/LIBUV.A debug-iphonesimulater/libuv.a-output LIBUV.A
Done

Libuv porting to iOS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.