Summary
Add HarmonyOS / OpenHarmony (OHOS) as a cross-compilation target in vcpkg with community triplets, a toolchain file, and platform detection — similar to existing Android and iOS support.
Motivation
HarmonyOS uses a Clang/LLVM-based NDK-style toolchain for native C/C++ development and is seeing significant adoption. We (The Qt Company) are porting Qt to HarmonyOS and need to cross-compile third-party dependencies for this target. We have a working implementation that we've been using in production:
Proposed changes
vcpkg-tool: Add ohos as a recognized platform identifier for supports expressions (one commit).
vcpkg registry:
- Toolchain file (
scripts/toolchains/ohos.cmake) that delegates to the SDK's native toolchain. Requires setting an environment variable OHOS_SDK_ROOT (SDK with API 12+).
- Three community triplets:
arm64-ohos, arm-ohos, x64-ohos — all producing dynamically linked libraries.
- Port patches for libraries needing OHOS-specific adjustments (currently: libpng, fontconfig, ICU). This could be contributed separately as well.
Note that we use ohos (not harmonyos) in all identifiers, consistent with the SDK's own naming and keeping triplet names short.
Structurally similar to the Xbox community triplet addition in #29210.
Questions before we submit PRs
- Is
ohos acceptable as the VCPKG_CMAKE_SYSTEM_NAME / supports term?
- Should the vcpkg-tool change be merged first, or can it be coordinated with the registry PR?
- Single PR (triplets + toolchain + port patches) or separate PRs?
Ready to submit once we have feedback on the approach.
Summary
Add HarmonyOS / OpenHarmony (OHOS) as a cross-compilation target in vcpkg with community triplets, a toolchain file, and platform detection — similar to existing Android and iOS support.
Motivation
HarmonyOS uses a Clang/LLVM-based NDK-style toolchain for native C/C++ development and is seeing significant adoption. We (The Qt Company) are porting Qt to HarmonyOS and need to cross-compile third-party dependencies for this target. We have a working implementation that we've been using in production:
Proposed changes
vcpkg-tool: Add
ohosas a recognized platform identifier forsupportsexpressions (one commit).vcpkg registry:
scripts/toolchains/ohos.cmake) that delegates to the SDK's native toolchain. Requires setting an environment variableOHOS_SDK_ROOT(SDK with API 12+).arm64-ohos,arm-ohos,x64-ohos— all producing dynamically linked libraries.Note that we use
ohos(notharmonyos) in all identifiers, consistent with the SDK's own naming and keeping triplet names short.Structurally similar to the Xbox community triplet addition in #29210.
Questions before we submit PRs
ohosacceptable as theVCPKG_CMAKE_SYSTEM_NAME/supportsterm?Ready to submit once we have feedback on the approach.