Hello everyone, I’m currently attempting to use CesiumNative on HarmonyOS (Huawei’s operating system). However, I haven’t found any successful implementation of compiling CesiumNative version v0.51.0 (or newer versions) on HarmonyOS. Additionally, the third-party libraries managed by vcpkg don’t appear to have corresponding versions for HarmonyOS. May I ask when this compatibility work will be initiated? Or could you recommend any organization that might undertake this task?
@Just9570 It would be an interesting challenge! As long as Huawei devices still run on ARM processors, and support compiling C++20 code, it should be possible. The big problem though is that, for us here in the US, Huawei devices are subject to export restrictions and other legal headaches. Getting a HarmonyOS NEXT device for us to test with would itself be a big challenge. So, unfortunately, for the time being I think it isn’t likely for there to be an official push for compatibility. However, pull requests are always welcome! Anyone from the community who would like to give it a try is welcome to submit their changes to the Cesium Native repository and we’ll assist how we can.
Thank you for your response. I’m genuinely willing to take on this work. However, since Cesium Native adopted vcpkg starting from version 0.39.0, the biggest challenge I’ve encountered is the difficulty in locating complete source code for all third-party libraries with their correct versions.
I’m wondering if it would be possible to maintain support for developers to directly access and use the source code of all Cesium Native dependencies with guaranteed version correctness, rather than relying solely on vcpkg-managed binary files. Currently, obtaining third-party library source code based on Thirdparty.json feels quite cumbersome - developers must very carefully verify version compatibility and often worry about whether they’ve found the correct source code.
This alternative approach would greatly facilitate developers who need to perform deeper exploration and customization. Perhaps this might require special permissions or access?
@Just9570 Not being able to specify exact package versions is one of the flaws of vcpkg. Unfortunately, there just aren’t very good package managers available for C++ (which, I suppose, is understandable for a forty year old programming language). For Cesium Native, we try to make sure it works with the latest versions of all the packages it depends on from vcpkg, so looking up exactly the right version shouldn’t be necessary.
It’s true that vcpkg doesn’t have explicit support for HarmonyOS, but I think you should be able to accomplish this using a triplet. Triplets let you specify custom behavior for vcpkg to use when compiling libraries for a certain platform. You can see the triplets that come with vcpkg here, as well as some community-created triplets. You can create a new file with a name like “arm64-harmonyos.cmake” in cesium-native/extern/vcpkg/triplets and add a line to cesium-native/cmake/detect-vcpkg-triplet.cmake that sets DETECTED_VCPKG_TRIPLET to the name of that triplet (like arm64-harmonyos in this example) if you’re building for HarmonyOS. The .cmake file with the name matching DETECTED_VCPKG_TRIPLET will be loaded by vcpkg when it’s compiling libraries. You can add any fixes you need to make things build on HarmonyOS to your triplet CMake file.
But, first things first, I would simply download the HarmonyOS NDK and use the copy of CMake included in it to build Cesium Native. The information I see about HarmonyOS online suggests that building for it shouldn’t need any unique settings, so it might just work! If there are any issues, you can try to fix them using a custom triplet.