aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/platform/build_target.py
diff options
context:
space:
mode:
authorJonathan Schwender <55576758+jschwe@users.noreply.github.com>2024-10-30 05:40:59 +0100
committerGitHub <noreply@github.com>2024-10-30 04:40:59 +0000
commitbac1101163a436096fe0b71bed79094658bba3b2 (patch)
tree2baf70aabd5d6bc0ad41365f6ff1a02316b5df5f /python/servo/platform/build_target.py
parent7fa548f555310cf4e60ad054f6577fabf57938e0 (diff)
downloadservo-bac1101163a436096fe0b71bed79094658bba3b2.tar.gz
servo-bac1101163a436096fe0b71bed79094658bba3b2.zip
Fix CMake issues on OpenHarmony (#34062)
- We should use the CMake version from the NDK - ignore errors from unused commandline parameters, which can easily happen due to --gcc-toolchain, which is added by the default CMake code when compiling with Clang. - Previously servo didn't have any CMake dependency projects anymore, so these issues didn't surface. Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Diffstat (limited to 'python/servo/platform/build_target.py')
-rw-r--r--python/servo/platform/build_target.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/servo/platform/build_target.py b/python/servo/platform/build_target.py
index 2118e2e1efe..408dfcdff0f 100644
--- a/python/servo/platform/build_target.py
+++ b/python/servo/platform/build_target.py
@@ -343,7 +343,8 @@ class OpenHarmonyTarget(CrossBuildTarget):
env['HOST_CFLAGS'] = ''
env['HOST_CXXFLAGS'] = ''
- ohos_cflags = ['-D__MUSL__', f' --target={clang_target_triple}', f' --sysroot={ohos_sysroot}']
+ ohos_cflags = ['-D__MUSL__', f' --target={clang_target_triple}', f' --sysroot={ohos_sysroot}',
+ "-Wno-error=unused-command-line-argument"]
if clang_target_triple.startswith('armv7-'):
ohos_cflags.extend(['-march=armv7-a', '-mfloat-abi=softfp', '-mtune=generic-armv7-a', '-mthumb'])
ohos_cflags_str = " ".join(ohos_cflags)
@@ -352,6 +353,7 @@ class OpenHarmonyTarget(CrossBuildTarget):
env['TARGET_CXXFLAGS'] = ohos_cflags_str
# CMake related flags
+ env['CMAKE'] = ndk_root.joinpath("build-tools", "cmake", "bin", "cmake")
cmake_toolchain_file = ndk_root.joinpath("build", "cmake", "ohos.toolchain.cmake")
if cmake_toolchain_file.is_file():
env[f'CMAKE_TOOLCHAIN_FILE_{rust_target_triple}'] = str(cmake_toolchain_file)