From a06d7cc7b8b99b80d863dfec23365cdcba2bc511 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 3 Apr 2019 16:45:05 +0100 Subject: [PATCH 1/3] build: Fix some whitespace problems in gio/tests/meson.build Signed-off-by: Philip Withnall --- gio/tests/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gio/tests/meson.build b/gio/tests/meson.build index a3efd33ab..00e32c341 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -571,7 +571,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() install_dir : installed_tests_execdir, install : installed_tests_enabled) - # Create resource data file + # Create resource data file test_resources_binary_c = custom_target('test_resources_binary.c', input : 'test5.gresource.xml', output : 'test_resources_binary.c', @@ -584,7 +584,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() '--c-name', '_g_binary_test1', '@INPUT@']) - # Create object file containing resource data + # Create object file containing resource data test_resources_binary = custom_target('test_resources.o', input : test_gresource_binary, output : 'test_resources.o', @@ -594,7 +594,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() '@INPUT@', '-o','@OUTPUT@']) - # Rename symbol to match the one in the C file + # Rename symbol to match the one in the C file test_resources_binary2 = custom_target('test_resources2.o', input : test_resources_binary, output : 'test_resources2.o', From ea8e6502d4d4a56ed05c47812546e71f8e4909fb Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 3 Apr 2019 16:45:58 +0100 Subject: [PATCH 2/3] build: Refactor resources test build instructions This introduces no functional changes, but combines two duplicated lists and makes the meson.build file a little easier to follow. Signed-off-by: Philip Withnall Helps: #1711 --- gio/tests/meson.build | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/gio/tests/meson.build b/gio/tests/meson.build index 00e32c341..29221013e 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -557,6 +557,15 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() copy : true, install : false) + resources_extra_sources = [ + test_gresource, + test_resources_c, + test_resources2_c, + test_resources2_h, + digit_test_resources_c, + digit_test_resources_h, + ] + # Create object file containing resource data # for testing the external data option if build_machine.system() == 'linux' @@ -603,21 +612,17 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() '@INPUT@', '@OUTPUT@']) - gio_tests += { - 'resources' : { - 'extra_sources' : [test_gresource, test_resources_c, test_resources2_c, - test_resources2_h, test_resources_binary_c, - test_resources_binary2, digit_test_resources_c, digit_test_resources_h], - }, - } - else - gio_tests += { - 'resources' : { - 'extra_sources' : [test_gresource, test_resources_c, test_resources2_c, - test_resources2_h, digit_test_resources_c, digit_test_resources_h], - }, - } + resources_extra_sources += [ + test_resources_binary_c, + test_resources_binary2, + ] endif + + gio_tests += { + 'resources' : { + 'extra_sources' : resources_extra_sources, + }, + } endif foreach test_name, extra_args : gio_tests From b11f323ee522d5421e144148415505b1ed9aed74 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 12 Apr 2019 14:13:58 +0100 Subject: [PATCH 3/3] tests: Only run --external-data test on GNU ld/objcopy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Other GCC-like implementations of ld/objcopy (like LLVM) don’t yet support the right command line arguments, so can’t compile the test. Signed-off-by: Philip Withnall https://gitlab.gnome.org/GNOME/glib/issues/1709 --- gio/tests/meson.build | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gio/tests/meson.build b/gio/tests/meson.build index 29221013e..2edc17438 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -566,9 +566,12 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() digit_test_resources_h, ] - # Create object file containing resource data - # for testing the external data option - if build_machine.system() == 'linux' + # Create object file containing resource data for testing the --external-data + # option. Currently only GNU ld and GNU objcopy support the right options. + # Support for --add-symbol was added to LLVM objcopy in 2019 + # (https://reviews.llvm.org/D58234). FIXME: This test could be enabled for + # LLVM once that support is in a stable release. + if build_machine.system() == 'linux' and cc.get_id() == 'gcc' test_gresource_binary = custom_target('test5.gresource', input : 'test5.gresource.xml', output : 'test5.gresource',