The code below this already handles being passed an Executable or ExternalProgram, and it does it correctly, since it handles host binaries that need an exe_wrapper correctly, while the code in the generator paths doesn't. The xcode backend is, like always, problematic, it doesn't handle things the same way as the ninja and vscode backends, and generates a shell script instead of using meson as a wrapper when needed (it seems likely that just forcing the meson path for xcode would be better). I don't have a working mac to develop a fix for, so I've left a todo comment there. Fixes: #11264pull/11269/head
parent
8655287c56
commit
6aeec80836
10 changed files with 87 additions and 7 deletions
@ -0,0 +1,35 @@ |
||||
/* SPDX-License-Identifier: Apache-2.0 */ |
||||
/* Copyright © 2023 Intel Corporation */ |
||||
|
||||
#include <stdio.h> |
||||
#include <stdlib.h> |
||||
|
||||
int main(int argc, const char ** argv) { |
||||
if (argc != 3) { |
||||
fprintf(stderr, "%s %i %s\n", "Got incorrect number of arguments, got ", argc - 1, ", but expected 2"); |
||||
exit(1); |
||||
} |
||||
|
||||
FILE * input, * output; |
||||
|
||||
if ((input = fopen(argv[1], "rb")) == NULL) { |
||||
exit(1); |
||||
} |
||||
if ((output = fopen(argv[2], "wb")) == NULL) { |
||||
exit(1); |
||||
} |
||||
|
||||
fprintf(output, "#pragma once\n"); |
||||
fprintf(output, "#define "); |
||||
|
||||
char c; |
||||
while((c = fgetc(input)) != EOF) { |
||||
fputc(c, output); |
||||
} |
||||
fputc('\n', output); |
||||
|
||||
fclose(input); |
||||
fclose(output); |
||||
|
||||
return 0; |
||||
} |
@ -0,0 +1,9 @@ |
||||
#include "res1-cpp.h" |
||||
|
||||
int main(void) { |
||||
#ifdef res1 |
||||
return 0; |
||||
#else |
||||
return 1; |
||||
#endif |
||||
} |
@ -0,0 +1 @@ |
||||
int main(void) { return 0; } |
@ -0,0 +1 @@ |
||||
int foo(void) { return 7; } |
@ -0,0 +1,14 @@ |
||||
project('generator host binary no exe_wrapper') |
||||
|
||||
if meson.can_run_host_binaries() |
||||
error('MESON_SKIP_TEST: test requires that build machine cannot run host binaries') |
||||
endif |
||||
|
||||
add_languages('c', native : false) |
||||
|
||||
exe = executable('exe', 'exe.c', native : false) |
||||
|
||||
gen = generator(exe, output : '@BASENAME@.c', arguments : ['@INPUT@', '@OUTPU@']) |
||||
foo = gen.process('lib.in') |
||||
|
||||
library('foo', foo) |
@ -0,0 +1,5 @@ |
||||
{ |
||||
"stdout": [ |
||||
{ "line": "ERROR: An exe_wrapper is needed but was not found. Please define one in cross file and check the command and/or add it to PATH." } |
||||
] |
||||
} |
Loading…
Reference in new issue