Jump to content

Solutions to build 3rdparty for HarmonyOS/OpenHarmony

From Qt Wiki

vcpkg

vcpkg is a free and open-source C/C++ package manager maintained by Microsoft and the C++ community that runs on Windows, macOS, and Linux. It is a C++ tool at heart and is written using C++ and CMake scripts. It is designed to address the unique pain points with managing C/C++ libraries.

Jörg Bornemann in Qt for HarmonyOS team added HarmonyOS support into vcpkg, and upstreamed.

Reference

HarmonyBrew

Homebrew (brew) is the de facto package manager for macOS (and also supports Linux). It simplifies installing, updating, and managing open-source software and development tools from the command line, eliminating the need to manually download and configure packages. (Note: Homebrew/brew is mostly in used for development, not for packaging, on macOS.)

HarmonyBrew is following Homebrew (brew).

  • Users(or developers) can install package via command line
  • Only support arm64, no support for x86/x64
  • Only run on HarmonyOS PC(2in1) devices(host build), and also on DockerHarmony Container
  • Not for HarmonyOS mobile and tablet(without desktop mode)

Reference:

lycium/tpc_c_cplusplus

lycium is a compilation framework tool that assists developers in quickly cross-compiling C/C++ third-party libraries using shell scripting and rapidly verifying them on the OpenHarmony system. Developers only need to set the compilation method and parameters for the corresponding C/C++ third-party libraries, and Lycium can quickly build binaries that can run on the OpenHarmony system.

  • Support arm64/armv7/x64
  • Cross compile, build results can be used for HarmonyOS mobile/tablets/PC(2in1).
  • Ubuntu 22.04(x64) is needed as host environment. (I tried Ubuntu 24.04, it doesn't work well.)
  • 344 packages in thirdparty folder, 173 packages in community folder. There are some duplicate packages with different versions.
  • Fixed version in HPKBUILD file, not easy to install different version, etc. (Very hard to use)

Reference