Use glib-compile-resource's compiler type

Since we call `glib-compile-resources` through a custom_target(), we
need to set the compiler type we're targeting.
This commit is contained in:
Emmanuele Bassi 2021-09-18 13:59:01 +01:00
parent 7bc6ef8734
commit 6c42c79d6c

View File

@ -575,10 +575,13 @@ endif
if not meson.is_cross_build() or meson.has_exe_wrapper()
compiler_type = '--compiler=@0@'.format(cc.get_id())
plugin_resources_c = custom_target('plugin-resources.c',
input : 'test4.gresource.xml',
output : 'plugin-resources.c',
command : [glib_compile_resources,
compiler_type,
'--target=@OUTPUT@',
'--sourcedir=' + meson.current_source_dir(),
'--internal',
@ -604,6 +607,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
input : 'test.gresource.xml',
output : 'test.gresource',
command : [glib_compile_resources,
compiler_type,
'--target=@OUTPUT@',
'--sourcedir=' + meson.current_source_dir(),
'--sourcedir=' + meson.current_build_dir(),
@ -616,6 +620,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
input : 'test3.gresource.xml',
output : 'test_resources2.c',
command : [glib_compile_resources,
compiler_type,
'--target=@OUTPUT@',
'--sourcedir=' + meson.current_source_dir(),
'--internal',
@ -628,6 +633,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
input : 'test3.gresource.xml',
output : 'test_resources2.h',
command : [glib_compile_resources,
compiler_type,
'--target=@OUTPUT@',
'--sourcedir=' + meson.current_source_dir(),
'--internal',
@ -641,6 +647,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
depends : big_test_resource,
output : 'test_resources.c',
command : [glib_compile_resources,
compiler_type,
'--target=@OUTPUT@',
'--sourcedir=' + meson.current_source_dir(),
'--sourcedir=' + meson.current_build_dir(),
@ -653,6 +660,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
input : '111_digit_test.gresource.xml',
output : 'digit_test_resources.c',
command : [glib_compile_resources,
compiler_type,
'--target=@OUTPUT@',
'--sourcedir=' + meson.current_source_dir(),
'--sourcedir=' + meson.current_build_dir(),
@ -665,6 +673,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
input : '111_digit_test.gresource.xml',
output : 'digit_test_resources.h',
command : [glib_compile_resources,
compiler_type,
'--target=@OUTPUT@',
'--sourcedir=' + meson.current_source_dir(),
'--internal',
@ -710,6 +719,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
input : 'test5.gresource.xml',
output : 'test5.gresource',
command : [glib_compile_resources,
compiler_type,
'--target=@OUTPUT@',
'--sourcedir=' + meson.current_source_dir(),
'--sourcedir=' + meson.current_build_dir(),
@ -723,6 +733,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
input : 'test5.gresource.xml',
output : 'test_resources_binary.c',
command : [glib_compile_resources,
compiler_type,
'--target=@OUTPUT@',
'--sourcedir=' + meson.current_source_dir(),
'--sourcedir=' + meson.current_build_dir(),