Merge branch 'matthiasc/for-main' into 'main'

build: Try harder to work with nongnu ld

See merge request GNOME/gtk!6159
This commit is contained in:
Matthias Clasen 2023-06-28 23:31:41 +00:00
commit dd15accb79

View File

@ -746,9 +746,13 @@ if objcopy.found()
objcopy_supports_add_symbol = run_command(objcopy, '--help', check: false).stdout().contains('--add-symbol')
endif
ld = find_program('ld.bfd', 'ld', required : false)
ld_is_bfd = false
ld = find_program('ld', required : false)
if ld.found()
ld_is_bfd = run_command(ld, '--version', check: false).stdout().contains('GNU ld')
endif
if not meson.is_cross_build() and build_machine.cpu_family() == 'x86_64' and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
if not meson.is_cross_build() and build_machine.cpu_family() == 'x86_64' and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found() and ld_is_bfd
can_use_objcopy_for_resources = true
else
can_use_objcopy_for_resources = false