]> git.ipfire.org Git - thirdparty/git.git/commitdiff
meson: only detect ICONV_OMITS_BOM if possible
authorToon Claes <toon@iotcl.com>
Tue, 2 Dec 2025 10:48:09 +0000 (11:48 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Dec 2025 02:11:11 +0000 (11:11 +0900)
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>
meson.build

index f1b3615659e56a78a8b6db37c9ba9b2e8591dcc8..95348e69a413a928cb5017e111b8e3f110420245 100644 (file)
@@ -1064,7 +1064,7 @@ if iconv.found()
     }
   '''
 
-  if compiler.run(iconv_omits_bom_source,
+  if meson.can_run_host_binaries() and compiler.run(iconv_omits_bom_source,
     dependencies: iconv,
     name: 'iconv omits BOM',
   ).returncode() != 0