Skip to content

Commit

Permalink
build: Use can_run_host_binaries instead of is_cross_build
Browse files Browse the repository at this point in the history
When generating introspection data we care about the ability of running
binaries on the host machine; if we can, even on a cross build, then
that's enough for us.
  • Loading branch information
ebassi committed Aug 18, 2024
1 parent 186c365 commit 3259285
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,11 @@ if get_option('gobject_types')
endif

# Optional dependency on GObject-Introspection; if GObject is disabled
# then we don't build introspection data either
gir = find_program('g-ir-scanner', required : get_option('introspection'))
build_gir = build_gobject and gir.found()
# Disable g-i when cross compiling by default because it rarely works unless
# special care has been taken, in which case the user can enable the option.
if meson.is_cross_build() and not get_option('introspection').enabled()
build_gir = false
endif
# then we don't build introspection data either.
#
# We only build introspection if we can run binaries on the host.
gir = find_program('g-ir-scanner', required: get_option('introspection'))
build_gir = get_option('introspection').allowed() and build_gobject and gir.found() and meson.can_run_host_binaries()

# Check for InitOnce on Windows
if host_system == 'windows'
Expand Down

0 comments on commit 3259285

Please sign in to comment.