gnome: use target c_args/c_link_args for g-ir-scanner when cross-compiling
When cross-compiling we shouldn't be passing the native c_args/c_link_args to
g-ir-scanner.
@@ -518,7 +518,12 @@ class GnomeModule(ExtensionModule):
ret = []
for lang in langs:
- for link_arg in state.environment.coredata.get_external_link_args(lang):
+ if state.environment.is_cross_build():
+ link_args = state.environment.cross_info.config["properties"].get(lang + '_link_args', "")
+ else:
+ link_args = state.environment.coredata.get_external_link_args(lang)
+
+ for link_arg in link_args:
if link_arg.startswith('-L'):
ret.append(link_arg)
@@ -691,6 +696,9 @@ class GnomeModule(ExtensionModule):
def _get_external_args_for_langs(self, state, langs):
ret = []
for lang in langs:
+ if state.environment.is_cross_build():
+ ret += state.environment.cross_info.config["properties"].get(lang + '_args', "")
+ else:
ret += state.environment.coredata.get_external_args(lang)
return ret
