Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | Pass the correct cflags/ldflags to the gobject-introspection tools. |
| 2 | |
| 3 | Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/4261] |
| 4 | Signed-off-by: Ross Burton <ross.burton@intel.com> |
| 5 | |
| 6 | diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py |
| 7 | index cb69641e..bb4449a0 100644 |
| 8 | --- a/mesonbuild/modules/gnome.py |
| 9 | +++ b/mesonbuild/modules/gnome.py |
| 10 | @@ -579,7 +579,10 @@ class GnomeModule(ExtensionModule): |
| 11 | external_ldflags += list(dep_external_ldflags) |
| 12 | scan_command += ['--cflags-begin'] |
| 13 | scan_command += cflags |
| 14 | - scan_command += state.environment.coredata.get_external_args(lang) |
| 15 | + if state.environment.is_cross_build(): |
| 16 | + scan_command += state.environment.cross_info.config["properties"].get(lang + '_args', "") |
| 17 | + else: |
| 18 | + scan_command += state.environment.coredata.get_external_args(lang) |
| 19 | scan_command += ['--cflags-end'] |
| 20 | # need to put our output directory first as we need to use the |
| 21 | # generated libraries instead of any possibly installed system/prefix |
| 22 | @@ -614,7 +614,12 @@ class GnomeModule(ExtensionModule): |
| 23 | scan_command.append('-L' + d) |
| 24 | scan_command += ['--library', libname] |
| 25 | |
| 26 | - for link_arg in state.environment.coredata.get_external_link_args(lang): |
| 27 | + if state.environment.is_cross_build(): |
| 28 | + link_args = state.environment.cross_info.config["properties"].get(lang + '_link_args', "") |
| 29 | + else: |
| 30 | + link_args = state.environment.coredata.get_external_link_args(lang) |
| 31 | + |
| 32 | + for link_arg in link_args: |
| 33 | if link_arg.startswith('-L'): |
| 34 | scan_command.append(link_arg) |
| 35 | scan_command += list(external_ldflags) |