diff options
author | Jonathan Schwender <55576758+jschwe@users.noreply.github.com> | 2024-11-02 17:08:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-02 16:08:19 +0000 |
commit | 0759dde11b8cbf8f06dee35314c60c845bd4062d (patch) | |
tree | 38a444bdd470c9b2a23d6e2eceeca9dd7ca07ee3 /python/servo/build_commands.py | |
parent | 900d13fc2f785fa48346e6cfe2b1ab91790e4f5f (diff) | |
download | servo-0759dde11b8cbf8f06dee35314c60c845bd4062d.tar.gz servo-0759dde11b8cbf8f06dee35314c60c845bd4062d.zip |
ohos: Fix mach build on windows hosts (#34113)
With the latest release (5.0) of the OpenHarmony SDK
libclang.dll is now available and we can support
building for OpenHarmony from windows hosts.
Other changes required for building OH on windows:
- We can't use the `<target_triple>-clang` wrappers, since
those are bash scripts, which fails on windows when cc-rs
tries to directly call them. However, we already pass all
the required flags the wrapper script would set, so this
is not an issue.
- We need to use posix paths, otherwise the sysroot parameter
will not be applied correctly (by bindgen). It seems to only
cause issues with bindgen in practice, possibly because
bindgen interprets the path with
[`shlex::split`](https://github.com/rust-lang/rust-bindgen/blob/8a6d851318153b7304b651a7fd8f559938683de3/bindgen/lib.rs#L312C27-L312C40)
which presumably causes the issues with windows paths.
To be consistent I decided to use posix paths for all paths.
- Fix checks for copying dlls. We need to check the target OS,
not the host OS when determining what libraries to copy.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Diffstat (limited to 'python/servo/build_commands.py')
-rw-r--r-- | python/servo/build_commands.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 1754bfbbe19..c48999f99f9 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -138,11 +138,11 @@ class MachCommands(CommandBase): if rv: return rv - if sys.platform == "win32": + if "windows" in target_triple: if not copy_windows_dlls_to_build_directory(built_binary, self.target): status = 1 - elif sys.platform == "darwin": + elif "darwin" in target_triple: servo_bin_dir = os.path.dirname(built_binary) assert os.path.exists(servo_bin_dir) |