Solutions to build 3rdparty for HarmonyOS/OpenHarmony
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.
- Supports arm64/armv7/x64
- Cross compile for now, build results can be used for HarmonyOS mobile/tablets/PC(2in1).
- Possiblity to support host build(haven't verified yet)
- All HarmonyOS supported host platforms, Windows/Linux/macOS, could be the host platforms for vcpkg
- Over 2300 open-source libraries... (Qt only verified about 10 packages, which are needed by Qt.)
- OpenHarmonyPCDeveloper verified more, https://gitcode.com/OpenHarmonyPCDeveloper/ohos_vcpkg/commit/caf73a640e29cba6e000082744e3467efe9827a0?ref=feature/mac
Reference
- https://www.qt.io/blog/building-libraries-for-harmonyos-with-vcpkg
- https://github.com/microsoft/vcpkg/releases/tag/2026.06.01
- https://learn.microsoft.com/en-us/vcpkg/get_started/overview
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:
- https://harmonybrew.atomgit.com
- https://atomgit.com/Harmonybrew
- https://mp.weixin.qq.com/s/EBANdI9ZuwP7PDT2QJppJw
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.
- Supports 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