From 0e4d35968d8606f422ce31358a5d4d34870a2665 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 16 Apr 2020 10:46:39 -0700 Subject: tests/common/93: Fix cross building when no exe_wrapper is available By building the generator for the build machine always, and only for the host machine if an exe_wrapper is available. This makes sense to me as generally you are going to build the generator for the build machine, not the host machine, but testing on the host machine makes sense too. --- test cases/common/93 selfbuilt custom/meson.build | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test cases/common/93 selfbuilt custom/meson.build b/test cases/common/93 selfbuilt custom/meson.build index fc5d916eb..3cc3906b6 100644 --- a/test cases/common/93 selfbuilt custom/meson.build +++ b/test cases/common/93 selfbuilt custom/meson.build @@ -17,7 +17,7 @@ test('maintest', main) lib = library('libtool', 'tool.cpp') -checkarg = executable('checkarg', 'checkarg.cpp') +checkarg = executable('checkarg', 'checkarg.cpp', native : true) ctlib = custom_target('ctlib', output : 'ctlib.out', @@ -25,3 +25,15 @@ ctlib = custom_target('ctlib', command : [checkarg, lib], build_by_default : true, ) + +if meson.is_cross_build() and meson.has_exe_wrapper() + checkarg_host = executable('checkarg_host', 'checkarg.cpp') + + ctlib_host = custom_target( + 'ctlib_host', + output : 'ctlib.host.out', + capture : true, + command : [checkarg_host, lib], + build_by_default : true, + ) +endif -- cgit v1.2.3