build: Don't use ld and objcopy when cross-compiling
authorTing-Wei Lan <lantw@src.gnome.org>
Sun, 13 Mar 2022 07:14:12 +0000 (15:14 +0800)
committerTing-Wei Lan <lantw@src.gnome.org>
Sun, 13 Mar 2022 07:19:46 +0000 (15:19 +0800)
These commands don't work when compiling Windows binaries on Linux.

demos/gtk-demo/meson.build
demos/widget-factory/meson.build

index f594cd59b29cb96ec45bb1c22cc82cd1f30df587..fa63dbbb9be1a10999d5de424d8370f2519e1c1a 100644 (file)
@@ -160,7 +160,7 @@ endif
 
 ld = find_program('ld', required : false)
 
-if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
+if not meson.is_cross_build() and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
   glib_compile_resources = find_program('glib-compile-resources')
 
   # Create the resource blob
index 9a083eb1aca5dbb6ae6e019be3bac1596dbcc8c2..2cfc9732dc8f58099e98dc5d2108fa53279ed332 100644 (file)
@@ -8,7 +8,7 @@ endif
 
 ld = find_program('ld', required : false)
 
-if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
+if not meson.is_cross_build() and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
   glib_compile_resources = find_program('glib-compile-resources')
 
   # Create the resource blob