meson: only detect ICONV_OMITS_BOM if possible

In our Meson setup it automatically detects whether ICONV_OMITS_BOM should be defined. To check this, a piece of code is compiled and ran. When cross-compiling, it's not possible to run this piece of code. Guard this test with a can_run_host_binaries() check to ensure it can run. Signed-off-by: Toon Claes <toon@iotcl.com> Acked-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Toon Claes committed Dec 2, 2025 at 11:48 UTC 574ac610761495b7b7afcced7717188501402925
1 file changed +1 -1
meson.build
+1 -1
@@ -1064,7 +1064,7 @@ if iconv.found()
1064 }
1065 '''
1066
1067 - if compiler.run(iconv_omits_bom_source,
1067 + if meson.can_run_host_binaries() and compiler.run(iconv_omits_bom_source,
1068 dependencies: iconv,
1069 name: 'iconv omits BOM',
1070 ).returncode() != 0