meson: Use meson.can_run_host_binaries()

It is not only shorter than `not meson.is_cross_build() or
meson.has_exe_wrapper()` but also handle the case of cross compiling to
a compatible arch such as building for i386 on an amd64.
This commit is contained in:
Xavier Claessens
2022-03-08 09:48:36 -05:00
committed by Philip Withnall
parent 25ab87d8e5
commit 374be41433
21 changed files with 21 additions and 30 deletions

View File

@@ -1,9 +0,0 @@
#!/usr/bin/env python3
import os
import subprocess
import sys
if not os.environ.get("DESTDIR"):
print("GIO module cache creation...")
subprocess.call([sys.argv[1], sys.argv[2]])

View File

@@ -978,7 +978,7 @@ glib_compile_resources = executable('glib-compile-resources',
# Cannot override those programs in cross compilation case because they are
# native executables that cannot be run on the build machine.
# See https://gitlab.gnome.org/GNOME/glib/issues/1859.
if not meson.is_cross_build()
if not meson.can_run_host_binaries()
meson.override_find_program('glib-compile-schemas', glib_compile_schemas)
meson.override_find_program('glib-compile-resources', glib_compile_resources)
meson.override_find_program('gio-querymodules', gio_querymodules)

View File

@@ -603,7 +603,7 @@ if installed_tests_enabled
endforeach
endif
if not meson.is_cross_build() or meson.has_exe_wrapper()
if meson.can_run_host_binaries()
compiler_type = '--compiler=@0@'.format(cc.get_id())