Add HarmonyOS support#51470
Draft
jobor wants to merge 4 commits intomicrosoft:masterfrom
Draft
Conversation
Delegates to the SDK's own ohos.toolchain.cmake, located via the OHOS_SDK_ROOT environment variable. Maps vcpkg architecture and CRT linkage settings to OHOS equivalents.
Shared library linkage for all three architectures supported by the OpenHarmony SDK: arm64-v8a, armeabi-v7a, and x86_64. The environment variable OHOS_SDK_ROOT is passed through, because on Windows, vcpkg builds in a sanitized environment that strips most variables. Without VCPKG_ENV_PASSTHROUGH_UNTRACKED the OHOS toolchain cannot find the SDK, failing at compiler detection. The triplets only build release variants, because without VCPKG_BUILD_TYPE, vcpkg generates both debug and release cmake config files. The debug libraries are not needed for cross-compilation and their presence causes CMake errors when the debug/lib/ directory is missing from the install prefix.
Register VCPKG_TARGET_IS_OHOS and map OHOS to the appropriate system libraries (dl, m, pthread, c++, rt, gcc). OHOS uses musl libc with LLVM's libc++, not libstdc++.
This was referenced Apr 30, 2026
Member
|
I'm going to put comments about this over in the tool repo one: microsoft/vcpkg-tool#2004 Drafting this because it would be merged in the context of that and should not be merged as an 'ordinary registry maintenance' change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #51302
This adds community triplets for HarmonyOS / OpenHarmony and the necessary toolchain file.