Skip to content

Compile on Client side

The Android, iOS and HarmonyOS use the dynamic library to call XQUIC features.

To build dynamic library from source code, it's necesarry to prepare the build toolchain of each platform before compiling.

You can use the xqc_build.sh script to build the dynamic library, which is located in the root directory.

If the common dependencies are not prepared, please refer to Getting Started.

TIP

Note: You need to specify the IOS/android/harmony build toolchain before compiling, download and set the environment variable as following steps, or directly modify CMAKE_TOOLCHAIN_FILE and HMOS_CMAKE_TOOLCHAIN in xqc_build.sh.

Parameters

The parameters of xqc_build.sh shows as follows:

  • <build_dir>: The directory where the temporary build files are generated.
  • <artifact_dir>: The directory where the output compiled files are generated.
  • <ssl_path>: The path of the OpenSSL library, which is defaultly set as ${pwd}/third_party/boringssl if not specified.

Android

Download and set the environment variable ANDROID_NDK before compiling, which is build toolchain of Android platform.

bash
# .
sh xqc_build.sh android <build_dir> <artifact_dir> <ssl_path>

iOS

Download and set the environment variable IOS_CMAKE_TOOLCHAIN before compiling, which is build toolchain of iOS platform.

bash
# .
sh xqc_build.sh ios <build_dir> <artifact_dir> <ssl_path>

HarmonyOS

Download and set the environment variable HMOS_CMAKE_PATH and HMOS_CMAKE_TOOLCHAIN before compiling, which is build toolchain of HarmonyOS platform.

bash
# .
sh xqc_build.sh harmony <build_dir> <artifact_dir> <ssl_path>