| 1 |
gen = files('manygen.py') |
| 2 |
py3_bin = import('python3').find_python() |
| 3 |
|
| 4 |
buildtype = get_option('buildtype') |
| 5 |
buildtype_args = '-Dfooxxx' # a useless compiler argument |
| 6 |
cc = meson.get_compiler('c') |
| 7 |
if cc.get_argument_syntax() == 'msvc' |
| 8 |
# We need our manually generated code to use the same CRT as the executable. |
| 9 |
# Taken from compilers.py since build files do not have access to this. |
| 10 |
if buildtype == 'debug' |
| 11 |
buildtype_args = '/MDd' |
| 12 |
elif buildtype == 'debugoptimized' |
| 13 |
buildtype_args = '/MDd' |
| 14 |
elif buildtype == 'release' |
| 15 |
buildtype_args = '/MD' |
| 16 |
endif |
| 17 |
outfiles = ['gen_func.lib', 'gen_func.c', 'gen_func.h', 'gen_func.o'] |
| 18 |
else |
| 19 |
outfiles = ['gen_func.a', 'gen_func.c', 'gen_func.h', 'gen_func.o'] |
| 20 |
endif |
| 21 |
|
| 22 |
generated = custom_target('manygen', |
| 23 |
output : outfiles, |
| 24 |
input : ['funcinfo.def'], |
| 25 |
command : [py3_bin, gen[0], '@INPUT@', '@OUTDIR@', buildtype_args, cc.get_argument_syntax(), cc.cmd_array()], |
| 26 |
) |