diff options
author | Stas Sergeev <stsp2@yandex.ru> | 2023-12-08 01:57:43 +0500 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2023-12-08 12:31:01 -0500 |
commit | be04234c852dc99d486f4199da26b272597bf0c7 (patch) | |
tree | aced5bacac865bfe8baa420f8d132a6fc24ce8ea /mesonbuild/modules | |
parent | 5de09cbe8838e8febf1ca3aa83b53cf06972bff3 (diff) | |
download | meson-be04234c852dc99d486f4199da26b272597bf0c7.zip meson-be04234c852dc99d486f4199da26b272597bf0c7.tar.gz meson-be04234c852dc99d486f4199da26b272597bf0c7.tar.bz2 |
external_project.py: fix --host value
Currently in cross-compilation mode the --host is set to x86-linux-linux,
which results in an error.
Change the code so that for x86 and x86_64 the second part is 'pc',
and 'unknown' for the rest.
Use cpu model instead of cpu family for the first part, as suggested
by @dcbaker
As the result, we get: i386-pc-linux on my setup.
Fixes #12608
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r-- | mesonbuild/modules/external_project.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/modules/external_project.py b/mesonbuild/modules/external_project.py index bd6eba4..4247ba0 100644 --- a/mesonbuild/modules/external_project.py +++ b/mesonbuild/modules/external_project.py @@ -136,8 +136,9 @@ class ExternalProject(NewExtensionModule): configure_cmd += self._format_options(self.configure_options, d) if self.env.is_cross_build(): - host = '{}-{}-{}'.format(self.host_machine.cpu_family, - self.build_machine.system, + host = '{}-{}-{}'.format(self.host_machine.cpu, + 'pc' if self.host_machine.cpu_family in {"x86", "x86_64"} + else 'unknown', self.host_machine.system) d = [('HOST', None, host)] configure_cmd += self._format_options(self.cross_configure_options, d) |